-
Notifications
You must be signed in to change notification settings - Fork 4
Input damages eta dimension #417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
266e2a8
9bdadc2
698058a
5db2861
f9ef00b
e39a48c
02620ef
680fde1
550f8b4
4568d87
884f98d
674aa03
fb6fba1
3a0f2e6
664572d
e26d453
c6516be
1577e16
64dcb10
5788e3b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,3 +16,4 @@ impactlab-tools==0.6.0 | |
| p_tqdm==1.4.2 | ||
| pyarrow==21.0.0 | ||
| numcodecs==0.15.1 | ||
| scipy==1.15.3 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -721,6 +721,7 @@ def prep_mortality_damages( | |
| outpath, | ||
| mortality_version, | ||
| path_econ, | ||
| etas, | ||
| ): | ||
| ec = EconVars(path_econ=path_econ) | ||
|
|
||
|
|
@@ -744,6 +745,10 @@ def prep_mortality_damages( | |
| scaling_deaths = "epa_row" | ||
| scaling_costs = "epa_scaled" | ||
| valuation = "vsl" | ||
| elif mortality_version == 9: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mortality version 9 is a new one to me. Need to add this to our documentation. Also, we need to add brief comments in here about what each version means (or at least what the string values mean).
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The theory behind the naming scheme is that versions 1-5 use VSL valuation and 6-10 use the same scaling deaths and costs, but with VLY instead. Version 9 has an extra wrench thrown in, which is that it uses a $2 million VSL in 2025 (2025 USD). This was an MG request for his book spec of the regional SCCs.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, @JMGilbert! Is that theory on versioning documented anywhere else? |
||
| scaling_deaths = "epa_popavg" | ||
| scaling_costs = "epa_scaled" | ||
| valuation = "vly" | ||
| else: | ||
| raise ValueError("Mortality version not valid: ", str(mortality_version)) | ||
|
|
||
|
|
@@ -776,7 +781,19 @@ def prep( | |
| valuation=valuation, | ||
| ).drop(["gcm", "valuation"]) | ||
|
|
||
| data = xr.open_mfdataset(paths, preprocess=prep, parallel=True, engine="zarr") | ||
| d_ls = [] | ||
| for eta in etas: | ||
| paths_ls = [paths.format(i, eta) for i in range(15)] | ||
kemccusker marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| data = ( | ||
| xr.open_mfdataset( | ||
| paths_ls, preprocess=prep, parallel=True, engine="zarr" | ||
| ) | ||
| .assign_coords({"eta": eta}) | ||
| .expand_dims("eta") | ||
| ) | ||
| d_ls.append(data) | ||
|
|
||
| data = xr.merge(d_ls) | ||
|
|
||
| damages = xr.Dataset( | ||
| { | ||
|
|
@@ -798,6 +815,7 @@ def prep( | |
| damages = damages.chunk( | ||
| { | ||
| "batch": 15, | ||
| "eta": 1, | ||
| "ssp": 1, | ||
| "model": 1, | ||
| "rcp": 1, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noting for the future that we should go ahead and make the whole filepath an arg in
selfso that these sorts of code changes aren't necessary.