[Feature]: Create NWBDatasetIncSpec and NWBGroupIncSpec #884
Labels
category: proposal
proposed enhancements or new features
priority: medium
non-critical problem and/or affecting only a small set of users
topic: docs
Issues related to documentation
topic: extension
issues related to extensions or dynamic class generation
What would you like to see added to HDMF?
When building extensions, users are often confused over how to define groups and datasets within a parent group. For example, one could define:
While technically legal, this nested type definition is difficult to parse. This code also hides the fact that the
Parcellation
is now defined and can be reused in other types. As a result, this goes against our schema best practices hdmf-dev/hdmf-schema-language#14This is the preferred code:
However, NWBDatasetSpec serves two different functions here. The first defines the new type. The second says only instances of this type can be used and at least one must be provided. In the first usage where the type is defined,
quantity
makes no sense, andname
really shouldn't be set. In the second usage,neurodata_type_def
should not be used, anddefault_name
doesn't really make sense. Same thing for groups.This is explained in the language, but honestly, I think this is confusing and the third row of the table is distinctly different from the other three and should be separated out as I describe below.
https://hdmf-schema-language.readthedocs.io/en/latest/description.html#data-type-def-and-data-type-inc
Is your feature request related to a problem?
No response
What solution would you like?
To make this distinction easier for users, I suggest adding new classes NWBDatasetIncSpec and NWBGroupIncSpec that are the only types allowed in a NWBGroupSpec definition under
groups
anddatasets
.neurodata_type_def
is not allowed here. I would also change the keyword to justneurodata_type
. We would also need to update the tutorials.We can also warn when
quantity
andname
are used in a NWBDatasetSpec that is not a NWBDatasetIncSpec (we cannot restrict it because that would break backwards compatibility).I suggest we also add these new spec types to the hdmf-schema-language.
Do you have any interest in helping implement the feature?
Yes.
Code of Conduct
The text was updated successfully, but these errors were encountered: