Add Metabolic Age and Physique Rating derived values#1417
Open
DanyPM wants to merge 2 commits into
Open
Conversation
Contributor
Author
|
Updated with the addition of the "Physique Rating" value : https://tanita.eu/understanding-your-measurements/physique-rating |
DanyPM
force-pushed
the
feat/metabolic-age
branch
from
July 18, 2026 11:19
135aa9e to
e9b05b2
Compare
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.
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 frommaster.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).
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:
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.