Skip to content

refactor(summarize_cadence): use new "true cadence" calculation for the cadence metrics - #142

Open
chanshing wants to merge 1 commit into
mainfrom
true-cadence-calculation
Open

chanshing wants to merge 1 commit into
mainfrom
true-cadence-calculation

Conversation

@chanshing

@chanshing chanshing commented Nov 13, 2024 •

Copy link
Copy Markdown
Member

Use a new "true cadence" calculation method for the cadence metrics (Peak1, Peak30, 95th)

Summary of Changes

tiny-sample.cwa.gz:

Key Old Value New Value
CadencePeak1(steps/min) 100 116
Cadence95th(steps/min) 95 114
CadencePeak1(steps/min)_Weekday 100 116
Cadence95th(steps/min)_Weekday 95 114
CadencePeak1Adjusted(steps/min) 100 116
Cadence95thAdjusted(steps/min) 95 114
CadencePeak1Adjusted(steps/min)_Weekday 100 116
Cadence95thAdjusted(steps/min)_Weekday 95 114

@chanshing
chanshing force-pushed the true-cadence-calculation branch from e5c8210 to b4eef35 Compare November 13, 2024 17:44
@chanshing
chanshing force-pushed the true-cadence-calculation branch 4 times, most recently from 9a6fc95 to 06017b1 Compare October 9, 2026 08:24
Derive cadence metrics from step timestamps so peak and percentile summaries reflect instantaneous walking cadence. Expose validated cadence bounds through the CLI and apply them consistently to adjusted and unadjusted outputs.

src/stepcount/stepcount.py
- Calculate rolling minutely cadence from inter-step intervals.
- Filter cadence observations with configurable bounds and handle empty inputs.
- Pass validated CLI cadence settings into summary generation.

tests/conftest.py
- Add reusable step-timestamp test data.

tests/test_numerical_regression.py
- Update cadence regressions for timestamp-based calculations.

tests/test_stepcount.py
- Cover cadence thresholds, cohort summaries, CLI validation, and end-to-end option propagation.
@chanshing
chanshing force-pushed the true-cadence-calculation branch from 06017b1 to 3c505e3 Compare November 6, 2026 18:56
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