[Feature]: Include version of NWB standard used in validation errors
What would you like to see added to PyNWB?
Currently, the validate() function returns a list of validation errors constructed by the hdmf package. They don't contain information of which version of the NWB standard is used in the validation. It would be nice to have this information when encountering a validation error.
Is your feature request related to a problem?
We are trying to harmonize validation errors from different validators (of different standards) in Dandi. (https://github.com/dandi/dandi-cli/pull/1514, particularly https://github.com/dandi/dandi-cli/pull/1514#discussion_r2010844841)
What solution would you like?
Validation errors with a field indicating which version of NWB standard has been used in the validation process.
Do you have any interest in helping implement the feature?
No.
Code of Conduct
- [x] I agree to follow this project's Code of Conduct
- [x] Have you checked the Contributing document?
- [x] Have you ensured this change was not already requested?
@candleindark I like this suggestion to make it clear what NWB specification version was used during validation.
For the example you linked on harmonizing validation errors, it looked like the default pynwb.validate parameter of use_cached_namespaces=True was used. With that setting validation will be performed with the version of the spec that was cached in the NWBFile (which can be obtained with NWBHDF5IO.nwb_version or pynwb.get_nwbfile_version(). The exception is that if there is no cached namespace information, then it will default to validating against only the core namespace loaded by PyNWB.
@rly do you have any thoughts / suggestions for the best place to add this information? Would it be best added as a field to the HDMF validation error outputs? Or in the pynwb validation module?
Does the NWBFile now save any version information? Will extensions be able to save their version information as well?
Does the NWBFile now save any version information? Will extensions be able to save their version information as well?
@VisLab NWB saves the version in the nwb_version attribute. Also the full NWB schema as well as the schema for all extensions are cached in the NWB file in the 'specifications/ group such that version information can be retrieved from the cached schema. This particular issue here is related to clarifying the output of the validation tool.