read_columns builds the pyramid it needs, and tracks.json says where it lives - #381
Merged
Merged
Conversation
…it lives The extractors write the videogram base only, and `read_columns` memory-mapped `videogram_v.L<k>.u1` without looking, so the first read of any recording long enough to need a coarser level raised FileNotFoundError until someone knew to run `build_pyramid` by hand. The levels are cheap and derived, so the reader builds them on first use. Both extractors also put `analysis_dir` into the meta they return and write, so a caller can go from `extract_tracks_parallel(...)` to `read_columns` without reconstructing the `analysis/<stem>` convention. `extract_wav` is exported from the package root, where the audio helpers it belongs with already are. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PcjBSXbXjqdj1tmYHoLiKd
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.
Summary
_tracks.read_columnsraisedFileNotFoundErroron any recording long enough to need a pyramid level, because the extractors write only the base and nothing builtvideogram_v.L<k>.u1. It now callsbuild_pyramidon first use, and raises a clear message if the requested resolution is coarser than the pyramid goes.tracks.jsonand the dict returned byextract_tracks/extract_tracks_parallelcarryanalysis_dir.extract_wavexported from the package root.Found while building a concert-video segmenter on top of
extract_tracks_parallel: the 87-minute videogram could not be read without knowing aboutbuild_pyramid.Test plan
tests/test_pyramid_on_demand.py: a 12 s synthetic clip,read_columnson a fresh extraction uses a coarser level, writes it, records it intracks.json, and keeps extremes;analysis_dirpresent in meta and file;mg.extract_wavcallable.tests/test_tracks.py,tests/test_tracks_completeness.pypass (14 passed with the new file).🤖 Generated with Claude Code
https://claude.ai/code/session_01PcjBSXbXjqdj1tmYHoLiKd