NeurodataWithoutBorders / nwbinspector

Tool to help inspect NWB files for compliance with NWB Best Practices
https://nwbinspector.readthedocs.io/
Other
17 stars 10 forks source link

Use cached namespaces during validation #531

Closed stephprince closed 5 days ago

stephprince commented 1 month ago

Motivation

Fix #528.

Recent Zarr-related updates switched the inspector from using pynwb.validate(paths=paths) to pynwb.validate(io=io), resulting in the inspector not using cached namespaces during validation. We will temporarily revert this change, since pynwb validation of Zarr NWB files is not yet fully supported anyway due to pending issues that need to be addressed in hdmf/pynwb.

Since this is more of a bug on the pynwb side that using the io argument ignores the use_cached_namespaces=True setting in the validator (and will be updated in the next major pynwb release), I'm not sure if there are really any specific tests to add here.

While addressing this issue, I added a couple of other small updates to the Zarr support here:

  1. Passing the path of an NWB file Zarr folder to the CLI (instead of the parent folder) would result in 0 files being inspected, due to some conditionals in inspect_all that detected whether the path provided was a directory of NWB files or an NWB file.
  2. The test_inspect_all_parallel tests had been indented and were not running
stephprince commented 1 month ago

@rly you mentioned you had a related test file, can you let me know if this solves the issue or share the file?

stephprince commented 1 week ago

@rly this should be ready for you to test with your example file and review

codecov-commenter commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 86.72%. Comparing base (c26924b) to head (38620ca).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/NeurodataWithoutBorders/nwbinspector/pull/531/graphs/tree.svg?width=650&height=150&src=pr&token=772QROR5F0&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=NeurodataWithoutBorders)](https://app.codecov.io/gh/NeurodataWithoutBorders/nwbinspector/pull/531?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=NeurodataWithoutBorders) ```diff @@ Coverage Diff @@ ## dev #531 +/- ## ========================================== + Coverage 82.77% 86.72% +3.94% ========================================== Files 47 47 Lines 1504 1507 +3 ========================================== + Hits 1245 1307 +62 + Misses 259 200 -59 ``` | [Files with missing lines](https://app.codecov.io/gh/NeurodataWithoutBorders/nwbinspector/pull/531?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=NeurodataWithoutBorders) | Coverage Δ | | |---|---|---| | [src/nwbinspector/\_nwb\_inspection.py](https://app.codecov.io/gh/NeurodataWithoutBorders/nwbinspector/pull/531?src=pr&el=tree&filepath=src%2Fnwbinspector%2F_nwb_inspection.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=NeurodataWithoutBorders#diff-c3JjL253Ymluc3BlY3Rvci9fbndiX2luc3BlY3Rpb24ucHk=) | `87.40% <100.00%> (+4.83%)` | :arrow_up: | ... and [4 files with indirect coverage changes](https://app.codecov.io/gh/NeurodataWithoutBorders/nwbinspector/pull/531/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=NeurodataWithoutBorders)

🚨 Try these New Features: