Skip to content

Commit

Permalink
properly create the population_view in RateTransition (#482)
Browse files Browse the repository at this point in the history
  • Loading branch information
rmudambi authored Sep 10, 2024
1 parent 70d8dd8 commit e6a49e1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
**3.0.7 - 09/10/24**

- Properly create the population_view in RateTransition

**3.0.6 - 09/04/24**

- Fix bug that was occurring when RiskEffect's rr_source was a float or DataFrame
Expand Down
8 changes: 5 additions & 3 deletions src/vivarium_public_health/disease/transition.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"""

from typing import TYPE_CHECKING, Any, Callable, Dict, Union
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Union

import pandas as pd
from vivarium.framework.engine import Builder
Expand Down Expand Up @@ -48,6 +48,10 @@ def configuration_defaults(self) -> Dict[str, Any]:
},
}

@property
def columns_required(self) -> Optional[List[str]]:
return ["alive"]

@property
def transition_rate_pipeline_name(self) -> str:
if "incidence_rate" in self._get_data_functions:
Expand Down Expand Up @@ -100,8 +104,6 @@ def setup(self, builder: Builder) -> None:
preferred_post_processor=union_post_processor,
)

self.population_view = builder.population.get_view(["alive"])

#################
# Setup methods #
#################
Expand Down

0 comments on commit e6a49e1

Please sign in to comment.