Skip to content

Commit

Permalink
Merge pull request #1 from rcpch/feature
Browse files Browse the repository at this point in the history
Feature
  • Loading branch information
eatyourpeas authored Apr 27, 2021
2 parents 92fd7a8 + 7398257 commit 3a97b79
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 116,444 deletions.
72,002 changes: 0 additions & 72,002 deletions rcpchgrowth/tests/lms_test.json

This file was deleted.

14 changes: 7 additions & 7 deletions rcpchgrowth/tests/sds_age_validation_2021.json
Original file line number Diff line number Diff line change
Expand Up @@ -10150,7 +10150,7 @@
"corrected_age": 0.065708419,
"observation_value": 3.62,
"corrected_sds": -0.618963838,
"chronological_sds": 0.549580634
"chronological_sds": 0.19919977
},
{
"birth_date": "12/04/2012",
Expand All @@ -10163,7 +10163,7 @@
"corrected_age": 0.065708419,
"observation_value": 51.1,
"corrected_sds": -0.912819505,
"chronological_sds": 0.551377654
"chronological_sds": 0.305680569
},
{
"birth_date": "12/04/2012",
Expand All @@ -10189,7 +10189,7 @@
"corrected_age": 0.065708419,
"observation_value": 34.6,
"corrected_sds": -1.272698402,
"chronological_sds": 0.528353751
"chronological_sds":0.182001024
},
{
"birth_date": "28/03/2014",
Expand Down Expand Up @@ -30378,7 +30378,7 @@
"corrected_age": -0.032854209,
"observation_value": 3.71,
"corrected_sds": 1.02978301,
"chronological_sds": 0.420462579
"chronological_sds": 0.285107481
},
{
"birth_date": "29/05/2012",
Expand All @@ -30391,7 +30391,7 @@
"corrected_age": -0.032854209,
"observation_value": 52,
"corrected_sds": 1.122352958,
"chronological_sds": 0.4347637
"chronological_sds": 0.44551425
},
{
"birth_date": "29/05/2012",
Expand All @@ -30417,7 +30417,7 @@
"corrected_age": -0.032854209,
"observation_value": 35.6,
"corrected_sds": 1.243301868,
"chronological_sds": 0.448764771
"chronological_sds": 0.537227055
},
{
"birth_date": "13/01/2015",
Expand Down Expand Up @@ -33588,7 +33588,7 @@
"chronological_age": 17.01300479,
"corrected_age": 16.99931554,
"observation_value": 60.0001,
"corrected_sds": null,
"corrected_sds": 3.2265366684075634,
"chronological_sds": null
},
{
Expand Down
3 changes: 1 addition & 2 deletions rcpchgrowth/tests/test_global_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,11 @@ def load_valid_data_set():
"""
Loads in the testing data from JSON file
"""
# with open(os.path.abspath(os.path.dirname(__file__)) + "/validation_sds-2021.json") as f:
with open(os.path.abspath(os.path.dirname(__file__)) + "/sds_age_validation_2021.json") as f:
return json.load(f)


# date_calculations
# # date_calculations
@pytest.mark.parametrize("line", load_valid_data_set())
def test_chronological_decimal_age(line):
"""
Expand Down
1 change: 0 additions & 1 deletion rcpchgrowth/tests/test_measurement_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def load_valid_data_set():
"""
Loads in the testing data from JSON file
"""
# with open(os.path.abspath(os.path.dirname(__file__)) + "/validation_sds-2021.json") as f:
with open(os.path.abspath(os.path.dirname(__file__)) + "/sds_age_validation_2021.json") as f:
return json.load(f)

Expand Down
17 changes: 1 addition & 16 deletions rcpchgrowth/tests/test_measurement_class_validations.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,22 +190,7 @@ def test_measurement_class_with_invalid_observation_value_height_low():

assert m["child_observation_value"]["observation_value_error"] == "Height/length must be passed in cm, not metres"

# def test_measurement_class_with_invalid_observation_value_gestation_weeks_low():
# """
# Should raise an (gestation_weeks range error)
# """
# m = Measurement(
# sex="male",
# birth_date=datetime.strptime("2020-06-01", "%Y-%m-%d"),
# observation_date=datetime.strptime("2020-07-01", "%Y-%m-%d"),
# measurement_method="height",
# observation_value=53,
# gestation_weeks=21,
# gestation_days=2,
# reference="uk-who"
# ).measurement

# assert m["child_observation_value"]["observation_value_error"] == "Height/length must be passed in cm, not metres" - returns {"gestation_weeks": ["Must be greater than or equal to 22 and less than or equal to 44."]} on the API?


def test_measurement_class_with_invalid_gestation_weeks_type():
"""
Expand Down
397 changes: 0 additions & 397 deletions rcpchgrowth/tests/test_measurement_class_values.json

This file was deleted.

Loading

0 comments on commit 3a97b79

Please sign in to comment.