From be1498d940cc419837350963cf5dfc9bf324dcdb Mon Sep 17 00:00:00 2001 From: eatyourpeas Date: Tue, 5 Aug 2025 22:12:54 +0100 Subject: [PATCH 1/2] fixes gestation correction to apply to fictional child --- rcpchgrowth/fictional_child.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/rcpchgrowth/fictional_child.py b/rcpchgrowth/fictional_child.py index b5e4b19..fe5a0b3 100644 --- a/rcpchgrowth/fictional_child.py +++ b/rcpchgrowth/fictional_child.py @@ -50,8 +50,14 @@ def generate_fictional_child_data( birth_date = date(1759, 4, 11) # YYYY m d observation_date = birth_date + timedelta(days=start_chronological_age*365.25) + # adjust the age for gestation + correction = 0.0 + if gestation_weeks < 40: + correction = (((gestation_weeks * 7 + gestation_days)-40*7) / 365.25) # adjust age for gestation + # set the counters - cycle_age = start_chronological_age + cycle_age = start_chronological_age + correction # adjust the age for gestation + end_age += correction # adjust the end age for gestation cycle_sds = start_sds interval_in_years = end_age-start_chronological_age @@ -76,7 +82,7 @@ def generate_fictional_child_data( drift_amount = drift_range / cycle_number measurements_array=[] - + while cycle_age < end_age: rawMeasurement = None From c9cbec31a8bbd698ef6cf7bd15cac939870e88ea Mon Sep 17 00:00:00 2001 From: eatyourpeas Date: Tue, 5 Aug 2025 22:14:16 +0100 Subject: [PATCH 2/2] =?UTF-8?q?Bump=20version:=204.3.7=20=E2=86=92=204.3.8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index d03a466..91ede6a 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 4.3.7 +current_version = 4.3.8 tag = False commit = True diff --git a/setup.py b/setup.py index 655fd7c..6ede8c1 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setup( name="rcpchgrowth", - version="4.3.7", + version="4.3.8", description="SDS and Centile calculations for UK Growth Data", long_description=long_description, url="https://github.com/rcpch/digital-growth-charts/blob/master/README.md",