checks: add required_topics, the missing-topic QC built-in - #59
Closed
chintondutta wants to merge 1 commit into
Closed
checks: add required_topics, the missing-topic QC built-in#59chintondutta wants to merge 1 commit into
chintondutta wants to merge 1 commit into
Conversation
Nothing in checks.py answered the cheapest corpus-level QC question: did
this rig record every topic it was supposed to? Follows episode_duration's
evidence-only shape: per topic, {topic}/present and {topic}/message_count,
plus a missing_topic_count summary; the pass/fail cut is a curation query.
Presence is derived from Episode.channels (summed across every channel
matching the topic) rather than Episode.channel(), which raises when a
topic maps to more than one channel.
|
👋 Hi @chintondutta — thanks for the contribution! To keep starter issues available You already have #52 open, so this one is being closed automatically. |
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.
Fixes #6.
What was missing
src/hflow/checks.pyships built-in checks for timestamps, joints, cameras, idle segments, duration, and digest -- but nothing answered the cheapest and most common corpus-level QC question: did this rig record every topic it was supposed to?Change
Added
required_topics(episode, *, topics), followingepisode_duration's evidence-only shape (docstring pointing at the curation query where the pass/fail policy lives, no verdict). For each requested topic, records:f"{topic}/present"-- booleanf"{topic}/message_count"-- intplus a
missing_topic_countsummary.Presence is derived from
Episode.channels(dict[int, TopicInfo]), summed across every channel whosetopicmatches -- neverEpisode.channel(), which explicitly raisesValueErrorwhen a topic maps to more than one channel (episode.py's_resolve_channel_info). A topic counts present when the summed message count is > 0 (an empty channel is schema without a recording, matchingepisode_duration's ownmessage_count >= 1presence convention).No
__all__to update --checks.pyhas none; the module is imported and used ashflow.checks.<name>, same as every sibling.Testing
Two new tests in
tests/test_checks.py, using the existing module-scopedjittery_episodesynthetic fixture:test_required_topics_all_present:/joint_statesand/wrist_cam/compressedboth present with positive message counts,missing_topic_count == 0.test_required_topics_reports_a_missing_topic: a topic name not in the file reportspresent=False,message_count=0, andmissing_topic_count == 1, alongside a genuinely present topic.uv run pytest -q # 299 passed, 3 skipped; unrelated: tests/test_ffmpeg.py fails/errors in this sandbox (no ffmpeg/ffprobe on PATH) uv run ruff check --fix uv run ruff format uv run ty check