Provenance

flowtracks.provenance records what was run, with which parameters, and what it produced — one JSON-serializable record per run, appended to the meta.attrs["runs"] of a run’s run.zarr (the same meta group that openptv2’s run store writes). This exists because a run.zarr can otherwise go stale silently: a 5-frame smoke-test run and a full run look identical from the array shapes alone.

Run provenance: what was run, with which parameters, and what it produced.

Appends a small JSON-serializable record to run.zarr/meta.attrs[“runs”] – the same meta group openptv2’s RunStore already writes (schema_version, sealed, source_hash). One place per store, no separate file to lose track of.

This exists because a run.zarr can otherwise go stale silently: a 5-frame smoke-test run and a full run look identical from the array shapes alone, and nothing on disk says which parameters, frame range, or pipeline stage produced what’s there. Seen in practice: one run’s run.zarr held a 5-frame test-tracking run with no record of that fact anywhere, and it looked identical to a real run until someone opened it.

flowtracks.provenance.record_run(zarr_path, stage: str, **info) → dict[source]

Append one provenance record for stage (e.g. “tracking”, “lagrangian”, “eulerian”) to run.zarr/meta.attrs[“runs”]. info is any JSON-serializable metadata worth keeping – params_file, first/last frame, frame_rate, min_length, stitching config, grid config, counts produced, etc.

Returns the record that was written.

flowtracks.provenance.read_runs(zarr_path) → list[dict][source]

Return every provenance record stored at run.zarr/meta.attrs[“runs”], oldest first. Empty list if the store has none (or predates this).