nwb-schema icon indicating copy to clipboard operation
nwb-schema copied to clipboard

Attributes/datasets with dtype: "text" and enumeration-like values described by doc can not be enforced

Open ehennestad opened this issue 6 months ago • 1 comments

Some attributes / datasets have a doc specification listing a set of "allowed" values when dtype: "text"

Examples ImageSeries.format (dataset) https://github.com/NeurodataWithoutBorders/nwb-schema/blob/764aa372536db61339ec4ae578e0b375b4b54829/core/nwb.image.yaml#L105-L111

Timeseries.data.continuity (attribute) https://github.com/NeurodataWithoutBorders/nwb-schema/blob/764aa372536db61339ec4ae578e0b375b4b54829/core/nwb.base.yaml#L182-L190

I did a quick search and could not find any related issues, but I am wondering if it was ever disussed to add something like an enumeration key. So for example, the specification for ImageSeries.format could look like this:

  - name: format
    dtype: text
    default_value: raw
    enum: external, raw
    doc: Format of image. If this is 'external', then the attribute 'external_file'
      contains the path information to the image files. If this is 'raw', then the raw
      (single-channel) binary data is stored in the 'data' dataset. If this attribute
      is not present, then the default format='raw' case is assumed.

ehennestad avatar Jun 21 '25 08:06 ehennestad

As discussed, I opened https://github.com/hdmf-dev/hdmf-schema-language/issues/47 to address this.

rly avatar Jun 26 '25 07:06 rly