-
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
[Bug]: PYNWB_VALIDATION when using ndx-miniscope extension #1777
Comments
We just discussed with @bendichter that this is more likely a pynwb validation error, I'll open an issue there. |
@weiglszonja I just went ahead and transferred it |
The ndx-miniscope extension defines a custom Device here: https://github.com/catalystneuro/ndx-miniscope/blob/main/spec/ndx-miniscope.extensions.yaml#L2-L4
@weiglszonja Can you share the full traceback of |
When you do |
@oruebel @CodyCBakerPhD Thank you for helping figuring out this issue,
returns
I just tried this on the file: from pynwb import validate
nwbfile_path = "C6-J588-Disc5.nwb"
print(validate(paths=[nwbfile_path], verbose=True)) returns
So the file passed the validation then? import nwbinspector
nwbfile_path = "C6-J588-Disc5.nwb"
print(list(nwbinspector.inspect_nwbfile(nwbfile_path))[0]) returns
|
The call pattern in the Inspector is actually slightly different; https://github.com/NeurodataWithoutBorders/nwbinspector/blob/dev/src/nwbinspector/nwbinspector.py#L555 Can you try again using the classical way of doing the validation? with NWBHDF5IO(...) as io:
pynwb.validate(io=io) |
you're right @CodyCBakerPhD ! from pynwb import validate
from pynwb import NWBHDF5IO
nwbfile_path = "C6-J588-Disc5.nwb"
with NWBHDF5IO(nwbfile_path, load_namespaces=True) as io:
print(validate(io=io, verbose=True)) returns
|
@weiglszonja could you please upload the file to https://drive.google.com/drive/u/0/folders/197eVWGgqSItz5DethQdEjlyw_-iCyRSY if you can, so that I can troubleshoot? Thanks. Strange that
and
have different results. I suspect that one is not loading the namespaces correctly. |
Thank you @rly , I uploaded a small file. |
Code snippet 1) above results in no validation errors - the correct behavior - because Code snippet 2) above results in a validation error because it only validates against a This raises a few questions.
|
@rly do you have a solution how to fix this? This validation error is triggered for any file that is using |
@weiglszonja @CodyCBakerPhD I created NeurodataWithoutBorders/nwbinspector#425 which should address the issue quickly. I think to address the issue in PyNWB without making the change above, we would have to make a breaking change to the behavior of I am in full support of making this change and created #1807 for it. To do this right, I would also want to make a change in the core validation code in HDMF to validate against all extension namespaces. That change may take a little time to implement, so, in the meantime, I recommend changing the code in nwbinspector to use Would that resolve the issue at hand? |
@rly Sounds great! Thanks for summarizing so clearly |
What happened?
When running nwbinspector on a file that uses ndx-miniscope to add Miniscope device, it flags a PYNWB_VALIDATION for the
ImagingPlane
as:However the device looks correctly linked to
ImagingPlane
:Operating System
M1 macOS
Python Version
3.9
Were you streaming with ROS3?
No
Package Versions
nwbinspector 0.4.30
ndx-miniscope 0.5.1
Code of Conduct
The text was updated successfully, but these errors were encountered: