Skip to content

Commit

Permalink
Merge pull request #293 from ihmeuw/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
rmudambi authored Nov 18, 2022
2 parents 5088344 + 039c9cf commit 4a008d6
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# default owners
* @albrja @beatrixkh @collijk @hussain-jafari @mattkappel @rmudambi @stevebachmeier
* @albrja @beatrixkh @collijk @hussain-jafari @mattkappel @ramittal @rmudambi @stevebachmeier
3 changes: 2 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
<!-- For use in commit message, wrap at 72 chars. 72 chars is here: -->
- *Category*: <!-- one of bugfix, feature, refactor, POC, CI/infrastructure, documentation,
revert, test, release, other/misc -->
- *JIRA issue*: <!-- [MIC-XYZ](https://jira.ihme.washington.edu/browse/MIC-XYZ) -->
- *JIRA issue*: [MIC-XYZ](https://jira.ihme.washington.edu/browse/MIC-XYZ)

### Changes and notes
<!--
Change description – why, what, anything unexplained by the above.
Include guidance to reviewers if changes are complex.
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
**0.10.21 - 11/16/22**

- Fix bug in timing of disease transition observations
- Add logging when adding risks with a relative risk less than 1 from artifact

**0.10.20 - 07/25/22**

- Update Vivarium pin
Expand Down
2 changes: 1 addition & 1 deletion src/vivarium_public_health/__about__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
__summary__ = "Components for modelling diseases, risks, and interventions with ``vivarium``"
__uri__ = "https://github.com/ihmeuw/vivarium_public_health"

__version__ = "0.10.20"
__version__ = "0.10.21"

__author__ = "The vivarium_public_health developers"
__email__ = "[email protected]"
Expand Down
2 changes: 1 addition & 1 deletion src/vivarium_public_health/metrics/disease.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def _register_time_step_prepare_listener(self, builder: Builder) -> None:
builder.event.register_listener("time_step__prepare", self.on_time_step_prepare)

def _register_collect_metrics_listener(self, builder: Builder) -> None:
builder.event.register_listener("time_step", self.on_collect_metrics)
builder.event.register_listener("collect_metrics", self.on_collect_metrics)

def _register_metrics_modifier(self, builder: Builder) -> None:
builder.value.register_value_modifier(
Expand Down
8 changes: 8 additions & 0 deletions src/vivarium_public_health/risks/data_transformations.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
risk data and performing any necessary data transformations.
"""

from typing import Union

import numpy as np
import pandas as pd
from loguru import logger

from vivarium_public_health.utilities import EntityString, TargetString

Expand Down Expand Up @@ -181,6 +183,12 @@ def get_relative_risk_data(builder, risk: EntityString, target: TargetString):
"unordered_polytomous",
]:
relative_risk_data = pivot_categorical(relative_risk_data)
# Check if any values for relative risk are below expected boundary of 1.0
category_columns = [c for c in relative_risk_data.columns if "cat" in c]
if not relative_risk_data[(relative_risk_data[category_columns] < 1.0).any(axis=1)].empty:
logger.warning(
f"WARNING: Some data values are below the expected boundary of 1.0 for {risk}.relative_risk"
)

else:
relative_risk_data = relative_risk_data.drop(columns=["parameter"])
Expand Down

0 comments on commit 4a008d6

Please sign in to comment.