Skip to content

Commit ca5997e

Browse files
SylLutzeSylvia LutzeSylvia Lutze
authored
Artifact Run Updates (#127)
* Attempt 1 at getting the artifact to run * Updating years throughout, changing to GBD 2023 * forgot isort and black * V&V'ed the artifact, updated one year call * Changing hemoglobin to 2021 values following conversation with Ali * Forgot isort and black again --------- Co-authored-by: Sylvia Lutze <lutzes@long-slurm-sarchive-p0039.cluster.ihme.washington.edu> Co-authored-by: Sylvia Lutze <lutzes@long-slurm-sarchive-p0014.cluster.ihme.washington.edu>
1 parent 7438bb9 commit ca5997e

File tree

3 files changed

+164
-86
lines changed

3 files changed

+164
-86
lines changed

src/vivarium_gates_nutrition_optimization/constants/data_keys.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def log_name(self):
3131

3232
class __Pregnancy(NamedTuple):
3333
ASFR: str = "covariate.age_specific_fertility_rate.estimate"
34-
SBR: str = "covariate.stillbirth_to_live_birth_ratio.estimate"
34+
SBR: str = "covariate.stillbirth_20_weeks_to_live_birth_ratio.estimate"
3535
RAW_INCIDENCE_RATE_MISCARRIAGE: str = (
3636
"cause.maternal_abortion_and_miscarriage.raw_incidence_rate"
3737
)

src/vivarium_gates_nutrition_optimization/data/extra_gbd.py

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,65 @@
11
from gbd_mapping import sequelae
22
from vivarium_gbd_access import constants as gbd_constants
3-
from vivarium_gbd_access import gbd
43
from vivarium_gbd_access import utilities as vi_utils
4+
from vivarium_gbd_access.gbd import base_data as gbd
55
from vivarium_inputs import globals as vi_globals
66
from vivarium_inputs import utility_data
77

88
from vivarium_gates_nutrition_optimization.constants import data_keys
99
from vivarium_gates_nutrition_optimization.data import utilities
1010

1111

12-
@gbd.memory.cache
13-
def load_lbwsg_exposure(location: str):
12+
@vi_utils.cache
13+
def load_2021_lbwsg_birth_exposure(location: str):
1414
entity = utilities.get_entity(data_keys.LBWSG.EXPOSURE)
1515
location_id = utility_data.get_location_id(location)
16-
data = vi_utils.get_draws(
16+
data = gbd.get_draws(
1717
gbd_id_type="rei_id",
1818
gbd_id=entity.gbd_id,
1919
source=gbd_constants.SOURCES.EXPOSURE,
2020
location_id=location_id,
21-
year_id=2021,
21+
year_id=2022,
2222
sex_id=gbd_constants.SEX.MALE + gbd_constants.SEX.FEMALE,
2323
age_group_id=164, # Birth prevalence
2424
release_id=gbd_constants.RELEASE_IDS.GBD_2021,
2525
)
2626
return data
2727

2828

29-
@gbd.memory.cache
29+
@vi_utils.cache
3030
def get_all_cause_yld_rate(location: str):
3131
entity = utilities.get_entity("cause.all_causes.ylds")
3232
location_id = utility_data.get_location_id(location)
33-
data = vi_utils.get_draws(
33+
data = gbd.get_draws(
3434
"cause_id",
3535
entity.gbd_id,
3636
source=gbd_constants.SOURCES.COMO,
3737
location_id=location_id,
38-
release_id=gbd_constants.RELEASE_IDS.GBD_2021,
38+
release_id=gbd_constants.RELEASE_IDS.GBD_2023,
3939
measure_id=vi_globals.MEASURES["YLDs"],
4040
metric_id=3, # rate
4141
)
4242
return data
4343

4444

45-
@gbd.memory.cache
45+
@vi_utils.cache
4646
def get_maternal_disorder_ylds(location: str, metric_id=None):
4747
entity = utilities.get_entity(data_keys.MATERNAL_DISORDERS.YLDS)
4848
location_id = utility_data.get_location_id(location)
49-
data = vi_utils.get_draws(
49+
data = gbd.get_draws(
5050
"cause_id",
5151
entity.gbd_id,
5252
source=gbd_constants.SOURCES.COMO,
5353
location_id=location_id,
54-
year_id=2021,
55-
release_id=gbd_constants.RELEASE_IDS.GBD_2021,
54+
year_id=2023,
55+
release_id=gbd_constants.RELEASE_IDS.GBD_2023,
5656
measure_id=vi_globals.MEASURES["YLDs"],
5757
metric_id=metric_id,
5858
)
5959
return data
6060

6161

62-
@gbd.memory.cache
62+
@vi_utils.cache
6363
def get_anemia_ylds(location: str, metric_id=None):
6464
anemia_sequelae = [
6565
sequelae.mild_anemia_due_to_maternal_hemorrhage,
@@ -68,38 +68,39 @@ def get_anemia_ylds(location: str, metric_id=None):
6868
]
6969
anemia_ids = [s.gbd_id for s in anemia_sequelae]
7070
location_id = utility_data.get_location_id(location)
71-
data = vi_utils.get_draws(
71+
data = gbd.get_draws(
7272
"sequela_id",
7373
anemia_ids,
7474
source=gbd_constants.SOURCES.COMO,
7575
location_id=location_id,
76-
year_id=2021,
77-
release_id=gbd_constants.RELEASE_IDS.GBD_2021,
76+
year_id=2023,
77+
release_id=gbd_constants.RELEASE_IDS.GBD_2023,
7878
measure_id=vi_globals.MEASURES["YLDs"],
7979
metric_id=metric_id,
8080
)
8181
return data
8282

8383

84-
@gbd.memory.cache
84+
@vi_utils.cache
8585
def get_anemia_yld_rate(location: str):
8686
location_id = utility_data.get_location_id(location)
87-
data = vi_utils.get_draws(
87+
data = gbd.get_draws(
8888
"rei_id",
8989
192,
9090
source=gbd_constants.SOURCES.COMO,
9191
location_id=location_id,
92-
release_id=gbd_constants.RELEASE_IDS.GBD_2021,
92+
release_id=gbd_constants.RELEASE_IDS.GBD_2023,
9393
measure_id=vi_globals.MEASURES["YLDs"],
9494
metric_id=3,
9595
)
9696
return data
9797

9898

99-
@gbd.memory.cache
99+
## This is left as 2021 because the changes to hemoglobin RRs are very significant and would require other model updates we don't plan to make.
100+
@vi_utils.cache
100101
def get_hemoglobin_maternal_disorders_rr():
101102
"""Relative risk associated with one g/dL decrease in hemoglobin concentration below 12 g/dL"""
102-
data = vi_utils.get_draws(
103+
data = gbd.get_draws(
103104
gbd_id_type="rei_id",
104105
gbd_id=95,
105106
release_id=gbd_constants.RELEASE_IDS.GBD_2021,

0 commit comments

Comments
 (0)