Skip to content

Commit b15268e

Browse files
authored
Merge pull request #222 from iiasa/costs/cooling
Add variant/module for cooling technologies in `tools.costs`
2 parents 48f3314 + 687c4c4 commit b15268e

File tree

9 files changed

+126
-11
lines changed

9 files changed

+126
-11
lines changed

doc/api/tools-costs.rst

+11-3
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ Currently, :mod:`.tools.costs` supports two module :attr:`~.Config.module` setti
4848
"materials"
4949
Technologies conceived as part of the materials and industry sectors.
5050

51+
"cooling"
52+
Cooling technologies for power plants.
53+
5154
Data and files for a particular module can refer to other modules.
5255
This allows for values or settings for "materials" and other technologies to be assumed to match the values and settings used for the referenced "energy"-module technologies.
5356

@@ -86,9 +89,9 @@ To add a new module, the following steps are required:
8689
Please note that the following assumptions are made in technology costs mapping:
8790

8891
- If a technology is mapped to a technology in the "energy" module, then the cost reduction across scenarios is the same as the cost reduction of the mapped technology.
89-
- If a "materials" (or any other non-"energy") technology has :py:`reg_diff_source="energy"` and the "base_year_reference_region_cost" is not empty, then the "base_year_reference_region_cost" in :file:`tech_map_[module].csv` is used as the base year cost for the technology in the reference region.
92+
- If a non-"energy" module (such as "materials" or "cooling") technology has :py:`reg_diff_source="energy"` and the "base_year_reference_region_cost" is not empty, then the "base_year_reference_region_cost" in :file:`tech_map_[module].csv` is used as the base year cost for the technology in the reference region.
9093
If the "base_year_reference_region_cost" is empty, then the cost reduction across scenarios is the same as the cost reduction of the mapped technology.
91-
- If using the "materials" module, if a technology that is specified in :file:`tech_map_materials.csv` already exists in :file:`tech_map_energy.csv`, then the reference region cost is taken from :file:`tech_map_materials.csv`.
94+
- If using a non-"energy" module (such as "materials" or "cooling"), if a technology that is specified in :file:`tech_map_materials.csv` already exists in :file:`tech_map_energy.csv`, then the reference region cost is taken from :file:`tech_map_materials.csv`.
9295
- If a technology in a module is not mapped to any source of regional differentiation, then no cost reduction over the years is applied to the technology.
9396
- If a technology has a non-empty "base_year_reference_region_cost" but is not mapped to any source of regional differentiation, then assume no regional differentiation and use the reference region base year cost as the base year cost for all regions.
9497

@@ -145,6 +148,11 @@ These data can be further manipulated; for instance, added to a scenario using :
145148
See the file :file:`message_ix_models/tools/costs/demo.py` for multiple examples using various non-default settings to control the methods and data used by :func:`.create_cost_projections`.
146149

147150

151+
.. note:: The data produced are for all valid combinations of :math:`(y^V, y^A)`—including those that are beyond the `technical_lifetime` of the |t| to which they apply.
152+
This may produce large data frames, depending on the number of technologies, regions, and scenarios.
153+
At the moment, :mod:`.tools.costs` does not filter out these combinations.
154+
If this is problematic, the user may consider filtering the data for valid combinations of :math:`(y^V, y^A)`.
155+
148156
Code reference
149157
==============
150158

@@ -222,7 +230,7 @@ Regional differentiation of costs (:mod:`~.costs.regional_differentiation`)
222230
get_weo_data
223231
get_intratec_data
224232
get_raw_technology_mapping
225-
subset_materials_map
233+
subset_module_map
226234
adjust_technology_mapping
227235
get_weo_regional_differentiation
228236
get_intratec_regional_differentiation

doc/whatsnew.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@ Next release
1010
- Expand :doc:`repro` with sections on :ref:`repro-doc` and :ref:`versioning`, including :ref:`a list of external model names and ‘versions’ <model-names>` like “MESSAGEix-GLOBIOM 2.0” (:issue:`224`, :pull:`226`).
1111
- Update :doc:`/transport/index` (:pull:`213`).
1212
- Add "LED", "SSP4", and "SSP5" as values for the :program:`--ssp=…` option in :func:`.common_params` (:pull:`233`).
13-
- Fix and update :doc:`/api/tools-costs` (:pull:`219`, :pull:`206`, :pull:`221`)
13+
- Fix and update :doc:`/api/tools-costs` (:pull:`219`, :pull:`206`, :pull:`221`, :pull:`227`, :pull:`222`)
1414

