-
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
default load_namespaces=True #1748
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #1748 +/- ##
==========================================
+ Coverage 91.75% 91.96% +0.21%
==========================================
Files 27 27
Lines 2619 2615 -4
Branches 684 682 -2
==========================================
+ Hits 2403 2405 +2
+ Misses 141 138 -3
+ Partials 75 72 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
I don't understand why I am failing flake8. @rly , can you help? |
The GitHub Action indicated the following flake8 issues:
|
oh, I see. It's the imports |
Currently, calling This comes from hdmf. I think we can remove that warning. @bendichter could you make a PR for this? |
Fix #1143 |
@bendichter just FYI, there were a few conflicts in particular in the streaming tutorial, when I updated the PR with the dev branch. Here the changes I made during the merge: |
The "coverage / ubuntu-latest" action seems to show a large number of warnings and one test failure that appear to be related to the changes in this PR (see https://github.com/NeurodataWithoutBorders/pynwb/actions/runs/6098358982/job/16548020150?pr=1748) In particular
Additionally, there are a lot of warnings where either no cached namespaces are found or another version of the same namespace has already been loaded:
|
@rly it looks like you are altering the NWBHDF5IO call to ignore the "no namespace found error". I guess this wouldn't really come up in practice since the NWB files are generally stored with cached schema. Is that right? |
Co-authored-by: Ben Dichter <[email protected]>
Co-authored-by: Ben Dichter <[email protected]>
That was done in hdmf-dev/hdmf#926 . But yes, that warning wouldn't really come up in practice except when reading old files where the schema was not cached by default. For those old files without the core/hdmf-common schema cached, even if the schema were cached, they would be ignored because the schema loaded by pynwb would take precedence. So it's not a useful warning. |
@bendichter can we merge this? |
# namespaces are not loaded when creating an NWBHDF5IO object in write mode | ||
if 'w' in mode or mode == 'x': | ||
raise ValueError("cannot load namespaces from file when writing to it") | ||
if mode in 'wx' or manager is not None or extensions is not None: |
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 think this introduced a bug.
if extensions is not None: | ||
warn("loading namespaces from file - ignoring 'extensions' argument") | ||
# namespaces are not loaded when creating an NWBHDF5IO object in write mode | ||
if 'w' in mode or mode == 'x': |
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.
Here was correct.
Fix #1143
test_outer_import_structure
tests that the imports available from thepynwb
module are unchanged. This PR removes thewarn
library, so it has also been removed form this test. This will technically break backwards compatibility if a user is runningfrom pynwb import warn
, but that would be highly unusual and unlikely.