Skip to content

Commit

Permalink
ENH: use pop_data.user_data.get pattern in examples.disease_model.Bas…
Browse files Browse the repository at this point in the history
…ePopulation

This makes it easier to demonstrate a minimal fertility model
  • Loading branch information
aflaxman authored and rmudambi committed Jan 5, 2023
1 parent 82f5027 commit 3cb1c9e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/vivarium/examples/disease_model/population.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ def on_initialize_simulants(self, pop_data: SimulantData):
"""

age_start = self.config.population.age_start
age_end = self.config.population.age_end
age_start = pop_data.user_data.get("age_start", self.config.population.age_start)
age_end = pop_data.user_data.get("age_end", self.config.population.age_end)

if age_start == age_end:
age_window = pop_data.creation_window / pd.Timedelta(days=365)
else:
Expand Down

0 comments on commit 3cb1c9e

Please sign in to comment.