Skip to content

Commit 08d4833

Browse files
authored
Merge pull request #32 from ClimateImpactLab/release_prep0.4.0
v0.4.0 release prep
2 parents 0c90209 + a444010 commit 08d4833

File tree

3 files changed

+32
-25
lines changed

3 files changed

+32
-25
lines changed

scripts/batch_scghg.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@
8585
"2.5% Ramsey": [1.421158116, 0.00461878399],
8686
}
8787

88-
eta_rhos = []
88+
etas_rhos = []
8989
for er in target_disc:
9090
if er in eta_rho_conversion_dict:
91-
eta_rhos.append(eta_rho_conversion_dict[er])
91+
etas_rhos.append(eta_rho_conversion_dict[er])
9292
else:
9393
raise ValueError("Invalid etas_rhos selection")
9494

@@ -121,10 +121,10 @@
121121
conf_name,
122122
gas_conversion_dict,
123123
dom,
124-
eta_rhos,
124+
etas_rhos,
125125
risk_combos,
126126
pulse_years=pulse_years,
127127
gcnp=gcnp,
128128
uncollapsed=uncollapsed,
129129
)
130-
print(f"Full results are available in {str(Path(conf['save_path']))}")
130+
print(f"All results are available in {str(Path(conf['save_path']))}")

scripts/command_line_scghg.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@
3535
],
3636
default=[
3737
CAMEL_v,
38-
"coastal_v" + coastal_v,
39-
"agriculture",
40-
"mortality_v" + mortality_v,
41-
"energy",
42-
"labor",
38+
# "coastal_v" + coastal_v,
39+
# "agriculture",
40+
# "mortality_v" + mortality_v,
41+
# "energy",
42+
# "labor",
4343
],
4444
),
4545
inquirer.Checkbox(
@@ -66,7 +66,9 @@
6666
"U.S.",
6767
message="Select valuation type",
6868
choices=[("Global", False), ("Territorial U.S.", True)],
69-
default=[False, True],
69+
default=[False,
70+
# True
71+
],
7072
),
7173
inquirer.Checkbox(
7274
"files",
@@ -118,4 +120,4 @@
118120
gcnp=gcnp,
119121
uncollapsed=uncollapsed,
120122
)
121-
print(f"Full results are available in {str(Path(conf['save_path']))}")
123+
print(f"All results are available in {str(Path(conf['save_path']))}")

scripts/scghg_utils.py

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from datetime import date
1313

1414
# EDIT this line upon each release of dscim-facts-epa
15-
VERSION = "0.2.0"
15+
VERSION = "0.4.0"
1616

1717
discount_conversion_dict = {
1818
"1.016010255_9.149608e-05": "1.5% Ramsey",
@@ -92,7 +92,7 @@ def generate_meta(
9292
dict(
9393
machine=machine_name,
9494
commit=gitlabel,
95-
url=f"https://github.com/ClimateImpactLab/dscim-epa/commit/{gitlabel}",
95+
url=f"https://github.com/ClimateImpactLab/dscim-facts-epa/commit/{gitlabel}",
9696
)
9797
)
9898

@@ -184,7 +184,7 @@ def epa_scghg(
184184
):
185185

186186
if menu_option != "risk_aversion":
187-
raise Exception("DSCIM-EPA provides only 'risk_aversion' SCGHGs")
187+
raise Exception("DSCIM-FACTS-EPA provides only 'risk_aversion' SCGHGs")
188188

189189
# Manually add other config parameters that are not meant to change run to run
190190
conf["global_parameters"] = {
@@ -520,18 +520,23 @@ def epa_scghgs(
520520
for key, value in attrs.items():
521521
f.write("%s:%s\n" % (key, value))
522522

523-
# Saves global consumption no pulse
524-
# Fewer GCNPs are saved because they vary across fewer dimensions than SCGHGs
525-
if gcnp:
526-
out_dir = Path(conf["save_path"]) / "gcnp"
527-
makedir(out_dir)
528-
df_full_gcnp.attrs = attrs
529-
print(f"Saving {sector_short} global consumption no pulse (gcnp)")
530-
df_full_gcnp.to_netcdf(
531-
out_dir / f"{conf_savename}gcnp-dscim-{sector_short}.nc4"
532-
)
533-
print(f"gcnp is available in {str(out_dir)}")
523+
# save global consumption no pulse for each sector. Does not vary by pulse_year
524+
if pulse_year == pulse_years[0]:
525+
# Fewer GCNPs are saved because they vary across fewer dimensions than SCGHGs
526+
if gcnp:
527+
out_dir = Path(conf["save_path"]) / "gcnp"
528+
makedir(out_dir)
529+
df_full_gcnp.attrs = attrs
530+
print(f"Saving {sector_short} global consumption no pulse (gcnp)")
531+
df_full_gcnp.to_netcdf(
532+
out_dir / f"{conf_savename}gcnp-dscim-{sector_short}.nc4"
533+
)
534+
print(f"gcnp is available in {str(out_dir)}")
534535

535536
print(
536537
f"{'territorial_us' if terr_us else 'global'}_scghgs are available in {str(Path(conf['save_path']))}/{'territorial_us' if terr_us else 'global'}_scghgs"
537538
)
539+
if uncollapsed:
540+
print(
541+
f"Full distributions of {'territorial_us' if terr_us else 'global'}_scghgs are available in {str(Path(conf['save_path']))}/{'territorial_us' if terr_us else 'global'}_scghgs/full_distributions"
542+
)

0 commit comments

Comments
 (0)