Skip to content

Commit

Permalink
fix midparental height
Browse files Browse the repository at this point in the history
  • Loading branch information
eatyourpeas committed Aug 29, 2021
1 parent 05da42f commit 1fc8e34
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
6 changes: 4 additions & 2 deletions rcpchgrowth_python_cli/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ def age_calculation (birth_date, observation_date, gestation_weeks, gestation_da
birth_date=birth_date,
observation_date=observation_date)
click.echo(f"Unadjusted: {decimal_age} y,\n{calendar_age}")


@click.command()
@click.argument('decimal_age', type=click.FLOAT)
Expand Down Expand Up @@ -154,7 +153,7 @@ def measurement_for_sds(reference, decimal_age, sex, measurement_method, sds):
@click.argument("maternal_height", type=click.FLOAT)
@click.argument("paternal_height", type=click.FLOAT)
@click.argument('sex', default="male", type=click.Choice(['male', 'female'], case_sensitive=True))
def midparental_height(maternal_height: float, paternal_height: float, sex: str)->str:
def midparental_height(maternal_height: float, paternal_height: float, sex: str):
"""
Returns a midparental height
Parameters include paternal_height in cm, maternal_height in cm and sex as one of 'male' or 'female' (default 'male').
Expand All @@ -170,12 +169,15 @@ def midparental_height(maternal_height: float, paternal_height: float, sex: str)
return f"Error: {e}"
click.echo(f"Midparental height: {round(result, 2)} cm")


fig = pyfiglet.Figlet(font="standard")
click.echo(fig.renderText("RCPCHGrowth"))
methods.add_command(age_calculation)
methods.add_command(sds_for_measurement)
methods.add_command(measurement_for_centile)
methods.add_command(measurement_for_sds)
methods.add_command(midparental_height)


if __name__ == '__main__':
methods()
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
attrs==20.3.0
click==8.0.1
iniconfig==1.1.1
marshmallow==3.11.1
numpy==1.20.2
packaging==20.9
pluggy==0.13.1
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name ='rcpchgrowth-python-cli',
version='1.1.1',
version='1.1.2',
author ='Simon Chapman',
author_email ='[email protected]',
url ='https://github.com/rcpch/rcpchgrowth-python-cli',
Expand All @@ -19,7 +19,7 @@
packages=find_packages(),
entry_points ={
'console_scripts': [
'rcpchgrowth = rcpchgrowth_python_cli.__main__:methods'
'rcpchgrowth=rcpchgrowth_python_cli.__main__:methods'
]
},
classifiers =(
Expand Down

0 comments on commit 1fc8e34

Please sign in to comment.