pynwb icon indicating copy to clipboard operation
pynwb copied to clipboard

[Feature]: Raise warning when writing data with unreleased version of schema

Open rly opened this issue 1 year ago • 8 comments

What would you like to see added to PyNWB?

I came across a (draft) dandiset with cached core schema version "2.6.0-alpha". This is a development/unreleased version of the schema, and probably results from the author using dev branches of nwb-schema and/or pynwb. NWB files should not be released with these unreleased schema because it makes debugging difficult (that version string can correspond to multiple specs/commits), and these schema may not be compatible with pynwb due to later fixes in the schema before the official release.

Is your feature request related to a problem?

^

What solution would you like?

I think we should raise a warning if a user writes an NWB file with an unreleased version of the schema or even loads an unreleased version of the schema. Alternatively, we could put this in NWB Inspector, but I think we can and should catch it on or before write.

Do you have any interest in helping implement the feature?

Yes.

Code of Conduct

rly avatar Feb 01 '24 09:02 rly

As you found this on DANDI, are you proposing too that there should be something preventing upload of such files to the archive?

A simple warning on the PyNWB side would not prevent that, but a new inspector check could

CodyCBakerPhD avatar Feb 01 '24 16:02 CodyCBakerPhD

Good point. I think we should prevent upload of such files to DANDI. @bendichter @oruebel what do you think?

rly avatar Feb 01 '24 17:02 rly

The ultimate policy decision is up to DANDI, but I agree that publishing data with alpha versions of the schema should be either blocked or at least raise a warning in the inspection phase since we can't guarantee support for alpha versions.

oruebel avatar Feb 01 '24 17:02 oruebel

The ultimate policy decision is up to DANDI, but I agree that publishing data with alpha versions of the schema should be either blocked or at least raise a warning in the inspection phase since we can't guarantee support for alpha versions.

cc: @yarikoptic @satra what do you guys think?

CodyCBakerPhD avatar Feb 01 '24 17:02 CodyCBakerPhD

AFAIK ATM we do not impose any limits on versions of nwb schema in the files really... I agree indeed it could be at least some kind of a WARNING level annotation by nwb inspector... and I would not mind ERROR level for "dandi" profile to avoid cases of unloadable files the future.

yarikoptic avatar Feb 01 '24 18:02 yarikoptic

OK, opened https://github.com/NeurodataWithoutBorders/nwbinspector/issues/432

Leaving this one here so there can be a PyNWB warning in the event more generally

CodyCBakerPhD avatar Feb 01 '24 19:02 CodyCBakerPhD

Thanks @CodyCBakerPhD .

I just learned that when we released NWB schema 2.6.0, we (I) forgot to change the version string from "2.6.0-alpha" to "2.6.0" in the nwb.namespace.yaml file. It was correctly updated in nwb.file.yaml though (in NWBFile group spec > attribute "nwb_version"). So please note that if you are troubleshooting these files.

When checking the version string, we can add exceptions for "2.6.0-alpha", "2.0b" and any other unusual released version strings. Or we can apply this check only for schema released after now, i.e. x.y.z >= 2.7.0. The former should not be hard to do. I'll take a crack at it next week.

rly avatar Feb 02 '24 00:02 rly

Update: I am not going to get to this this week or month. If someone else wants to take a crack at it, please feel free.

rly avatar Feb 05 '24 09:02 rly