-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Labels
category: bugerrors in the code or code behaviorerrors in the code or code behaviorcategory: enhancementimprovements of code or code behaviorimprovements of code or code behaviorpriority: lowalternative solution already working and/or relevant to only specific user(s)alternative solution already working and/or relevant to only specific user(s)
Milestone
Description
When customizing in the ObjectMapper the mapping for a constructor argument, the mapping is ignored if the function returns None. E.g.,
@register_map(Sweeps)
class SweepsMap(DynamicTableMap):
@ObjectMapper.constructor_arg('intracellular_recordings')
def intracellular_recordings_arg(self, builder, manager):
return None
will always be ignored. This is due to the following:
Lines 1204 to 1210 in 44c02ea
override = self.__get_override_carg(argname, builder, manager) | |
if override is not None: | |
val = override | |
elif argname in const_args: | |
val = const_args[argname] | |
else: | |
continue |
Here the check if override is not None:
is used to check if a constructor argument is overwritten or not. Instead the check should look for whether a custom mapping is defined, rather than using the None return value as an indicator that there is no overwrite.
Proposed solution Add function has_overwrite_carg to check if a constuctor argument is overwritten and use it instead.
Checklist
- Have you ensured the feature or change was not already reported ?
- Have you included a brief and descriptive title?
- Have you included a clear description of the problem you are trying to solve?
- Have you included a minimal code snippet that reproduces the issue you are encountering?
- Have you checked our Contributing document?
Metadata
Metadata
Assignees
Labels
category: bugerrors in the code or code behaviorerrors in the code or code behaviorcategory: enhancementimprovements of code or code behaviorimprovements of code or code behaviorpriority: lowalternative solution already working and/or relevant to only specific user(s)alternative solution already working and/or relevant to only specific user(s)