Drop pynwb < 3.1 compatibility code from pynwb_utils - #1939
Open
CodyCBakerPhD wants to merge 2 commits into
Open
CodyCBakerPhD wants to merge 2 commits into
CodyCBakerPhD wants to merge 2 commits into
Conversation
The declared floor is pynwb >= 3.1.0 (and nwbinspector >= 0.7.0 requires pynwb >= 3.1 anyway), which makes several version guards unreachable: - validate(): only the `pynwb.validate(path=...)` branch (pynwb >= 3.0) can run; the `paths=[...]` tuple-returning form (2.2 to 2.x) and the `io=` fallback for even older releases are gone. - copy_nwb_file(): `cache_spec` has been accepted by `export()` since pynwb 2.8.2, so pass it unconditionally. - _get_external_images(): `ExternalImage` exists in every supported pynwb, so import it at module level instead of guarding an ImportError. The now-unused `packaging.version.Version` import is removed as well. The NWB *schema* version checks (e.g. the < 2.1.0 error filter) are about the file being validated, not about pynwb, and are unchanged. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HFhMPs6vF5zyeHDvPTvRcA
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## claude/validate-broken-symlink-path #1939 +/- ##
=======================================================================
+ Coverage 78.33% 78.35% +0.02%
=======================================================================
Files 92 92
Lines 14087 14075 -12
=======================================================================
- Hits 11035 11029 -6
+ Misses 3052 3046 -6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…utils-drop-legacy-pynwb
Contributor
Author
|
Note: code is technically covered by the |
CodyCBakerPhD
removed this pull request from stack #1940
September 27, 2026 20:17
CodyCBakerPhD
added this pull request to stack #1942
September 27, 2026 20:17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Yet another split out of #1933 to clean up some dead code
The declared floor in the pyproject.toml is
pynwb >= 3.1.0(andnwbinspector >= 0.7.0requirespynwb >= 3.1anyway), which makes several version guards unreachable:pynwb.validate(path=...)branch (pynwb >= 3.0) can run; thepaths=[...]tuple-returning form (2.2 to 2.x) and theio=fallback for even older releases are gone.cache_spechas been accepted byexport()since pynwb 2.8.2, so pass it unconditionally.ExternalImageexists in every supported pynwb, so import it at module level instead of guarding an ImportError.The now-unused
packaging.version.Versionimport is removed as well. The NWB schema version checks (e.g. the < 2.1.0 error filter) are about the file being validated, not about pynwb, and are unchanged.Claude-Session: https://claude.ai/code/session_01HFhMPs6vF5zyeHDvPTvRcA