-
Notifications
You must be signed in to change notification settings - Fork 28
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
BF(workaround): loop through namespaces while validating nwb #1036
base: master
Are you sure you want to change the base?
Conversation
To overcome problems like presented in dandi/helpdesk#43 this introduces solution proposed by @orugbel in #917 (comment) Unfortunately there were no release of pynwb with that function yet, so we are doomed to duplicate code and do it "manually" here for now Closes #917
Codecov Report
@@ Coverage Diff @@
## master #1036 +/- ##
=======================================
Coverage 88.36% 88.36%
=======================================
Files 69 69
Lines 9064 9088 +24
=======================================
+ Hits 8009 8031 +22
- Misses 1055 1057 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Co-authored-by: John T. Wodder II <[email protected]>
Hey guys - I just tested the It works, but only if I set otherwise it throws
Any ideas what might be behind that? |
@CodyCBakerPhD I believe that's due to the mistake I pointed out in the comment right above yours. EDIT: Having seen your comment on that comment now, are you getting the validation error with or without the correction? |
I had corrected the |
What confuses me is if it were really running into a keyword matching issue like that, with |
@CodyCBakerPhD How can I obtain a problematic NWB file to test on? |
Files sent your way, hopefully you can replicate the problem I'm running into on the DANDI CLI side. I had actually already been running into this problem since yesterday on my own attempts to solve this very issue: https://github.com/catalystneuro/dandi-cli/blob/pynwb_validate_cached_schema/dandi/pynwb_utils.py#L337-L344 (albeit using some other dev branches in the works for PyNWB instead of copying the code, which I totally understand is the faster fix) So if you do figure out why the error was being caught there with |
@CodyCBakerPhD Cannot reproduce. After changing
|
@jwodder Very strange, must be something on my end then. Is the |
@CodyCBakerPhD Yes. Are you using the latest version of every package? |
Fresh environment (py 3.9) with this branch and only this branch installed via |
Also worth mentioning I tried on two separate devices (Windows and Mac) and ran into same behavior. |
So I was wondering why the lack of @CodyCBakerPhD @yarikoptic Shouldn't there be some sort of "namespaceless" |
For that, perhaps consult my attempts here: https://github.com/catalystneuro/dandi-cli/blob/pynwb_validate_cached_schema/dandi/pynwb_utils.py#L337-L344 which in your case would not use the passed boolean flag, but rather
Hmm... namespaces have been automatically cached in NWBFiles for some time now, how were/are they generated? Might want to update that if possible. Of course, if there aren't any cached it will use whatever is present in the environment, likely the most recent to that Now, as for testing this particular behavior of having a file that is invalid according to non-cached namespaces, but valid according to cached ones, my best suggestion would be to just use these example files (maybe hosting on a datalad set and automatically downloading that in the tests?) since artificially constructing something like that can prove a bit difficult. |
Co-authored-by: John T. Wodder II <[email protected]>
I guess the question is best addressed to @rly @oruebel . My understanding that everything should be defined in some namespace with |
@yarikoptic Looking at a local coverage report for this branch indicates that lines 361, 369-370, and 386 of commit 0d4fb0c are never run, indicating that |
Many thanks for your work on this all! On my end, I've modified our IPFX repository to not cache pynwb schemas when modifying our NWB files, reprocessed our NWB files, and can confirm that as of 259ae0d
|
nice observation! will check in greater detail later (may be |
@CodyCBakerPhD Was just wondering since we have an internal deadline to get our NWB files uploaded before July 13th (ideally ever sooner is better), is it safe to try to upload our fixed NWB files to our draft dandiset by using this branch? |
@njmei I don't see why not - assuming you removed the spurious core schemas in a similar way that I did. I'm able to access everything in the file just fine through PyNWB. Perhaps a couple 'Best Practice' suggestions from running the NWBInspector on the file (report is attached; ignore validation errors until I can propagate this kind of fix to the inspector), but nothing that would preclude a simple draft upload (publishing the dandiset might require the latin form of the subject species, though). |
moved to draft since the destiny of this PR and "original" PR in pynwb (NeurodataWithoutBorders/pynwb#1432) remains unclear. |
To overcome problems like presented in dandi/helpdesk#43
this introduces solution proposed by @oruebel in #917 (comment)
Unfortunately there were no release of pynwb with that function yet, so we
are doomed to duplicate code and do it "manually" here for now
Closes #917