1515
- Fix naming of GDP and population columns in SSP data aggregation (:pull:`219`).
1616
- Edit inputs for storage, CSP, hydrogen, and industry technologies (:pull:`206`).
1717
- Replace solar and wind technologies with new ones (:pull:`206`).
1818
- Reorganize input files and incorporate `first_year.csv` data into `tech_map.csv` (:pull:`221`).
1919
- Reconfigure use and implementation of technology variants/modules to be more agnostic (:pull:`221`).
2020
- Change cost decay to reach reduction percentage specified on the year 2100 (:pull:`227`).
21+
- Add `cooling` technology variant/module (:pull:`222`).
2122
- Improve and extend :doc:`/material/index` (:pull:`218`).
2223

2324
- Release of MESSAGEix-Materials 1.1.0 (:doc:`/material/v1.1.0`).
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
message_technology,reg_diff_source,reg_diff_technology,base_year_reference_region_cost,fix_ratio,first_year_original
2+
bio_hpl__air,energy,bio_hpl,220,0,2015
3+
bio_hpl__cl_fresh,energy,bio_hpl,100,0,2015
4+
bio_hpl__ot_fresh,energy,bio_hpl,0.4,0,2015
5+
bio_hpl__ot_saline,energy,bio_hpl,0.3,0,2015
6+
bio_istig__air,energy,bio_istig,220,0,2015
7+
bio_istig__cl_fresh,energy,bio_istig,100,0,2015
8+
bio_istig__ot_fresh,energy,bio_istig,0.4,0,2015
9+
bio_istig__ot_saline,energy,bio_istig,0.3,0,2015
10+
bio_istig_ccs__air,energy,bio_istig_ccs,220,0,2015
11+
bio_istig_ccs__cl_fresh,energy,bio_istig_ccs,100,0,2015
12+
bio_istig_ccs__ot_fresh,energy,bio_istig_ccs,0.4,0,2015
13+
bio_istig_ccs__ot_saline,energy,bio_istig_ccs,0.3,0,2015
14+
bio_ppl__air,energy,bio_ppl,220,0,2015
15+
bio_ppl__cl_fresh,energy,bio_ppl,100,0,2015
16+
bio_ppl__ot_fresh,energy,bio_ppl,0.4,0,2015
17+
bio_ppl__ot_saline,energy,bio_ppl,0.3,0,2015
18+
coal_adv__air,energy,coal_adv,220,0,2015
19+
coal_adv__cl_fresh,energy,coal_adv,100,0,2015
20+
coal_adv__ot_fresh,energy,coal_adv,0.4,0,2015
21+
coal_adv__ot_saline,energy,coal_adv,0.3,0,2015
22+
coal_adv_ccs__air,energy,coal_adv_ccs,220,0,2015
23+
coal_adv_ccs__cl_fresh,energy,coal_adv_ccs,160,0,2015
24+
coal_adv_ccs__ot_fresh,energy,coal_adv_ccs,0.4,0,2015
25+
coal_adv_ccs__ot_saline,energy,coal_adv_ccs,0.3,0,2015
26+
coal_ppl__air,energy,coal_ppl,220,0,2015
27+
coal_ppl__cl_fresh,energy,coal_ppl,100,0,2015
28+
coal_ppl__ot_fresh,energy,coal_ppl,0.4,0,2015
29+
coal_ppl__ot_saline,energy,coal_ppl,0.3,0,2015
30+
coal_ppl_u__air,energy,coal_ppl_u,220,0,2015
31+
coal_ppl_u__cl_fresh,energy,coal_ppl_u,160,0,2015
32+
coal_ppl_u__ot_fresh,energy,coal_ppl_u,0.4,0,2015
33+
coal_ppl_u__ot_saline,energy,coal_ppl_u,0.3,0,2015
34+
foil_hpl__air,energy,foil_hpl,220,0,2015
35+
foil_hpl__cl_fresh,energy,foil_hpl,100,0,2015
36+
foil_hpl__ot_fresh,energy,foil_hpl,0.4,0,2015
37+
foil_hpl__ot_saline,energy,foil_hpl,0.3,0,2015
38+
foil_ppl__air,energy,foil_ppl,220,0,2015
39+
foil_ppl__cl_fresh,energy,foil_ppl,100,0,2015
40+
foil_ppl__ot_fresh,energy,foil_ppl,0.4,0,2015
41+
foil_ppl__ot_saline,energy,foil_ppl,0.3,0,2015
42+
gas_cc__air,energy,gas_cc,140,0,2015
43+
gas_cc__cl_fresh,energy,gas_cc,50,0,2015
44+
gas_cc__ot_fresh,energy,gas_cc,0.2,0,2015
45+
gas_cc__ot_saline,energy,gas_cc,0.15,0,2015
46+
gas_cc_ccs__air,energy,gas_cc_ccs,220,0,2015
47+
gas_cc_ccs__cl_fresh,energy,gas_cc_ccs,160,0,2015
48+
gas_cc_ccs__ot_fresh,energy,gas_cc_ccs,0.4,0,2015
49+
gas_cc_ccs__ot_saline,energy,gas_cc_ccs,0.3,0,2015
50+
gas_hpl__air,energy,gas_hpl,220,0,2015
51+
gas_hpl__cl_fresh,energy,gas_hpl,100,0,2015
52+
gas_hpl__ot_fresh,energy,gas_hpl,0.4,0,2015
53+
gas_hpl__ot_saline,energy,gas_hpl,0.3,0,2015
54+
gas_ppl__air,energy,gas_ppl,220,0,2015
55+
gas_ppl__cl_fresh,energy,gas_ppl,100,0,2015
56+
gas_ppl__ot_fresh,energy,gas_ppl,0.4,0,2015
57+
gas_ppl__ot_saline,energy,gas_ppl,0.3,0,2015
58+
geo_hpl__air,energy,geo_hpl,220,0,2015
59+
geo_hpl__cl_fresh,energy,geo_hpl,100,0,2015
60+
geo_hpl__ot_fresh,energy,geo_hpl,0.4,0,2015
61+
geo_hpl__ot_saline,energy,geo_hpl,0.3,0,2015
62+
geo_ppl__air,energy,geo_ppl,220,0,2015
63+
geo_ppl__cl_fresh,energy,geo_ppl,100,0,2015
64+
geo_ppl__ot_fresh,energy,geo_ppl,0.4,0,2015
65+
geo_ppl__ot_saline,energy,geo_ppl,0.3,0,2015
66+
igcc__air,energy,igcc,140,0,2015
67+
igcc__cl_fresh,energy,igcc,50,0,2015
68+
igcc__ot_fresh,energy,igcc,0.4,0,2015
69+
igcc__ot_saline,energy,igcc,0.3,0,2015
70+
igcc_ccs__air,energy,igcc_ccs,220,0,2015
71+
igcc_ccs__cl_fresh,energy,igcc_ccs,100,0,2015
72+
igcc_ccs__ot_fresh,energy,igcc_ccs,0.4,0,2015
73+
igcc_ccs__ot_saline,energy,igcc_ccs,0.3,0,2015
74+
loil_cc__air,energy,loil_cc,140,0,2015
75+
loil_cc__cl_fresh,energy,loil_cc,50,0,2015
76+
loil_cc__ot_fresh,energy,loil_cc,0.2,0,2015
77+
loil_cc__ot_saline,energy,loil_cc,0.3,0,2015
78+
loil_ppl__air,energy,loil_ppl,220,0,2015
79+
loil_ppl__cl_fresh,energy,loil_ppl,100,0,2015
80+
loil_ppl__ot_fresh,energy,loil_ppl,0.4,0,2015
81+
loil_ppl__ot_saline,energy,loil_ppl,0.3,0,2015
82+
nuc_hc__air,energy,nuc_hc,220,0,2015
83+
nuc_hc__cl_fresh,energy,nuc_hc,100,0,2015
84+
nuc_hc__ot_fresh,energy,nuc_hc,0.4,0,2015
85+
nuc_hc__ot_saline,energy,nuc_hc,0.3,0,2015
86+
nuc_lc__air,energy,nuc_lc,220,0,2015
87+
nuc_lc__cl_fresh,energy,nuc_lc,160,0,2015
88+
nuc_lc__ot_fresh,energy,nuc_lc,0.8,0,2015
89+
nuc_lc__ot_saline,energy,nuc_lc,0.6,0,2015
90+
solar_th_ppl__air,energy,solar_th_ppl,220,0,2015
91+
solar_th_ppl__cl_fresh,energy,solar_th_ppl,100,0,2015
92+
solar_th_ppl__ot_fresh,energy,solar_th_ppl,0.4,0,2015
93+
solar_th_ppl__ot_saline,energy,solar_th_ppl,0.3,0,2015

