Add actual-dive replay mode using recorded samples (PRO-61) - #162
Merged
Merged
Conversation
Feed actual recorded dive samples through the deco engine instead of synthetic square profiles. The replay sheet now has two modes: - "Actual Dive" (default): runs compute_deco_simulation with plan_ascent on the real recorded samples truncated at bottom-end. Uses the dive's actual ascent rate, recorded PPO2 values, and gas switches. CCR setpoint and diluent remain editable for "what if SP 1.3?" analysis — override only applies when user changes the value. - "What-If Planning": existing synthetic profile generator unchanged. Also extracts DiveSample.toSampleInputs() and GasMix.toGasMixInputs() as shared extensions in DivelogCore, deduplicating code from FormulaService and DepthProfileChart. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
The 95% max-depth heuristic fails for multi-level dives. Use the properly computed bottomEndT from DiveStats when available, which handles multi-level profiles, depth oscillations, and ascent detection correctly. Falls back to the heuristic only when stats are unavailable. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Use recorded gas table for CCR actual-dive mode by default; only override when user changes diluent from prefilled values (fixes multi-diluent/bailout CCR dives analyzing wrong gas mix) - Validate setpoint override: show error for non-numeric values instead of silently falling back to recorded PPO2 - Relabel "Total Time" to "Recorded Time" in actual-dive mode to clarify it's not a simulation output - Rename "Deco Stops" to "Deco Stop Time" to match the displayed value Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
9 tests covering: - Empty array handling - Field mapping (DiveSample → SampleInput, GasMix → GasMixInput) - PPO2 fallback: ppo2_1 preferred, setpointPpo2 as fallback, nil for OC - Type conversions (Int → Int32, Float → Double) - Multiple samples/mixes - Nil gasmixIndex passthrough Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
planAscent: true, computing the deco schedule the algorithm would prescribe for the actual dive profile[DiveSample].toSampleInputs()and[GasMix].toGasMixInputs()extracted to DivelogCore, deduplicating FormulaService and DepthProfileChartValidated on device
Test plan
make lint— cleanmake test— all passmake security— cleanmake version-check— consistent/review-pr— pending🤖 Generated with Claude Code