Skip to content

Commit 8213bbc

Browse files
authored
Merge pull request #16 from ihmeuw/feature/rmbarber/microsoft-v8-update
v8 building dataset
2 parents 753a913 + e8dd093 commit 8213bbc

File tree

3 files changed

+32
-15
lines changed

3 files changed

+32
-15
lines changed

src/rra_population_model/constants.py

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def to_list(cls) -> list[str]:
2727

2828
class BuiltVersion(BaseModel):
2929
provider: Literal["ghsl", "microsoft"]
30-
version: Literal["v7_1", "v7_1_d", "v7_1_h", "r2023a"]
30+
version: Literal["v7_1", "v8", "r2023a"]
3131
time_points: list[str]
3232
measures: list[str]
3333

@@ -72,22 +72,33 @@ def time_points_float(self) -> list[float]:
7272
"height",
7373
],
7474
),
75-
"microsoft_v7_1_d": BuiltVersion(
75+
"microsoft_v8": BuiltVersion(
7676
provider="microsoft",
77-
version="v7_1_d",
77+
version="v8",
7878
time_points=[
79-
f"{y}q{q}" for y, q in itertools.product(range(2020, 2025), range(1, 5))
80-
][1:-2],
81-
measures=["density"],
82-
),
83-
"microsoft_v7_1_h": BuiltVersion(
84-
provider="microsoft",
85-
version="v7_1_h",
86-
time_points=[
87-
f"{y}q{q}" for y, q in itertools.product(range(2020, 2025), range(1, 5))
79+
f"{y}q{q}" for y, q in itertools.product(range(2020, 2026), range(1, 5))
8880
][1:-2],
89-
measures=["height"],
81+
measures=[
82+
"density",
83+
"height",
84+
],
9085
),
86+
# "microsoft_v7_1_d": BuiltVersion(
87+
# provider="microsoft",
88+
# version="v7_1_d",
89+
# time_points=[
90+
# f"{y}q{q}" for y, q in itertools.product(range(2020, 2025), range(1, 5))
91+
# ][1:-2],
92+
# measures=["density"],
93+
# ),
94+
# "microsoft_v7_1_h": BuiltVersion(
95+
# provider="microsoft",
96+
# version="v7_1_h",
97+
# time_points=[
98+
# f"{y}q{q}" for y, q in itertools.product(range(2020, 2025), range(1, 5))
99+
# ][1:-2],
100+
# measures=["height"],
101+
# ),
91102
}
92103

93104
DENOMINATORS = []

src/rra_population_model/model_prep/features/built.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,12 @@ def _generate_microsoft_derived_measures(
290290
"p_residential": "ghsl_r2023a_proportion_residential",
291291
"reference_density": "ghsl_r2023a_density",
292292
},
293+
"microsoft_v8": {
294+
"density": "microsoft_v8_density",
295+
"height": "microsoft_v8_height",
296+
"p_residential": "ghsl_r2023a_proportion_residential",
297+
"reference_density": "ghsl_r2023a_density",
298+
},
293299
}[built_version_name]
294300
density = pm_data.load_feature(
295301
feature_name=feature_dict["density"],

src/rra_population_model/model_prep/features/runner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
'40': [
2121
pmc.BUILT_VERSIONS["ghsl_r2023a"],
2222
pmc.BUILT_VERSIONS["microsoft_v7_1"],
23-
pmc.BUILT_VERSIONS["microsoft_v7_1_d"],
24-
pmc.BUILT_VERSIONS["microsoft_v7_1_h"],
23+
pmc.BUILT_VERSIONS["microsoft_v8"],
2524
],
2625
'100': [
2726
pmc.BUILT_VERSIONS["ghsl_r2023a"],
2827
pmc.BUILT_VERSIONS["microsoft_v7_1"],
28+
pmc.BUILT_VERSIONS["microsoft_v8"],
2929
],
3030
}
3131

0 commit comments

Comments
 (0)