message_ix_models/tests/tools/costs/test_decay.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
(
1919
("energy", {"coal_ppl", "gas_ppl", "gas_cc", "solar_res1"}),
2020
("materials", {"biomass_NH3", "MTO_petro", "furnace_foil_steel"}),
21+
("cooling", {"coal_ppl__cl_fresh", "gas_cc__air", "nuc_lc__ot_fresh"}),
2122
),
2223
)
2324
def test_get_cost_reduction_data(module: str, t_exp) -> None:
@@ -32,7 +33,7 @@ def test_get_cost_reduction_data(module: str, t_exp) -> None:
3233
assert 0 <= stats["min"] and stats["max"] <= 1
3334

3435

35-
@pytest.mark.parametrize("module", ("energy", "materials"))
36+
@pytest.mark.parametrize("module", ("energy", "materials", "cooling"))
3637
def test_get_technology_reduction_scenarios_data(module: str) -> None:
3738
config = Config()
3839
# The function runs without error
@@ -57,10 +58,11 @@ def test_get_technology_reduction_scenarios_data(module: str) -> None:
5758
{"biomass_NH3"},
5859
),
5960
("materials", {"biomass_NH3", "MTO_petro", "furnace_foil_steel"}, set()),
61+
("cooling", {"coal_ppl__cl_fresh", "gas_cc__air", "nuc_lc__ot_fresh"}, set()),
6062
),
6163
)
6264
def test_project_ref_region_inv_costs_using_reduction_rates(
63-
module: Literal["energy", "materials"], t_exp, t_excluded
65+
module: Literal["energy", "materials", "cooling"], t_exp, t_excluded
6466
) -> None:
6567
# Set up
6668
config = Config(module=module)

