Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 4.3.0
current_version = 4.3.1
tag = False
commit = True

Expand Down
4 changes: 4 additions & 0 deletions rcpchgrowth/chart_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,10 @@ def create_uk_who_chart(
sex=sex)
except:
lms_array_for_measurement = []

# truncate the who_child data to stop at 4y
if len(lms_array_for_measurement) > 0:
lms_array_for_measurement = [obj for obj in lms_array_for_measurement if obj["decimal_age"] <= 4.0]

for centile_index, centile_sds in enumerate(centile_sds_collection):
# we must create a z for each requested centile
Expand Down
10 changes: 7 additions & 3 deletions rcpchgrowth/mid_parental_height.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .constants import HEIGHT, MALE, FEMALE, UK_WHO
from .constants import HEIGHT, MALE, FEMALE, UK_WHO, WHO
from .global_functions import sds_for_measurement
"""
Functions to calculate mid-parental height
Expand All @@ -23,8 +23,12 @@ def mid_parental_height_z(maternal_height, paternal_height, reference=UK_WHO):
"""

# convert parental heights to z-scores
maternal_height_z = sds_for_measurement(reference=reference, age=20.0, measurement_method=HEIGHT, observation_value=maternal_height, sex=FEMALE)
paternal_height_z = sds_for_measurement(reference=reference, age=20.0, measurement_method=HEIGHT, observation_value=paternal_height, sex=MALE)
adult_age = 20.0
if reference == WHO:
adult_age = 19.0

maternal_height_z = sds_for_measurement(reference=reference, age=adult_age, measurement_method=HEIGHT, observation_value=maternal_height, sex=FEMALE)
paternal_height_z = sds_for_measurement(reference=reference, age=adult_age, measurement_method=HEIGHT, observation_value=paternal_height, sex=MALE)

# take the means of the z-scores and apply the regression coefficient of 0.5 - simplifed: (MatHtz +PatHtz)/4
mid_parental_height_z_score = (maternal_height_z + paternal_height_z) / 4.0
Expand Down
2 changes: 1 addition & 1 deletion rcpchgrowth/who.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def select_reference_data_for_who_chart(
elif who_reference_name == WHO_2006_CHILD:
try:
who_2006_children_reference = who_lms_array_for_measurement_and_sex(
age=1.0,
age=3.0,
measurement_method=measurement_method,
sex=sex,
default_youngest_reference=default_youngest_reference # should never need younger reference in this calculation
Expand Down
Loading