From cf509f6fc924a246cc711f2f14c462546eafbc31 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Thu, 12 Dec 2024 11:56:05 +0100 Subject: [PATCH 1/4] Remove `technology_type` column from input CSV files --- .../data/costs/energy/cost_reduction.csv | 192 +++++++++--------- .../data/costs/materials/cost_reduction.csv | 8 +- 2 files changed, 100 insertions(+), 100 deletions(-) diff --git a/message_ix_models/data/costs/energy/cost_reduction.csv b/message_ix_models/data/costs/energy/cost_reduction.csv index 2a9d617889..2a2a6bce05 100755 --- a/message_ix_models/data/costs/energy/cost_reduction.csv +++ b/message_ix_models/data/costs/energy/cost_reduction.csv @@ -1,96 +1,96 @@ -# Cost reduction in 2100,,,,,, -# ,,,,,, -# Units: % ,,,,,, -#,,,,,, -# Data is copied from Sheet1 in https://github.com/iiasa/message_data/blob/dev/data/model/investment_cost/SSP_technology_learning.xlsx,,,,,, -# There are some manually changed assumptions to the original GEA data in the spreadsheet (can be seen in the spreadsheet as marked in yellow),,,,,, -# The initial copied data can be found in gea_reduction_rates.csv,,,,,, -# This file renames the learning rates from GEAL to low and GEAM to medium and GEAH to high,,,,,, -message_technology,technology_type,very_low,low,medium,high,very_high -bio_istig,Biomass,0,0.1,0.3,0.4,0.5 -bio_istig_ccs,CCS,0,0.1,0.3,0.4,0.6 -bio_ppl,Biomass,0,0.1,0.2,0.3,0.4 -bio_ppl_co2scr,CCS,0,0,0,0.3,0.4 -biomass_i,Biomass,0,0,0,0,0 -c_ppl_co2scr,CCS,0,0,0,0.3,0.4 -coal_adv,Coal,0,0.1,0.3,0.5,0.7 -coal_adv_ccs,CCS,0,0.1,0.3,0.5,0.7 -coal_i,Coal,0,0,0,0,0 -coal_ppl,Coal,0,0,0.2,0.5,0.7 -coal_ppl_u,Coal,0,0,0,0,0 -csp_sm1_ppl,Renewable,0.15,0.3,0.3,0.5,0.7 -csp_sm3_ppl,Renewable,0.15,0.3,0.3,0.5,0.7 -elec_i,NA,0,0,0,0,0 -eth_bio,Biomass,0,0.27,0.27,0.4,0.55 -eth_bio_ccs,CCS,0,0.27,0.27,0.4,0.55 -eth_i,Biomass,0,0,0,0,0 -foil_i,Gas/Oil,0,0,0,0,0 -g_ppl_co2scr,CCS,0,0,0,0.3,0.4 -gas_cc,Gas/Oil,0.1,0.2,0.29,0.38,0.5 -gas_cc_ccs,CCS,0.1,0.2,0.29,0.5,0.7 -gas_ct,Gas/Oil,0.1,0.2,0.29,0.38,0.5 -gas_i,Gas/Oil,0,0,0,0,0 -gas_ppl,Gas/Oil,0.1,0.2,0.29,0.38,0.5 -geo_hpl,Renewable,0.1,0.15,0.18,0.25,0.35 -geo_ppl,Renewable,0,0.1,0.18,0.25,0.35 -h2_bio,Biomass,0,0.25,0.4,0.5,0.7 -h2_bio_ccs,CCS,0,0.25,0.4,0.5,0.7 -h2_coal,Coal,0,0.25,0.4,0.4,0.5 -h2_coal_ccs,CCS,0,0.25,0.4,0.4,0.5 -h2_elec,Renewable,0,0,0.1,0.2,0.3 -h2_i,NA,0,0,0,0,0 -h2_smr,Gas/Oil,0,0.25,0.4,0.5,0.7 -h2_smr_ccs,CCS,0,0.25,0.4,0.5,0.7 -heat_i,NA,0,0,0,0,0 -hp_el_i,Renewable,0.1,0.2,0.5,0.5,0.6 -hp_gas_i,Gas/Oil,0.1,0.2,0.4,0.4,0.5 -hydro_hc,Renewable,0,0,0,0,0 -hydro_lc,Renewable,0,0,0,0,0 -igcc,Coal,0,0.1,0.3,0.5,0.7 -igcc_ccs,CCS,0,0.1,0.3,0.5,0.7 -liq_bio,Biomass,0.15,0.27,0.27,0.4,0.55 -liq_bio_ccs,CCS,0.15,0.27,0.27,0.4,0.55 -loil_i,Gas/Oil,0,0,0,0,0 -meth_coal,Coal,0,0.05,0.1,0.15,0.2 -meth_coal_ccs,CCS,0,0.05,0.1,0.15,0.2 -meth_i,Coal,0,0,0,0,0 -meth_ng,Gas/Oil,0,0.05,0.1,0.15,0.2 -meth_ng_ccs,CCS,0,0.05,0.1,0.15,0.2 -nuc_hc,Nuclear,0,0,0.15,0.3,0.45 -nuc_lc,Nuclear,0,0,0,0,0 -solar_i,Renewable,0.1,0.2,0.6,0.9,0.95 -solar_pv_I,Renewable,0.15,0.3,0.7,0.9,0.95 -solar_pv_RC,Renewable,0.15,0.3,0.7,0.9,0.95 -solar_res_hist_2005,Renewable,0.15,0.3,0.7,0.9,0.95 -solar_res_hist_2010,Renewable,0.15,0.3,0.7,0.9,0.95 -solar_res_hist_2015,Renewable,0.15,0.3,0.7,0.9,0.95 -solar_res_hist_2020,Renewable,0.15,0.3,0.7,0.9,0.95 -solar_res1,Renewable,0.15,0.3,0.7,0.9,0.95 -solar_res2,Renewable,0.15,0.3,0.7,0.9,0.95 -solar_res3,Renewable,0.15,0.3,0.7,0.9,0.95 -solar_res4,Renewable,0.15,0.3,0.7,0.9,0.95 -solar_res5,Renewable,0.15,0.3,0.7,0.9,0.95 -solar_res6,Renewable,0.15,0.3,0.7,0.9,0.95 -solar_res7,Renewable,0.15,0.3,0.7,0.9,0.95 -solar_res8,Renewable,0.15,0.3,0.7,0.9,0.95 -solar_th_ppl,Renewable,0.15,0.3,0.3,0.5,0.7 -stor_ppl,Renewable,0.15,0.3,0.7,0.9,0.95 -syn_liq,Coal,0,0.05,0.1,0.15,0.2 -syn_liq_ccs,CCS,0,0.05,0.1,0.15,0.2 -wind_ref_hist_2005,Renewable,0.15,0.3,0.53,0.65,0.75 -wind_ref_hist_2010,Renewable,0.15,0.3,0.53,0.65,0.75 -wind_ref_hist_2015,Renewable,0.15,0.3,0.53,0.65,0.75 -wind_ref_hist_2020,Renewable,0.15,0.3,0.53,0.65,0.75 -wind_ref1,Renewable,0.15,0.3,0.53,0.65,0.75 -wind_ref2,Renewable,0.15,0.3,0.53,0.65,0.75 -wind_ref3,Renewable,0.15,0.3,0.53,0.65,0.75 -wind_ref4,Renewable,0.15,0.3,0.53,0.65,0.75 -wind_ref5,Renewable,0.15,0.3,0.53,0.65,0.75 -wind_res_hist_2005,Renewable,0.15,0.3,0.53,0.65,0.75 -wind_res_hist_2010,Renewable,0.15,0.3,0.53,0.65,0.75 -wind_res_hist_2015,Renewable,0.15,0.3,0.53,0.65,0.75 -wind_res_hist_2020,Renewable,0.15,0.3,0.53,0.65,0.75 -wind_res1,Renewable,0.15,0.3,0.53,0.65,0.75 -wind_res2,Renewable,0.15,0.3,0.53,0.65,0.75 -wind_res3,Renewable,0.15,0.3,0.53,0.65,0.75 -wind_res4,Renewable,0.15,0.3,0.53,0.65,0.75 \ No newline at end of file +# Cost reduction in 2100,,,,, +# ,,,,, +# Units: % ,,,,, +#,,,,, +# Data is copied from Sheet1 in https://github.com/iiasa/message_data/blob/dev/data/model/investment_cost/SSP_technology_learning.xlsx,,,,, +# There are some manually changed assumptions to the original GEA data in the spreadsheet (can be seen in the spreadsheet as marked in yellow),,,,, +# The initial copied data can be found in gea_reduction_rates.csv,,,,, +# This file renames the learning rates from GEAL to low and GEAM to medium and GEAH to high,,,,, +message_technology,very_low,low,medium,high,very_high +bio_istig,0,0.1,0.3,0.4,0.5 +bio_istig_ccs,0,0.1,0.3,0.4,0.6 +bio_ppl,0,0.1,0.2,0.3,0.4 +bio_ppl_co2scr,0,0,0,0.3,0.4 +biomass_i,0,0,0,0,0 +c_ppl_co2scr,0,0,0,0.3,0.4 +coal_adv,0,0.1,0.3,0.5,0.7 +coal_adv_ccs,0,0.1,0.3,0.5,0.7 +coal_i,0,0,0,0,0 +coal_ppl,0,0,0.2,0.5,0.7 +coal_ppl_u,0,0,0,0,0 +csp_sm1_ppl,0.15,0.3,0.3,0.5,0.7 +csp_sm3_ppl,0.15,0.3,0.3,0.5,0.7 +elec_i,0,0,0,0,0 +eth_bio,0,0.27,0.27,0.4,0.55 +eth_bio_ccs,0,0.27,0.27,0.4,0.55 +eth_i,0,0,0,0,0 +foil_i,0,0,0,0,0 +g_ppl_co2scr,0,0,0,0.3,0.4 +gas_cc,0.1,0.2,0.29,0.38,0.5 +gas_cc_ccs,0.1,0.2,0.29,0.5,0.7 +gas_ct,0.1,0.2,0.29,0.38,0.5 +gas_i,0,0,0,0,0 +gas_ppl,0.1,0.2,0.29,0.38,0.5 +geo_hpl,0.1,0.15,0.18,0.25,0.35 +geo_ppl,0,0.1,0.18,0.25,0.35 +h2_bio,0,0.25,0.4,0.5,0.7 +h2_bio_ccs,0,0.25,0.4,0.5,0.7 +h2_coal,0,0.25,0.4,0.4,0.5 +h2_coal_ccs,0,0.25,0.4,0.4,0.5 +h2_elec,0,0,0.1,0.2,0.3 +h2_i,0,0,0,0,0 +h2_smr,0,0.25,0.4,0.5,0.7 +h2_smr_ccs,0,0.25,0.4,0.5,0.7 +heat_i,0,0,0,0,0 +hp_el_i,0.1,0.2,0.5,0.5,0.6 +hp_gas_i,0.1,0.2,0.4,0.4,0.5 +hydro_hc,0,0,0,0,0 +hydro_lc,0,0,0,0,0 +igcc,0,0.1,0.3,0.5,0.7 +igcc_ccs,0,0.1,0.3,0.5,0.7 +liq_bio,0.15,0.27,0.27,0.4,0.55 +liq_bio_ccs,0.15,0.27,0.27,0.4,0.55 +loil_i,0,0,0,0,0 +meth_coal,0,0.05,0.1,0.15,0.2 +meth_coal_ccs,0,0.05,0.1,0.15,0.2 +meth_i,0,0,0,0,0 +meth_ng,0,0.05,0.1,0.15,0.2 +meth_ng_ccs,0,0.05,0.1,0.15,0.2 +nuc_hc,0,0,0.15,0.3,0.45 +nuc_lc,0,0,0,0,0 +solar_i,0.1,0.2,0.6,0.9,0.95 +solar_pv_I,0.15,0.3,0.7,0.9,0.95 +solar_pv_RC,0.15,0.3,0.7,0.9,0.95 +solar_res_hist_2005,0.15,0.3,0.7,0.9,0.95 +solar_res_hist_2010,0.15,0.3,0.7,0.9,0.95 +solar_res_hist_2015,0.15,0.3,0.7,0.9,0.95 +solar_res_hist_2020,0.15,0.3,0.7,0.9,0.95 +solar_res1,0.15,0.3,0.7,0.9,0.95 +solar_res2,0.15,0.3,0.7,0.9,0.95 +solar_res3,0.15,0.3,0.7,0.9,0.95 +solar_res4,0.15,0.3,0.7,0.9,0.95 +solar_res5,0.15,0.3,0.7,0.9,0.95 +solar_res6,0.15,0.3,0.7,0.9,0.95 +solar_res7,0.15,0.3,0.7,0.9,0.95 +solar_res8,0.15,0.3,0.7,0.9,0.95 +solar_th_ppl,0.15,0.3,0.3,0.5,0.7 +stor_ppl,0.15,0.3,0.7,0.9,0.95 +syn_liq,0,0.05,0.1,0.15,0.2 +syn_liq_ccs,0,0.05,0.1,0.15,0.2 +wind_ref_hist_2005,0.15,0.3,0.53,0.65,0.75 +wind_ref_hist_2010,0.15,0.3,0.53,0.65,0.75 +wind_ref_hist_2015,0.15,0.3,0.53,0.65,0.75 +wind_ref_hist_2020,0.15,0.3,0.53,0.65,0.75 +wind_ref1,0.15,0.3,0.53,0.65,0.75 +wind_ref2,0.15,0.3,0.53,0.65,0.75 +wind_ref3,0.15,0.3,0.53,0.65,0.75 +wind_ref4,0.15,0.3,0.53,0.65,0.75 +wind_ref5,0.15,0.3,0.53,0.65,0.75 +wind_res_hist_2005,0.15,0.3,0.53,0.65,0.75 +wind_res_hist_2010,0.15,0.3,0.53,0.65,0.75 +wind_res_hist_2015,0.15,0.3,0.53,0.65,0.75 +wind_res_hist_2020,0.15,0.3,0.53,0.65,0.75 +wind_res1,0.15,0.3,0.53,0.65,0.75 +wind_res2,0.15,0.3,0.53,0.65,0.75 +wind_res3,0.15,0.3,0.53,0.65,0.75 +wind_res4,0.15,0.3,0.53,0.65,0.75 \ No newline at end of file diff --git a/message_ix_models/data/costs/materials/cost_reduction.csv b/message_ix_models/data/costs/materials/cost_reduction.csv index 8acb5a4959..eff340b574 100755 --- a/message_ix_models/data/costs/materials/cost_reduction.csv +++ b/message_ix_models/data/costs/materials/cost_reduction.csv @@ -1,4 +1,4 @@ -# Cost reduction in 2100,,,,,, -# ,,,,,, -# Units: % ,,,,,, -message_technology,technology_type,very_low,low,medium,high,very_high \ No newline at end of file +# Cost reduction in 2100,,,,, +# ,,,,, +# Units: % ,,,,, +message_technology,very_low,low,medium,high,very_high \ No newline at end of file From d61e2ecab6eabd407e801dc7f92634419218b4f0 Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Thu, 12 Dec 2024 11:56:47 +0100 Subject: [PATCH 2/4] Remove instances in code that used `technology_type` column --- message_ix_models/tools/costs/decay.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/message_ix_models/tools/costs/decay.py b/message_ix_models/tools/costs/decay.py index c55384ace6..3c771c820b 100644 --- a/message_ix_models/tools/costs/decay.py +++ b/message_ix_models/tools/costs/decay.py @@ -207,7 +207,6 @@ def _get_module_cost_reduction( pd.concat([reduction_energy, reduction_energy_no_reduction], ignore_index=True) .sort_values("message_technology") .reset_index(drop=True) - .drop(columns=["technology_type"]) ) if module != "energy": @@ -225,10 +224,8 @@ def _get_module_cost_reduction( ] # append scen_red_module to scen_red_energy - reduction_joined = ( - reduction_energy._append(reduction_module) - .reset_index(drop=True) - .drop(columns=["technology_type"]) + reduction_joined = reduction_energy._append(reduction_module).reset_index( + drop=True ) else: reduction_joined = reduction_energy.copy() From 1b61d33e38572c6f020e4c45f15961ca0cf3436a Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Thu, 12 Dec 2024 12:20:59 +0100 Subject: [PATCH 3/4] Add #269 to doc/whatsnew --- doc/whatsnew.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/whatsnew.rst b/doc/whatsnew.rst index fb9df4aecd..3ff5e28a72 100644 --- a/doc/whatsnew.rst +++ b/doc/whatsnew.rst @@ -64,6 +64,7 @@ Investment and fixed costs - Add `cooling` technology variant/module (:pull:`222`). - Add functionality to specify cost reduction values and cost reduction scenarios in a module (:issue:`251`, :pull:`255`). - Fix technology mapping of ammonia CCS technologies in materials module (:pull:`258`). +- Remove unused `technology_type` column from tool (:pull:`269`). Others ------ From 59c4ace9e18be0acbae33425c9e2c81a4fd1dbcf Mon Sep 17 00:00:00 2001 From: Measrainsey Meng Date: Thu, 12 Dec 2024 15:40:36 +0100 Subject: [PATCH 4/4] Replace `._append()` with `pd.concat()` --- message_ix_models/tools/costs/decay.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/message_ix_models/tools/costs/decay.py b/message_ix_models/tools/costs/decay.py index 3c771c820b..a28fcb0341 100644 --- a/message_ix_models/tools/costs/decay.py +++ b/message_ix_models/tools/costs/decay.py @@ -81,9 +81,9 @@ def _get_module_scenarios_reduction( ) ] - # append scen_red_module to scen_red_energy - scenarios_joined = scenarios_energy._append(scenarios_module).reset_index( - drop=True + # concat scenarios_energy and scenarios_module + scenarios_joined = pd.concat( + [scenarios_energy, scenarios_module], ignore_index=True ) else: scenarios_joined = scenarios_energy.copy() @@ -223,9 +223,9 @@ def _get_module_cost_reduction( ) ] - # append scen_red_module to scen_red_energy - reduction_joined = reduction_energy._append(reduction_module).reset_index( - drop=True + # concat reduction_energy and reduction_module + reduction_joined = pd.concat( + [reduction_energy, reduction_module], ignore_index=True ) else: reduction_joined = reduction_energy.copy()