fix(pipeline): key per-series results uniquely — duplicate descriptions no longer drop series#153
Conversation
…ns no longer drop series Volumes, detected planes, and everything keyed off context.volumes downstream (anomaly scores, top slices, vision analysis, report sections) used series.description as dict key. SeriesDescription is an optional DICOM tag that is frequently empty or repeated, so colliding series silently overwrote each other and studies lost entire series with no warning. Keys are now generated once per study: unique descriptions stay verbatim (labels unchanged for the common case), empty ones fall back to the series number, duplicates get a numeric suffix. Fixes #135 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W4svt5QTs4WUMSy4HwiVt9
|
Warning Review limit reached
Next review available in: 32 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Summary
context.volumesandcontext.detected_planes— and everything keyed offcontext.volumesdownstream (anomaly scores, top slices, vision analysis, report sections) — usedseries.descriptionas the dict key.SeriesDescription(0008,103E) is an optional DICOM tag that is frequently empty or repeated in real MRI studies (repeated localizers, re-run sequences), so colliding series silently overwrote each other: studies lost entire series with no warning and produced incomplete analyses.Fixes #135
Changes
src/medcheck/pipeline/preprocess.py: new_series_keys()generates one unique, human-readable key per series for the whole study:series-<number>(positional index if the number is unset)pd_sag,pd_sag (2), …volumesanddetected_planesare written with the same key list (zip(..., strict=True))tests/unit/test_pipeline/test_preprocess.py: 2 regression tests — two series with identical descriptions both survive; two series with empty descriptions both surviveTesting
uv run pytest) — 180 passed, all existing key expectations (pd_sag,test, …) unchangeduv run pytest --cov-fail-under=85) — 87.64%uv run ruff check .)uv run mypy src/medcheck --strict)Additional Notes
Key generation lives in exactly one place (preprocess);
ml_analysisandvision_analysisalready iteratecontext.volumes.items(), so they pick up the unique keys without changes.detect_plane()still receives the real description, only the dict key is disambiguated.🤖 Generated with Claude Code
https://claude.ai/code/session_01W4svt5QTs4WUMSy4HwiVt9
Generated by Claude Code