-
Notifications
You must be signed in to change notification settings - Fork 90
Open
Labels
category: bugerrors in the code or code behaviorerrors in the 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)topic: testingissues related to testingissues related to testing
Milestone
Description
Right now the following throws an error:
from pynwb.misc import Units
from pynwb.testing.mock.file import mock_NWBFile
nwbfile = mock_NWBFile()
nwbfile.units = Units()
ValueError: Field 'units' on NWBFile must be named 'units'."Units default name is "Units" as supported by best practices for naming conventions:
assert Units().name == "Units"
And is defined here:
Lines 157 to 158 in 2259bed
| @docval({'name': 'name', 'type': str, 'doc': 'Name of this Units interface', 'default': 'Units'}, | |
| *get_docval(DynamicTable.__init__, 'id', 'columns', 'colnames'), |
However, the NWBFile has "units" as a required name for the attribute here on its fields:
Lines 272 to 273 in 2259bed
| {'name': 'units', 'child': True, 'required_name': 'units'}, | |
| {'name': 'subject', 'child': True, 'required_name': 'subject'}, |
So I think that one of the two should give? Which one makes more sense? Maybe the nwbfile.units should accept "Units" as the name? Should it be the other way around?
Metadata
Metadata
Assignees
Labels
category: bugerrors in the code or code behaviorerrors in the 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)topic: testingissues related to testingissues related to testing