Skip to content

Commit

Permalink
Add .load() to read EconVars
Browse files Browse the repository at this point in the history
  • Loading branch information
davidrzhdu committed Mar 30, 2023
1 parent f5d88b2 commit 45d3397
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/dscim/preprocessing/input_damages.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def concatenate_labor_damages(
conversion_value = 1.273526
concat_ds = xr.combine_by_coords(list_damages_batch)
for v in [f"histclim_{variable}", f"delta_{variable}"]:
concat_ds[v] = (concat_ds[v] / ec_cls.econ_vars.pop) * -1 * conversion_value
concat_ds[v] = (concat_ds[v] / ec_cls.econ_vars.pop.load()) * -1 * conversion_value

# Save file
file_name = f"{variable}_{val_type}_{i}"
Expand Down Expand Up @@ -348,7 +348,7 @@ def process_batch(g):
ds = ds.drop(var)

# get in per capita 2019 PPP-adjusted USD damages
ds = (ds / pop) * -1 * 1.273526
ds = (ds / pop.load()) * -1 * 1.273526

# replace infinite values with missings
for var in ds.keys():
Expand Down Expand Up @@ -584,7 +584,7 @@ def concatenate_energy_damages(
conversion_value = 1.273526
concat_ds = xr.combine_by_coords(list_damages_batch)
for v in [f"histclim_{variable}", f"delta_{variable}"]:
concat_ds[v] = (concat_ds[v] / ec_cls.econ_vars.pop) * conversion_value
concat_ds[v] = (concat_ds[v] / ec_cls.econ_vars.pop.load()) * conversion_value

# Save file
file_name = f"{variable}_{i}"
Expand Down

0 comments on commit 45d3397

Please sign in to comment.