Skip to content

Add Metabolic Age and Physique Rating derived values#1417

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

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
@DanyPM

DanyPM commented Jul 19, 2026

Copy link
Copy Markdown
Contributor Author

@oliexdev would you have some time to a have a look at this work ?

Both new metrics are compatible with endurain :-)

@oliexdev

Copy link
Copy Markdown
Owner

Hi @DanyPM, thanks a lot for the effort you put into this PR — the implementation follows the project architecture nicely and the test coverage is good. However, after reviewing it I've decided not to merge it, for two conceptual reasons:

Metabolic Age: The formula equates two different BMR estimations (Mifflin-St Jeor and Katch-McArdle) that are based on different reference populations, so the resulting "age" is essentially an artifact of the formula mismatch rather than a validated physiological quantity. Mathematically it boils down to a linear rescaling of lean body mass for a given weight and height — so it adds no new information beyond the BMR/LBM values openScale already shows, just dressed up in "years". I don't want to persist such a pseudo-metric in the user's data.

Physique Rating: The 1–9 rating is exactly the cross product of the body-fat and muscle evaluation bands that openScale already displays in the evaluation gauges, so information-wise nothing new is added. The new insights card is also visually very close to the existing body-composition plane card, which would leave two near-identical fat × muscle planes on the same screen. If anything, I'd rather see the named zones integrated into the existing body-composition card as a display-only enhancement — computed on the fly, without a new persisted measurement type.

I appreciate the contribution and hope this doesn't discourage you.

@oliexdev oliexdev closed this Jul 22, 2026
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.

2 participants