message_ix_models/tests/tools/costs/test_gdp.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def test_process_raw_ssp_data(test_context, node) -> None:
5252
assert scens == set(result.scenario.unique())
5353

5454

55-
@pytest.mark.parametrize("module", ("energy", "materials"))
55+
@pytest.mark.parametrize("module", ("energy", "materials", "cooling"))
5656
def test_adjust_cost_ratios_with_gdp(test_context, module) -> None:
5757
# Set parameters
5858
test_context.model.regions = "R12"

message_ix_models/tests/tools/costs/test_projections.py

+5
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@
3434
}
3535
},
3636
),
37+
(
38+
Config(module="cooling", method="gdp", node="R12", scenario="SSP5"),
39+
{"technology": {"coal_ppl__cl_fresh", "gas_cc__air", "nuc_lc__ot_fresh"}},
40+
{"technology": {"coal_ppl__cl_fresh", "gas_cc__air", "nuc_lc__ot_fresh"}},
41+
),
3742
pytest.param(
3843
Config(node="R20"),
3944
set(),

message_ix_models/tests/tools/costs/test_regional_differentiation.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ def test_get_intratec_data() -> None:
7474
(
7575
("energy", {"coal_ppl", "gas_ppl", "gas_cc", "solar_res1"}, {"weo"}),
7676
("materials", {"biomass_NH3", "meth_h2", "furnace_foil_steel"}, {"energy"}),
77+
(
78+
"cooling",
79+
{"coal_ppl__cl_fresh", "gas_cc__air", "nuc_lc__ot_fresh"},
80+
{"energy"},
81+
),
7782
),
7883
)
7984
def test_get_raw_technology_mapping(module, t_exp, rds_exp) -> None:
@@ -87,7 +92,7 @@ def test_get_raw_technology_mapping(module, t_exp, rds_exp) -> None:
8792
assert rds_exp <= set(result.reg_diff_source.unique())
8893

8994

90-
@pytest.mark.parametrize("module", ("energy", "materials"))
95+
@pytest.mark.parametrize("module", ("energy", "materials", "cooling"))
9196
def test_adjust_technology_mapping(module) -> None:
9297
energy_raw = get_raw_technology_mapping("energy")
9398

@@ -110,6 +115,7 @@ def test_adjust_technology_mapping(module) -> None:
110115
(
111116
("energy", {"coal_ppl", "gas_ppl", "gas_cc", "solar_res1"}),
112117
("materials", {"biomass_NH3", "meth_h2", "furnace_foil_steel"}),
118+
("cooling", {"coal_ppl__cl_fresh", "gas_cc__air", "nuc_lc__ot_fresh"}),
113119
),
114120
)
115121
def test_apply_regional_differentiation(module, t_exp) -> None:

message_ix_models/tools/costs/config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class Config:
5353
method: Literal["constant", "convergence", "gdp"] = "gdp"
5454

5555
#: Model variant for which to project costs.
56-
module: Literal["energy", "materials"] = "energy"
56+
module: Literal["energy", "materials", "cooling"] = "energy"
5757

5858
#: Use vintages.
5959
#:

message_ix_models/tools/costs/regional_differentiation.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def get_intratec_data() -> pd.DataFrame:
171171

172172

173173
def get_raw_technology_mapping(
174-
module: Literal["energy", "materials"],
174+
module: Literal["energy", "materials", "cooling"],
175175
) -> pd.DataFrame:
176176
"""Retrieve a technology mapping for `module`.
177177
@@ -234,7 +234,7 @@ def subset_module_map(raw_map):
234234

235235

236236
def adjust_technology_mapping(
237-
module: Literal["energy", "materials"],
237+
module: Literal["energy", "materials", "cooling"],
238238
) -> pd.DataFrame:
239239
"""Adjust technology mapping based on sources and assumptions.
240240

0 commit comments

Comments
 (0)