Preserve legacy ndx-pose video references during organize - #1916
Preserve legacy ndx-pose video references during organize#1916AtomicGlance wants to merge 4 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1916 +/- ##
==========================================
+ Coverage 77.35% 77.44% +0.09%
==========================================
Files 89 89
Lines 13325 13397 +72
==========================================
+ Hits 10307 10375 +68
- Misses 3018 3022 +4
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:
|
|
I added the remaining regression coverage before asking for review: a close/reopen HDF5 persistence test, coverage through The full |
yarikoptic-gitmate
left a comment
There was a problem hiding this comment.
Nice, targeted fix. I checked it beyond just reading the diff: built a real NWB file with an actual ndx-pose PoseEstimation + ImageSeries, ran rename_nwb_external_files end-to-end, and confirmed original_videos and external_file both get renamed and persisted correctly — including with ndx-pose uninstalled (pynwb reconstructs PoseEstimation dynamically from the file's cached namespace spec), which validates the "not a required runtime dependency" claim. The unit tests are thorough on the edge cases that matter (byte/str values, path-separator normalization, URLs left alone, unrelated containers, longer replacement strings for variable-length HDF5 strings).
Two small things before this is good to merge:
- Were the new tests in
test_pynwb_utils.pywritten with AI assistance? If so, perDEVELOPMENT.mdthey should carry the@pytest.mark.ai_generatedmarker, as is done elsewhere in the suite (e.g.test_cmd_validate.py,test_base.py). - Could you extend the
rename_nwb_external_filesdocstring to mention that it now also updates legacyPoseEstimation.original_videosreferences (not justImageSeries.external_file)? Would help future readers who don't dig into_rename_pose_estimation_original_videos.
Otherwise this looks solid to me.
Generated by Claude Code
|
Addressed both points from the review:
The focused utility tests pass locally (7 passed), and the touched files pass the targeted flake8 check. The update is in commit |
4cc085d to
f1a3e99
Compare
Fixes #1817
Older ndx-pose files can store source-video paths in the deprecated
PoseEstimation.original_videosfield.dandi organize --update-external-file-pathspreviously renamed the linkedImageSeries.external_filevalues but left those legacy strings pointing at the old location.This change reuses the exact source-video old-to-new mapping while an NWB file is open and updates only matching, non-URL
original_videosentries. It identifies the container by itsneurodata_type, so ndx-pose is not a required runtime dependency. Newersource_videolinks and unrelated containers are left untouched.Tests cover path-separator normalization, byte/string values, remote URLs, and unrelated containers.
Validation: focused regression test and flake8 pass.