-
Notifications
You must be signed in to change notification settings - Fork 11
Add check for NWB schema version to ensure official releases #607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
Add `check_nwb_schema_version_official_release` to validate that NWB files use official release versions rather than development or pre-release versions. This check is configured as CRITICAL for DANDI validation to ensure production data compatibility and reproducibility.
for more information, see https://pre-commit.ci
| import pynwb | ||
|
|
||
| # Get the schema version from the namespace catalog | ||
| manager = pynwb.get_manager() | ||
| core_namespace = manager.namespace_catalog.get_namespace("core") | ||
| schema_version = core_namespace.version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check uses the loaded namespace from PyNWB to check the schema version validity and not the nwbfile argument provided. I think it would be more direct to check the nwb_version attribute of the nwbfile provided. Thoughts?
| import unittest.mock | ||
|
|
||
| # Test development version | ||
| with unittest.mock.patch("pynwb.get_manager") as mock_manager: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the comment on the check, but I think these tests could also be updated/simplified using mock nwbfiles with the nwb_version attribute manually changed instead of patching the namespace manager
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #607 +/- ##
==========================================
+ Coverage 83.16% 87.32% +4.16%
==========================================
Files 47 47
Lines 1562 1578 +16
==========================================
+ Hits 1299 1378 +79
+ Misses 263 200 -63
🚀 New features to boost your workflow:
|
Add
check_nwb_schema_version_official_releaseto validate that NWB files use official release versions rather than development or pre-release versions. This check is configured as CRITICAL for DANDI validation to ensure production data compatibility and reproducibility.Motivation
fix #432