### Install pygrowup2 from source Source: https://github.com/jbaldivieso/pygrowup2/blob/master/README.md Install the pygrowup2 package directly from its GitHub repository. This is useful for development or when the latest changes are needed. ```bash pip install git+https://github.com/jbaldivieso/pygrowup2.git ``` -------------------------------- ### Install pygrowup2 using pip Source: https://github.com/jbaldivieso/pygrowup2/blob/master/README.md Install the pygrowup2 package using pip. This is the standard method for installing Python packages. ```bash pip install pygrowup2 ``` -------------------------------- ### Instantiate Observation objects Source: https://github.com/jbaldivieso/pygrowup2/blob/master/README.md Demonstrates three ways to create an Observation object for a 13-month-old boy. Observations can be created using age in days, age in months, or by providing date of birth and observation date. ```python from datetime import date, timedelta from decimal import Decimal from pygrowup import Observation # Three ways of instantiating roughly comparable Observations for a # 13-month-old boy. today = date.today() thirteen_months_ago = today - timedelta(days=365 + 30) obs = Observation(sex=Observation.MALE, age_in_days=13*30) obs = Observation(sex=Observation.MALE, age_in_months=13) obs = Observation(sex=Observation.MALE, dob=thirteen_months_ago, date_of_observation=today) ``` -------------------------------- ### Run pygrowup2 tests Source: https://github.com/jbaldivieso/pygrowup2/blob/master/README.md Execute the tests for the pygrowup2 package using the Python module runner. This command runs tests against WHO and SPOON datasets. ```bash python -m pygrowup.tests ``` -------------------------------- ### Calculate Weight for Length z-score Source: https://github.com/jbaldivieso/pygrowup2/blob/master/README.md Calculates the weight for length z-score. This method requires both weight and length measurements as arguments. ```python print(obs.weight_for_length(Decimal('9.6'), Decimal('77'))) ``` -------------------------------- ### Calculate Weight for Age z-score Source: https://github.com/jbaldivieso/pygrowup2/blob/master/README.md Calculates the weight for age z-score. The measurement can be provided as a Decimal, float, or int. ```python print(obs.weight_for_age(Decimal('9.6'))) ``` -------------------------------- ### Calculate Length or Height for Age z-score Source: https://github.com/jbaldivieso/pygrowup2/blob/master/README.md Calculates the length or height for age z-score. The measurement can be provided as a Decimal, float, or int. ```python print(obs.length_or_height_for_age(Decimal('77'))) ``` -------------------------------- ### Calculate Head Circumference for Age z-score Source: https://github.com/jbaldivieso/pygrowup2/blob/master/README.md Calculates the head circumference for age z-score using the Observation object. Measurements can be provided as Decimal, float, or int. ```python # Now calculate some z-scores for this child print(obs.head_circumference_for_age(Decimal('46.5'))) ``` -------------------------------- ### Calculate Head Circumference for Age z-score (alias) Source: https://github.com/jbaldivieso/pygrowup2/blob/master/README.md Calculates the head circumference for age z-score using the succinct alias 'hcfa'. This provides a shorter way to access the same functionality. ```python print(obs.hcfa(46.5)) # Same result as the previous computation. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.