badc.chunkingΒΆ

Chunk planning helpers plus probe/aggregation logic.

See notes/chunking.md for the longer-term Plan A (HawkEars-driven probes, chunk overlap heuristics, manifest hashing, etc.). The functions below stay lightweight so CLI/tests can exercise the workflow while the more advanced algorithms are being built.

Functions

aggregate_detections(detections)

Aggregate placeholder detections by chunk prefix.

iter_chunk_placeholders(audio_path, ...)

Yield placeholder chunk identifiers for documentation/testing.

plan_chunk_ranges(duration_s, chunk_duration_s)

Return evenly spaced ranges that cover duration_s seconds.

probe_chunk_duration(audio_path[, ...])

Estimate a feasible chunk duration for audio_path based on GPU VRAM heuristics.

run_inference_on_chunks(chunk_ids)

Return mocked detection IDs for each chunk_id.

write_manifest(audio_path, chunk_duration_s, ...)

Write a chunk manifest CSV (placeholder hashing).

Classes

ChunkProbeAttempt(duration_s, ...)

Single attempt recorded while searching for a safe chunk duration.

ChunkProbeResult(file, max_duration_s[, ...])

Represents the outcome of a chunk-size probe run.