nwb-extensions / ndx-template

A template for creating Neurodata Extensions for the NWB neurophysiology data standard
https://nwb.org/
Other
5 stars 8 forks source link

Error checking for create_extension_spec.py #72

Open pauladkisson opened 1 year ago

pauladkisson commented 1 year ago

Current Behavior

Users can place NWBGroups such as TimeSeries into other specs such as NWBDatasetSpec. The .yaml files are rendered without error and when these incorrectly defined extension types are used, HDMF throws hard-to-interpret error:

TypeError: GroupBuilder.set_dataset: incorrect type for 'builder' (got 'GroupBuilder', expected 'DatasetBuilder')

Expected Behavior

It would be really nice if create_extension_spec.py automatically checked the neurodata_types that are used in the extension and ensured that the NWBSpecs are fed the appropriate neurodata_types. Ex:

TypeError: NWBDataSpec: incorrect type for 'neurodata_type_inc' (got 'NWBGroup' expected 'NWBDataset')