Skip to content

Commit 8b735a2

Browse files
committed
co: do not save init probs for years before current sim year
1 parent 15df23f commit 8b735a2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/tlo/methods/contraception.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -599,10 +599,10 @@ def update_params_for_interventions(self):
599599
def contraception_initiation_with_interv(p_start_per_month_without_interv):
600600
"""Increase the probabilities of a woman starting modern contraceptives due to Pop intervention being
601601
applied."""
602-
# TODO: remove the keys before intervention year
603602
p_start_per_month_with_interv = {}
604603
for year, age_method_df in p_start_per_month_without_interv.items():
605-
p_start_per_month_with_interv[year] = age_method_df * self.parameters['Interventions_Pop'].loc[0]
604+
if year >= self.sim.date.year:
605+
p_start_per_month_with_interv[year] = age_method_df * self.parameters['Interventions_Pop'].loc[0]
606606
return p_start_per_month_with_interv
607607

608608
def contraception_initiation_after_birth_with_interv(p_start_after_birth_without_interv):

0 commit comments

Comments
 (0)