Skip to content
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

Use inspect_nwbfile() instead of inspect_nwb(); address bug in recent ruamel.yaml versions #1285

Merged
merged 4 commits into from
May 10, 2023

Conversation

jwodder
Copy link
Member

@jwodder jwodder commented May 10, 2023

The test suite has been failing for the past few days with the following causes:

  • Calls to nwbinspector.inspect_nwb() (used to validate NWB files) were returning an error message reading:

    The API function 'inspect_nwb' has been deprecated and will be removed in a future release! To remove ambiguity, please call either 'inspect_nwbfile' giving a path to the unopened file on a system, or 'inspect_nwbfile_object' passing an already open pynwb.NWBFile object.

    and this ended up in the set of validation errors. I have replaced inspect_nwb() with inspect_nwbfile().

  • A bug in recent versions of ruamel.yaml was causing a certain spot in organize.py to fail. I addressed this by removing the age.pop("units", None) line, which seems to be unnecessary (at least in ruamel.yaml 0.17.21, released 2022-02-12, the last release before this month).

@jwodder jwodder added the patch Increment the patch version when merged label May 10, 2023
@CodyCBakerPhD
Copy link
Contributor

Huh, were they actual errors? I thought it was just a simple DeprecationWarning for the time being

@codecov
Copy link

codecov bot commented May 10, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.12 ⚠️

Comparison is base (64c883a) 89.04% compared to head (c8a1e3d) 88.93%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1285      +/-   ##
==========================================
- Coverage   89.04%   88.93%   -0.12%     
==========================================
  Files          76       76              
  Lines        9896     9896              
==========================================
- Hits         8812     8801      -11     
- Misses       1084     1095      +11     
Flag Coverage Δ
unittests 88.93% <100.00%> (-0.12%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
dandi/organize.py 83.50% <ø> (-0.04%) ⬇️
dandi/files/bases.py 78.52% <100.00%> (ø)
dandi/metadata.py 89.72% <100.00%> (+0.02%) ⬆️

... and 4 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@jwodder
Copy link
Member Author

jwodder commented May 10, 2023

@CodyCBakerPhD Our test suite is configured to turn any warning into an error, so it seems that the deprecation warning was raised as an error, which was caught by the validation method and turned into a validation failure.

@CodyCBakerPhD
Copy link
Contributor

Gotcha, thanks for catching that so quickly then!

Copy link
Member

@yarikoptic yarikoptic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two questions

@@ -19,7 +19,7 @@
from dandischema.models import Dandiset as DandisetMeta
from dandischema.models import get_schema_version
from etelemetry import get_project
from nwbinspector import Importance, inspect_nwb, load_config
from nwbinspector import Importance, inspect_nwbfile, load_config
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to boost minimal version for nwbinspector ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what version inspect_nwbfile() was added in. CC @CodyCBakerPhD

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was added in the latest version, so yes I would bump minimal.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

latest = 0.4.28

Keep in mind etelemetry complains (just a warning I think) if running validation when not using the latest release too, but upgrading the requirement is never a bad idea either

dandi/organize.py Show resolved Hide resolved
@yarikoptic yarikoptic merged commit e4f3c57 into master May 10, 2023
@yarikoptic yarikoptic deleted the fixes branch May 10, 2023 17:32
@yarikoptic
Copy link
Member

Thank you @jwodder for being proactive with this one!

@github-actions
Copy link

🚀 PR was released in 0.55.0 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Increment the patch version when merged released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants