Skip to content

Commit 78b7307

Browse files
mmsuarezcostamnjowetbhallett
authored
Param Revamp - Contraception (#1693)
* add prior labels on addt docs * remove hardcoded values, add documentation of params * remove hardcoded values, add documentation of params * lint fix * update param definitions * update param labeling * update comments, review priors * update simulation params * update scenario params * bring sterilization_age_limit into tests * update priors on parameter which has multiplicativve effect and to ensure that chosen value is inside prior limit * use scenario label --------- Co-authored-by: Emmanuel Mnjowe <32415622+mnjowe@users.noreply.github.com> Co-authored-by: Tim Hallett <39991060+tbhallett@users.noreply.github.com>
1 parent de92e17 commit 78b7307

9 files changed

Lines changed: 123 additions & 65 deletions
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:f3b8d2085d10f1680cf7d521ba415777b194ef26a964c14bca473cbdd76c7982
3-
size 770
2+
oid sha256:3bb6850fe017a2d1a6fb3430eb8fd6c0591da0539dd1786a153f0889a731fef8
3+
size 1474
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:bb59b96ca917f218d48b349790092ea04d612c3545669c219ae25a65930a38d1
3-
size 810
2+
oid sha256:af364b872a188337427e286a8c3a2b3615f0290437e7693c0d09210d517245e8
3+
size 1485
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:f6848831b52ab636cf78cd6c3ddc999ad01a46d9d5471987d0e406c479f75ef0
3-
size 263
2+
oid sha256:338c8e5fa2cb4a73120a0f7f234453a524a6665dd76852c889ca529215242718
3+
size 1227
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:57d060bdd1a4ad87630853291de818144eeb15c5d2a5ba54a4d2507b31f879ff
3-
size 509
2+
oid sha256:07eb50237174b7ef3d522972f66a4cdbc905832afc206f67cdfb06a6cae3f79e
3+
size 1401
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:71c1d00707d77dcba8ec87532a9ac3f122cb4bbb2c6cd473d57c0157259b16e3
3-
size 95
2+
oid sha256:51abe8f3bdeea948ae1842c12463bd26434fb20ab31490d7967ddcde7d6ced62
3+
size 171
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:cfadf013d51552ec90b5d03881f09dd8fad1cae28a2dc9ba6116568fcc5fa564
3-
size 306
2+
oid sha256:3ee24fb3e65e2dfcfb5c75d23a73def66f9a0279e68598bd06988bf0d0c60cab
3+
size 420
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:14205ecc544760aebeff19cdcd23f9a8a3df653b293e1186f48fe17206556069
3-
size 620
2+
oid sha256:b57383afdf893256ad6465a077180890393124236cc7969fedc3199244780484
3+
size 2081

src/tlo/methods/contraception.py

Lines changed: 105 additions & 49 deletions
Large diffs are not rendered by default.

tests/test_contraception.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,13 +185,15 @@ def __check_no_illegal_switches(sim):
185185
HealthSystem/consumables are not available."""
186186
logs = parse_log_file(sim.log_filepath)
187187

188+
sterilization_age_limit = sim.modules['Contraception'].parameters['sterilization_age_limit']
189+
188190
# Check for no illegal changes
189191
if 'tlo.methods.contraception' in logs:
190192
if 'contraception_change' in logs['tlo.methods.contraception']:
191193
con = logs['tlo.methods.contraception']['contraception_change']
192194
assert not (con.switch_from == 'female_sterilization').any() # no switching from female_sterilization
193-
assert not (con.loc[con['age_years'] < 30, 'switch_to'] == 'female_sterilization').any() # no switching to
194-
# No female_sterilization if age less than 30
195+
assert not (con.loc[con['age_years'] < sterilization_age_limit, 'switch_to'] == 'female_sterilization').any() # no switching to
196+
# No female_sterilization if age less than sterilization_age_limit (usually 30 years)
195197

196198

197199
@pytest.mark.slow

0 commit comments

Comments
 (0)