Skip to content

Add Metabolic Age and Physique Rating derived values#1417

Open
DanyPM wants to merge 2 commits into
oliexdev:masterfrom
DanyPM:feat/metabolic-age
Open

Add Metabolic Age and Physique Rating derived values#1417
DanyPM wants to merge 2 commits into
oliexdev:masterfrom
DanyPM:feat/metabolic-age

Conversation

@DanyPM

@DanyPM DanyPM commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Two science-based derived values that Endurain and Tanita-class scales expose, computed automatically whenever a measurement carries a body-composition signal. Both follow the existing derived-value pattern (recomputed on insert/update, backfilled once on upgrade) and are seeded together in a single migration (MIGRATION_15_16, DB v16) — one schema hop from master.

Metabolic Age

The age at which a population-average metabolism would match this person's. Derived by inverting the age term of the Mifflin-St Jeor BMR curve so it equals the individual's composition-based Katch-McArdle BMR (from fat-free mass). More lean mass → younger age. Both formulas are peer-reviewed and already used in openScale. Requires a body-fat/LBM signal (otherwise it would trivially return the chronological age).

image

Physique Rating

Tanita's 1–9 body-type index: body-fat level × muscle level, each banded against the app's existing age/sex reference ranges (body-fat + Janssen 2000 muscle), mapped onto Tanita's 3×3 matrix (hidden-obese … very-muscular).

Because the rating is ordinal (9 isn't "more" than 1 on a linear axis), it's excluded from line charts / insights / statistics and shown categorically instead:

  • Overview/detail rows show the body-type label; the overview row expands to a compact body-fat × muscle plane with the current point highlighted.
  • Insights adds a "Your Physique Type" plane below "Your Body Composition" — the nine zones with band-transition %s, a 90-day-sampled trajectory + trend arrow, selectable past points, and a per-type description. Same fat × muscle axes as the composition card.
image

Tests

Formula coverage for both (all nine physique zones, sex-specific bands, null-guards), Room round-trip insert/delete, and the migration producing both types.

@DanyPM DanyPM changed the title feat: add metabolic age derived value Add Metabolic Age and Physique Rating derived values Jul 16, 2026
@DanyPM

DanyPM commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

Updated with the addition of the "Physique Rating" value :

https://tanita.eu/understanding-your-measurements/physique-rating

@DanyPM
DanyPM force-pushed the feat/metabolic-age branch from 135aa9e to e9b05b2 Compare July 18, 2026 11:19
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