Skip to content

read_columns builds the pyramid it needs, and tracks.json says where it lives - #381

Merged
alexarje merged 1 commit into
masterfrom
tracks-pyramid-on-demand
Sep 12, 2026
Merged

alexarje merged 1 commit into
masterfrom
tracks-pyramid-on-demand

Conversation

@alexarje

Copy link
Copy Markdown
Contributor

Summary

  • Fix: _tracks.read_columns raised FileNotFoundError on any recording long enough to need a pyramid level, because the extractors write only the base and nothing built videogram_v.L<k>.u1. It now calls build_pyramid on first use, and raises a clear message if the requested resolution is coarser than the pyramid goes.
  • tracks.json and the dict returned by extract_tracks / extract_tracks_parallel carry analysis_dir.
  • extract_wav exported from the package root.
  • CHANGELOG under Unreleased.

Found while building a concert-video segmenter on top of extract_tracks_parallel: the 87-minute videogram could not be read without knowing about build_pyramid.

Test plan

  • New tests/test_pyramid_on_demand.py: a 12 s synthetic clip, read_columns on a fresh extraction uses a coarser level, writes it, records it in tracks.json, and keeps extremes; analysis_dir present in meta and file; mg.extract_wav callable.
  • tests/test_tracks.py, tests/test_tracks_completeness.py pass (14 passed with the new file).

🤖 Generated with Claude Code

https://claude.ai/code/session_01PcjBSXbXjqdj1tmYHoLiKd

…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
@alexarje
alexarje merged commit 293cace into master Sep 12, 2026
11 of 12 checks passed
@alexarje
alexarje deleted the tracks-pyramid-on-demand branch September 12, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant