Published August 27, 2026 | Version v4.6.0

rcpchgrowth

Description

v4.6.0

Added

  • Calculation-reference provenance on every Measurement result. Each successful calculation now includes a top-level provenance object identifying which growth reference was used and which version/commit of rcpchgrowth produced it:

    "provenance": {
      "growth_reference": "uk-who",
      "calculation_engine": {
        "name": "rcpchgrowth",
        "version": "4.6.0",
        "commit": "<40-char SHA, stamped at release build time>"
      }
    }
    

This is step 1 of a mitigation chain for a hazard where chart curves and a measurement's tooltip were found to be capable of using different growth references with no way to detect the mismatch downstream. commit reports "unknown" for editable/development installs (there is no dist-info to read a real value from) and is stamped with the real release SHA by the publish workflow for PyPI wheels/sdists. Closes #37.

Fixed

  • chronological_percentage_median_bmi was computed from the corrected age, not the chronological age, for every BMI measurement. It returned the same value as corrected_percentage_median_bmi regardless of gestation, mislabelling a corrected-age figure as chronological. Invisible for term births, or under CDC/WHO's correction-reset rules; affects any UK-WHO, Trisomy 21, or Turner assessment where gestation was not exactly 40+0 weeks, at any age. Hazard raised and tracked at digital-growth-charts-documentation#178.
  • uk_who_reference() and cdc_reference() (and their ..._lms_array_for_measurement_and_sex() counterparts) returned exception objects instead of raising them on out-of-domain ages. Callers received an exception instance where they expected reference data, and the resulting failure surfaced later as a confusing, unrelated TypeError, far from its actual cause.
  • return_correlation() returned an Exception object instead of raising ValueError for out-of-range ages, causing a similarly confusing downstream TypeError in create_thrive_line() rather than a clear error about the requested age.
  • Operator precedence bug in the CDC/WHO gestational-correction guard. reference == CDC or reference == WHO and corrected_age is not None parsed as CDC or (WHO and ...), so a CDC-reference calculation could enter the correction block without the None guard applied to the WHO branch, risking an unhandled crash rather than a graceful degradation for certain invalid inputs.
  • WHO_2006_OVER_TWOS_AGES contained a duplicate, out-of-order age (3.083333333 appearing a second time immediately after 4.0), corrected to 4.083333333 to restore an ascending sequence. Affected WHO chart age grids at that point in the range. Testing
  • 27 new regression tests added for the fixes above.
  • Full suite: 145,069 passed, 1,700 skipped, 0 failed.
  • Verified against digital-growth-charts-server's API test suite (158 passed, unchanged) and a purpose-built 878-case input sweep across all reference families, endpoints, and clinically significant age boundaries: exactly one field changed anywhere in the API surface as a result of all of the above (chronological_percentage_median_bmi), and nothing else moved.

Notes

If you use this software, please cite it as below.

Files

rcpch/rcpchgrowth-python-v4.6.0.zip

Files (5.0 MB)

Name Size Download all
md5:12c01306f911c3dfb916edc633e8dc20
5.0 MB Preview Download

Additional details

Related works