Skip to content
This repository was archived by the owner on Jul 10, 2025. It is now read-only.

Commit 06765d9

Browse files
committed
update strings
1 parent d2a7c65 commit 06765d9

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

cli/__main__.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ def age_calculation(birth_date: datetime, observation_date: datetime, gestation_
2929
click.echo("Calculates decimal age, either chronological or corrected for gestation if the adjustment flag is true. Params: birth_date, observation_date, gestation_weeks, gestation_days")
3030
decimal_age=0
3131
calendar_age=""
32-
print(birth_date)
3332
if adjustment:
3433
decimal_age=date_calculations.corrected_decimal_age(
3534
birth_date=datetime.strptime(birth_date, "%Y-%m-%d").date(),
@@ -47,7 +46,7 @@ def age_calculation(birth_date: datetime, observation_date: datetime, gestation_
4746
calendar_age=date_calculations.chronological_calendar_age(
4847
birth_date=datetime.strptime(birth_date, "%Y-%m-%d").date(),
4948
observation_date=datetime.strptime(observation_date,"%Y-%m-%d").date())
50-
click.echo(f"{decimal_age} y,\n {calendar_age}")
49+
click.echo(f"{round(decimal_age,1)} y,\n {calendar_age}")
5150

5251
@click.command()
5352
@click.option('--reference', '-r', default="uk-who", show_default=True, type=click.Choice(["uk-who", "trisomy-21", "turners-syndrome"], case_sensitive=True))
@@ -67,7 +66,7 @@ def sds(reference: str, decimal_age: float, measurement_method: str, observation
6766
sex=sex
6867
)
6968
cent = centile(result)
70-
click.echo(f"SDS: {result}\nCentile: {cent}\n ")
69+
click.echo(f"SDS: {round(result,3)}\nCentile: {round(cent,1)} %\n")
7170

7271
@click.command()
7372
@click.option('--reference', '-r', default="uk-who", show_default=True, type=click.Choice(["uk-who", "trisomy-21", "turners-syndrome"], case_sensitive=True))
@@ -86,13 +85,13 @@ def measurement(reference: str, decimal_age: float, sex: str, measurement_method
8685
sex=sex,
8786
age=decimal_age
8887
)
89-
cent = centile(result)
88+
cent = centile(sds)
9089
suffix="cm"
9190
if measurement_method=="weight":
9291
suffix="kg"
9392
elif measurement_method=="bmi":
9493
suffix="kg/m2"
95-
click.echo(f"SDS {sds}\nCentile: {cent}\n{measurement_method}: {result} {suffix}")
94+
click.echo(f"SDS {sds}\nCentile: {round(cent,3)} %\n{measurement_method}: {result} {suffix}")
9695

9796
fig = pyfiglet.Figlet(font="standard")
9897
click.echo(fig.renderText("RCPCHGrowth"))

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
setup(
1111
name ='rcpchgrowth-python-cli',
12-
version ='1.0.5',
12+
version ='1.0.6',
1313
author ='Simon Chapman',
1414
author_email ='eatyourpeasapps@gmail.com',
1515
url ='https://github.com/rcpch/rcpchgrowth-python-cli',

0 commit comments

Comments
 (0)