fix: run rotation/TDS detection independent of display moment availability - #617
Conversation
…ility Previously, if the requested display product (e.g. zdr/kdp/phidp) was unavailable on a scan, build_moment_cache's None short-circuited the entire volume iteration via continue, silently skipping rotation and TDS detection for that scan too — even though detect_rotation_sites runs off velocity/dual-pol moments unrelated to the display product. Detection now runs unconditionally per volume before the display cache is built; only frame rendering (which does need the display moment) is skipped on cache miss.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughRotation and TDS detection now run before per-volume rendering, allowing data to persist when rendering is skipped. Rotation markers reuse precomputed sites, and rotation sidecar generation occurs before the no-frame exit. ChangesRotation detection flow
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant VolumeLoop
participant RotationDetector
participant TDSGrid
participant Renderer
participant RotationSidecar
VolumeLoop->>RotationDetector: Detect rotation sites
RotationDetector->>TDSGrid: Sample strongest-site confidence
TDSGrid-->>VolumeLoop: Return TDS confidence
VolumeLoop->>VolumeLoop: Record detections and latest rotation
VolumeLoop->>Renderer: Render using precomputed rotation sites
VolumeLoop->>RotationSidecar: Write recorded detection data
RotationSidecar-->>VolumeLoop: Complete before no-frame exit
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/radar_gif/src/main.rs`:
- Around line 221-224: Move the rotation sidecar serialization in the main
processing flow to occur before the empty-frame early exit, including the path
reached when build_moment_cache returns None for every volume. Preserve the
existing rotation detection results and ensure rotation.json is written even
when no renderable frames are produced.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: e18e7fed-468c-4406-a8c4-e8c5f1653fdd
📒 Files selected for processing (1)
crates/radar_gif/src/main.rs
Moves rotation serialization ahead of the no-frames-rendered exit so detection results are preserved even when no displayable moment exists.
…tection-on-missing-moment
Summary
crates/radar_gif/src/main.rs, whenbuild_moment_cachereturnedNonefor a scan (the requested display product, e.g.zdr/kdp/phidp, was unavailable), thecontinueshort-circuited rotation/TVS and TDS detection for that scan too — even thoughdetect_rotation_sitesruns off velocity/dual-pol moments that are unrelated to the display product.detect_rotation_sites, TDS colocation sampling, and theall_detections/latest_rotation/tds_timelineaccumulators) now runs unconditionally per volume, before the display cache is attempted. Only the frame image render — which does need the display moment — is skipped on a cache miss.Test plan
cargo build --release -p radar_gifcargo fmt --all -- --checkcargo clippy -p radar_gif --all-targets --all-features -- -D warningscargo test -p radar_gif --no-default-featuresSummary by CodeRabbit
New Features
Bug Fixes