-
Notifications
You must be signed in to change notification settings - Fork 84
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
Upgrade validation methods #1911
base: dev
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #1911 +/- ##
=======================================
Coverage 91.88% 91.88%
=======================================
Files 27 28 +1
Lines 2711 2737 +26
Branches 707 710 +3
=======================================
+ Hits 2491 2515 +24
- Misses 144 145 +1
- Partials 76 77 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
src/pynwb/__init__.py
Outdated
def _get_backend(path: str): | ||
from hdmf_zarr import NWBZarrIO | ||
|
||
backend_io_classes = [NWBHDF5IO, NWBZarrIO] | ||
backend_options = [b for b in backend_io_classes if b.can_read(path=path)] | ||
if len(backend_options) == 0: | ||
warn(f"Could not find an IO to read the file '{path}'." | ||
f"This may be due to an older file version or invalid file." | ||
f"Defaulting to NWBHDF5IO.", UserWarning) | ||
return NWBHDF5IO | ||
elif len(backend_options) > 1: | ||
raise ValueError(f"Multiple backends found for file '{path}': {backend_options}") | ||
else: | ||
return backend_options[0] |
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.
I have this temporary private method to start testing support for validation of Zarr NWB files as well. This can eventually be replaced by methods from the read_nwb
PR
@rly this should be ready for review There are a couple remaining TODO items related to validation support for NWBZarr files that could potentially be bumped to a separate PR:
|
Motivation
Addresses several issues summarized in #1808. This is a breaking change for the next major release.
validate
returns the same output whetherpaths
orio
is providedpynwb-validate
entry pointpython -m pynwb.validation_cli "test.nwb"
as an alternative to the entry pointvalidate
andvalidation cli
docstrings to point users to NWB inspectorpynwb.validate
intopynwb.validation
module so thatvalidate
is the function name andvalidation
is the module nameThis PR also modifies the validate method so that it
TODO
ZarrIO
Checklist
flake8
from the source directory.