Skip to content

Commit 884f98d

Browse files
committed
Update functions to work with new etas
1 parent 4568d87 commit 884f98d

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

src/dscim/preprocessing/preprocessing.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -310,18 +310,11 @@ def subset_USA_reduced_damages(
310310
for var in subset.variables:
311311
subset[var].encoding.clear()
312312

313-
if recipe == "adding_up":
314-
subset.to_zarr(
315-
f"{input_path}/{sector}_USA/{recipe}_{reduction}.zarr",
316-
consolidated=True,
317-
mode="w",
318-
)
319-
elif recipe == "risk_aversion":
320-
subset.to_zarr(
321-
f"{input_path}/{sector}_USA/{recipe}_{reduction}_eta{eta}.zarr",
322-
consolidated=True,
323-
mode="w",
324-
)
313+
subset.to_zarr(
314+
f"{input_path}/{sector}_USA/{recipe}_{reduction}_eta{eta}.zarr",
315+
consolidated=True,
316+
mode="w",
317+
)
325318

326319

327320
def subset_USA_ssp_econ(

tests/test_input_damages.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,6 +1087,7 @@ def test_prep_mortality_damages(
10871087
outpath=os.path.join(tmp_path, "mortality_out"),
10881088
mortality_version=version_test,
10891089
path_econ=os.path.join(tmp_path, "econvars_for_test", "econvars_for_test.zarr"),
1090+
etas=[1.0, 1.34],
10901091
)
10911092

10921093
ds_out_actual = xr.open_zarr(

0 commit comments

Comments
 (0)