NeurodataWithoutBorders / nwb-schema

Data format specification schema for the NWB neurophysiology data format
http://nwb-schema.readthedocs.io
Other
52 stars 16 forks source link

Add optional "regex" to be used along with dtype "text" #426

Open yarikoptic opened 4 years ago

yarikoptic commented 4 years ago

ATM I have not spotted any ability in schema to constrain "text" values. Logical choice to provide such constrain would be a regular expression (note: there is a number of regular expression "languages").

Immediate use-case -- got a file with nwb_version set to NWB-2.2.0 although NWB- prefix was deprecated as of 2.1.0, and version in general should follow semantic version (and seems that post-release suffixes are in active use, e.g. in #422). pynwb happily validates that file since there is no constrains are supported at the schema level.

rly commented 4 years ago

@yarikoptic that is a good idea. this might also provide a flexible way to also describe enumerated types.

From where did you get a file with nwb_version set to NWB-2.2.0. I don't think PyNWB or MatNWB would generate such a file, so I assume it was set manually. I am concerned there might be other fields that are technically valid but not how we expect the data.

yarikoptic commented 4 years ago

From where did you get a file with nwb_version set to NWB-2.2.0.

Let me not disclose my sources (unless they decide to voice themselves), but they are now aware that they need to track it down how it came about ;)