Skip to content

Commit 0f5d63b

Browse files
committed
co: do not save init probs for years before current sim year
1 parent 5166fdb commit 0f5d63b

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
@@ -614,10 +614,10 @@ def update_params_for_interventions(self):
614614
def contraception_initiation_with_interv(p_start_per_month_without_interv):
615615
"""Increase the probabilities of a woman starting modern contraceptives due to Pop intervention being
616616
applied."""
617-
# TODO: remove the keys before intervention year
618617
p_start_per_month_with_interv = {}
619618
for year, age_method_df in p_start_per_month_without_interv.items():
620-
p_start_per_month_with_interv[year] = age_method_df * self.parameters['Interventions_Pop'].loc[0]
619+
if year >= self.sim.date.year:
620+
p_start_per_month_with_interv[year] = age_method_df * self.parameters['Interventions_Pop'].loc[0]
621621
return p_start_per_month_with_interv
622622

623623
def contraception_initiation_after_birth_with_interv(p_start_after_birth_without_interv):

0 commit comments

Comments
 (0)