Skip to content

incremental minutes: score strain from the series - #120

Merged
abdulsaheel merged 1 commit into
mainfrom
fix/incr-strain
Dec 5, 2026
Merged

abdulsaheel merged 1 commit into
mainfrom
fix/incr-strain

Conversation

@abdulsaheel

@abdulsaheel abdulsaheel commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

sync() scored strain with the lump form over hr.length, so off-skin minutes were charged baseline and quiet minutes could cancel exercise. now uses strainScoreFromSeries like the batch path. tests compare against it, plus one with 200 strap-off minutes.

Summary by CodeRabbit

  • Bug Fixes
    • Improved incremental strain calculations by aligning them with heart-rate series data and batch results, including periods with off-skin zero-HR readings.

@sourcery-ai

sourcery-ai Bot commented Dec 5, 2026

Copy link
Copy Markdown

Sorry @abdulsaheel, you've used your 10,000 reviewed lines for this month.

Reviews resume on 9 December 2026.

@coderabbitai

coderabbitai Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Incremental strain calculation now uses the heart-rate series, resting and maximum heart rates, quiet HRR, sex, and quiet-settled status. Test expectations use the same calculation, and a new test compares incremental and batch strain for a series with zero-HR minutes.

Changes: Strain calculation

Layer / File(s) Summary
Series-based strain calculation and parity tests
lib/src/onehz/incremental_minutes.dart, test/onehz/incremental/minute_summary_test.dart, test/onehz/support/incremental_compare.dart, test/properties/incremental_laws_test.dart
IncrementalMinuteMetrics.sync now derives strain with strainScoreFromSeries instead of using accumulated TRIMP. Test expectations use the series-based calculation. A new test checks incremental and batch strain parity for heart-rate data that includes zero-HR minutes.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

Suggested reviewers: mikenrafter

Merge Risk: Minimal · up to b67c3

Incremental strain scoring now matches the batch calculation and skips off-skin minutes. No merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: IncrementalMinuteMetrics.sync now scores strain from the heart-rate series via strainScoreFromSeries instead of the lump TRIMP-based strainScoreMetric over hr.length. …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: IncrementalMinuteMetrics.sync now scores strain from the heart-rate series via strainScoreFromSeries instead of the lump TRIMP-based strainScoreMetric over hr.length. The objectives confirm this matches the batch path and fixes off-skin minute handling. The title is specific and concise, and the summary covers the same change.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: af296966-7060-426f-ad42-fb632f6d3a64
Commits

Reviewing files that changed from the base of the PR and between d54980e and b67c3f4.

Files selected for processing: 4

  • lib/src/onehz/incremental_minutes.dart
  • test/onehz/incremental/minute_summary_test.dart
  • test/onehz/support/incremental_compare.dart
  • test/properties/incremental_laws_test.dart

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@abdulsaheel
abdulsaheel merged commit a8476ae into main Dec 5, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant