made params more specific
This commit is contained in:
parent
ead87afce1
commit
e581ca930c
@ -39,7 +39,8 @@ rule build_electricity_demand:
|
||||
|
||||
rule build_powerplants:
|
||||
params:
|
||||
electricity=config["electricity"],
|
||||
powerplants_filter=config["electricity"]["powerplants_filter"],
|
||||
custom_powerplants=config["electricity"]["custom_powerplants"],
|
||||
countries=config["countries"],
|
||||
input:
|
||||
base_network=RESOURCES + "networks/base.nc",
|
||||
@ -138,7 +139,7 @@ if config["enable"].get("build_cutout", False):
|
||||
rule build_cutout:
|
||||
params:
|
||||
snapshots=config["snapshots"],
|
||||
atlite=config["atlite"],
|
||||
cutouts=config["atlite"]["cutouts"],
|
||||
input:
|
||||
regions_onshore=RESOURCES + "regions_onshore.geojson",
|
||||
regions_offshore=RESOURCES + "regions_offshore.geojson",
|
||||
@ -252,6 +253,7 @@ rule build_renewable_profiles:
|
||||
|
||||
rule build_hydro_profile:
|
||||
params:
|
||||
hydro=config["renewable"]["hydro"],
|
||||
countries=config["countries"],
|
||||
renewable=config["renewable"],
|
||||
input:
|
||||
@ -272,8 +274,8 @@ rule build_hydro_profile:
|
||||
|
||||
rule add_electricity:
|
||||
params:
|
||||
lines=config["lines"],
|
||||
load=config["load"],
|
||||
length_factor=config["lines"]["length_factor"],
|
||||
scaling_factor=config["load"]["scaling_factor"],
|
||||
countries=config["countries"],
|
||||
renewable=config["renewable"],
|
||||
electricity=config["electricity"],
|
||||
@ -316,7 +318,7 @@ rule add_electricity:
|
||||
rule simplify_network:
|
||||
params:
|
||||
clustering=config["clustering"],
|
||||
electricity=config["electricity"],
|
||||
max_hours=config["electricity"]["max_hours"],
|
||||
costs=config["costs"],
|
||||
renewable=config["renewable"],
|
||||
length_factor=config["lines"]["length_factor"],
|
||||
@ -352,10 +354,11 @@ rule simplify_network:
|
||||
|
||||
rule cluster_network:
|
||||
params:
|
||||
solving=config["solving"],
|
||||
electricity=config["electricity"],
|
||||
solver_name=config["solving"]["solver"]["name"],
|
||||
max_hours=config["electricity"]["max_hours"],
|
||||
conventional_carriers=config["electricity"].get("conventional_carriers", []),
|
||||
costs=config["costs"],
|
||||
lines=config["lines"],
|
||||
length_factor=config["lines"]["length_factor"],
|
||||
renewable=config["renewable"],
|
||||
clustering=config["clustering"],
|
||||
custom_busmap=config["enable"].get("custom_busmap", False),
|
||||
@ -392,7 +395,8 @@ rule cluster_network:
|
||||
rule add_extra_components:
|
||||
params:
|
||||
costs=config["costs"],
|
||||
electricity=config["electricity"],
|
||||
ext_carriers=config["electricity"]["extendable_carriers"],
|
||||
max_hours=config["electricity"]["max_hours"],
|
||||
input:
|
||||
network=RESOURCES + "networks/elec_s{simpl}_{clusters}.nc",
|
||||
tech_costs=COSTS,
|
||||
@ -414,9 +418,12 @@ rule add_extra_components:
|
||||
rule prepare_network:
|
||||
params:
|
||||
links=config["links"],
|
||||
solving=config["solving"],
|
||||
lines=config["lines"],
|
||||
electricity=config["electricity"],
|
||||
solver_name=config["solving"]["solver"]["name"],
|
||||
co2base=config["electricity"]["co2base"],
|
||||
co2limit=config["electricity"]["co2limit"],
|
||||
gaslimit=config["electricity"].get("gaslimit"),
|
||||
max_hours=config["electricity"]["max_hours"],
|
||||
costs=config["costs"],
|
||||
input:
|
||||
RESOURCES + "networks/elec_s{simpl}_{clusters}_ec.nc",
|
||||
|
@ -186,7 +186,7 @@ rule build_temperature_profiles:
|
||||
|
||||
rule build_cop_profiles:
|
||||
params:
|
||||
sector=config["sector"],
|
||||
heat_pump_sink_T=config["sector"]["heat_pump_sink_T"],
|
||||
input:
|
||||
temp_soil_total=RESOURCES + "temp_soil_total_elec_s{simpl}_{clusters}.nc",
|
||||
temp_soil_rural=RESOURCES + "temp_soil_rural_elec_s{simpl}_{clusters}.nc",
|
||||
@ -330,7 +330,7 @@ if config["sector"]["regional_co2_sequestration_potential"]["enable"]:
|
||||
|
||||
rule build_sequestration_potentials:
|
||||
params:
|
||||
sector=config["sector"],
|
||||
co2seq_potential=config["sector"]["regional_co2_sequestration_potential"],
|
||||
input:
|
||||
sequestration_potential=HTTP.remote(
|
||||
"https://raw.githubusercontent.com/ericzhou571/Co2Storage/main/resources/complete_map_2020_unit_Mt.geojson",
|
||||
@ -405,8 +405,27 @@ rule build_ammonia_production:
|
||||
|
||||
rule build_industry_sector_ratios:
|
||||
params:
|
||||
industry=config["industry"],
|
||||
sector=config["sector"],
|
||||
industry={
|
||||
"H2_DRI":config["industry"]["H2_DRI"],
|
||||
"elec_DRI":config["industry"]["elec_DRI"],
|
||||
"HVC_production_today":config["industry"]["HVC_production_today"],
|
||||
"petrochemical_process_emissions":config["industry"]["petrochemical_process_emissions"],
|
||||
"NH3_process_emissions":config["industry"]["NH3_process_emissions"],
|
||||
"MWh_CH4_per_tNH3_SMR":config["industry"]["MWh_CH4_per_tNH3_SMR"],
|
||||
"MWh_elec_per_tNH3_SMR":config["industry"]["MWh_elec_per_tNH3_SMR"],
|
||||
"chlorine_production_today":config["industry"]["chlorine_production_today"],
|
||||
"MWh_H2_per_tCl":config["industry"]["MWh_H2_per_tCl"],
|
||||
"MWh_elec_per_tCl":config["industry"]["MWh_elec_per_tCl"],
|
||||
"methanol_production_today":config["industry"]["methanol_production_today"],
|
||||
"MWh_CH4_per_tMeOH":config["industry"]["MWh_CH4_per_tMeOH"],
|
||||
"MWh_elec_per_tMeOH":config["industry"]["MWh_elec_per_tMeOH"],
|
||||
"MWh_elec_per_tHVC_mechanical_recycling":config["industry"]["MWh_elec_per_tHVC_mechanical_recycling"],
|
||||
"MWh_elec_per_tHVC_chemical_recycling":config["industry"]["MWh_elec_per_tHVC_chemical_recycling"],
|
||||
"MWh_NH3_per_tNH3":config["industry"]["MWh_NH3_per_tNH3"],
|
||||
"MWh_H2_per_tNH3_electrolysis":config["industry"]["MWh_H2_per_tNH3_electrolysis"],
|
||||
"MWh_elec_per_tNH3_electrolysis":config["industry"]["MWh_elec_per_tNH3_electrolysis"]
|
||||
},
|
||||
sector_amonia=config["sector"].get("ammonia", False),
|
||||
input:
|
||||
ammonia_production=RESOURCES + "ammonia_production.csv",
|
||||
idees="data/jrc-idees-2015",
|
||||
@ -427,7 +446,12 @@ rule build_industry_sector_ratios:
|
||||
|
||||
rule build_industrial_production_per_country:
|
||||
params:
|
||||
industry=config["industry"],
|
||||
industry={
|
||||
"reference_year":config["industry"]["reference_year"],
|
||||
"HVC_production_today":config["industry"]["HVC_production_today"],
|
||||
"chlorine_production_today":config["industry"]["chlorine_production_today"],
|
||||
"methanol_production_today":config["industry"]["methanol_production_today"]
|
||||
},
|
||||
countries=config["countries"],
|
||||
input:
|
||||
ammonia_production=RESOURCES + "ammonia_production.csv",
|
||||
@ -451,7 +475,14 @@ rule build_industrial_production_per_country:
|
||||
|
||||
rule build_industrial_production_per_country_tomorrow:
|
||||
params:
|
||||
industry=config["industry"],
|
||||
industry={
|
||||
"St_primary_fraction":config["industry"]["St_primary_fraction"],
|
||||
"DRI_fraction":config["industry"]["DRI_fraction"],
|
||||
"Al_primary_fraction":config["industry"]["Al_primary_fraction"],
|
||||
"HVC_mechanical_recycling_fraction":config["industry"]["HVC_mechanical_recycling_fraction"],
|
||||
"HVC_chemical_recycling_fraction":config["industry"]["HVC_chemical_recycling_fraction"],
|
||||
"HVC_primary_fraction":config["industry"]["HVC_primary_fraction"]
|
||||
},
|
||||
input:
|
||||
industrial_production_per_country=RESOURCES
|
||||
+ "industrial_production_per_country.csv",
|
||||
@ -477,7 +508,7 @@ rule build_industrial_production_per_country_tomorrow:
|
||||
|
||||
rule build_industrial_distribution_key:
|
||||
params:
|
||||
industry=config["industry"],
|
||||
hotmaps_locate_missing=config["industry"].get("hotmaps_locate_missing", False),
|
||||
countries=config["countries"],
|
||||
input:
|
||||
regions_onshore=RESOURCES + "regions_onshore_elec_s{simpl}_{clusters}.geojson",
|
||||
@ -555,7 +586,12 @@ rule build_industrial_energy_demand_per_node:
|
||||
rule build_industrial_energy_demand_per_country_today:
|
||||
params:
|
||||
countries=config["countries"],
|
||||
industry=config["industry"],
|
||||
industry={
|
||||
"reference_year":config["industry"].get("reference_year", 2015),
|
||||
"MWh_CH4_per_tNH3_SMR":config["industry"]["MWh_CH4_per_tNH3_SMR"],
|
||||
"MWh_elec_per_tNH3_SMR":config["industry"]["MWh_elec_per_tNH3_SMR"],
|
||||
"MWh_NH3_per_tNH3":config["industry"]["MWh_NH3_per_tNH3"]
|
||||
},
|
||||
input:
|
||||
jrc="data/jrc-idees-2015",
|
||||
ammonia_production=RESOURCES + "ammonia_production.csv",
|
||||
@ -603,7 +639,7 @@ if config["sector"]["retrofitting"]["retro_endogen"]:
|
||||
|
||||
rule build_retro_cost:
|
||||
params:
|
||||
sector=config["sector"],
|
||||
retrofitting=config["sector"]["retrofitting"],
|
||||
countries=config["countries"],
|
||||
input:
|
||||
building_stock="data/retro/data_building_stock.csv",
|
||||
@ -705,17 +741,23 @@ rule build_transport_demand:
|
||||
rule prepare_sector_network:
|
||||
params:
|
||||
co2_budget=config["co2_budget"],
|
||||
solving=config["solving"],
|
||||
existing_capacities=config["existing_capacities"],
|
||||
solver_name=config["solving"]["solver"]["name"],
|
||||
conventional_carriers=config["existing_capacities"]["conventional_carriers"],
|
||||
foresight=config["foresight"],
|
||||
costs=config["costs"],
|
||||
sector=config["sector"],
|
||||
industry=config["industry"],
|
||||
industry={
|
||||
"MWh_elec_per_tNH3_electrolysis":config["industry"]["MWh_elec_per_tNH3_electrolysis"],
|
||||
"MWh_NH3_per_tNH3":config["industry"]["MWh_NH3_per_tNH3"],
|
||||
"MWh_H2_per_tNH3_electrolysis":config["industry"]["MWh_H2_per_tNH3_electrolysis"],
|
||||
"MWh_NH3_per_MWh_H2_cracker":config["industry"]["MWh_NH3_per_MWh_H2_cracker"]
|
||||
},
|
||||
pypsa_eur=config["pypsa_eur"],
|
||||
lines=config["lines"],
|
||||
scenario=config["scenario"],
|
||||
length_factor=config["lines"]["length_factor"],
|
||||
planning_horizons=config["scenario"]["planning_horizons"],
|
||||
countries=config["countries"],
|
||||
energy=config["energy"],
|
||||
emissions_scope=config["energy"]["emissions"],
|
||||
report_year=config["energy"]["eurostat_report_year"],
|
||||
RDIR=RDIR,
|
||||
input:
|
||||
**build_retro_cost_output,
|
||||
|
@ -122,7 +122,8 @@ rule make_summary:
|
||||
rule plot_summary:
|
||||
params:
|
||||
countries=config["countries"],
|
||||
scenario=config["scenario"],
|
||||
planning_horizons=config["scenario"]["planning_horizons"],
|
||||
sector_opts=config["scenario"]["sector_opts"],
|
||||
plotting=config["plotting"],
|
||||
RDIR=RDIR,
|
||||
input:
|
||||
|
@ -41,7 +41,7 @@ rule solve_network:
|
||||
|
||||
rule solve_operations_network:
|
||||
params:
|
||||
solving=config["solving"],
|
||||
options=config["solving"]["options"],
|
||||
input:
|
||||
network=RESULTS + "networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc",
|
||||
output:
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
rule add_existing_baseyear:
|
||||
params:
|
||||
scenario=config["scenario"],
|
||||
baseyear=config["scenario"]["planning_horizons"][0],
|
||||
sector=config["sector"],
|
||||
existing_capacities=config["existing_capacities"],
|
||||
costs=config["costs"],
|
||||
@ -48,8 +48,9 @@ rule add_existing_baseyear:
|
||||
|
||||
rule add_brownfield:
|
||||
params:
|
||||
sector=config["sector"],
|
||||
existing_capacities=config["existing_capacities"],
|
||||
H2_retrofit=config["sector"]["H2_retrofit"],
|
||||
H2_retrofit_capacity_per_CH4=config["sector"]["H2_retrofit_capacity_per_CH4"],
|
||||
threshold_capacity=config["existing_capacities"]["threshold_capacity"],
|
||||
input:
|
||||
overrides="data/override_component_attrs",
|
||||
network=RESULTS
|
||||
|
@ -49,7 +49,7 @@ def add_brownfield(n, n_p, year):
|
||||
)
|
||||
]
|
||||
|
||||
threshold = snakemake.params["existing_capacities"]["threshold_capacity"]
|
||||
threshold = snakemake.params["threshold_capacity"]
|
||||
|
||||
if not chp_heat.empty:
|
||||
threshold_chp_heat = (
|
||||
@ -87,7 +87,7 @@ def add_brownfield(n, n_p, year):
|
||||
|
||||
# deal with gas network
|
||||
pipe_carrier = ["gas pipeline"]
|
||||
if snakemake.params["sector"]["H2_retrofit"]:
|
||||
if snakemake.params["H2_retrofit"]:
|
||||
# drop capacities of previous year to avoid duplicating
|
||||
to_drop = n.links.carrier.isin(pipe_carrier) & (n.links.build_year != year)
|
||||
n.mremove("Link", n.links.loc[to_drop].index)
|
||||
@ -98,7 +98,7 @@ def add_brownfield(n, n_p, year):
|
||||
& (n.links.build_year != year)
|
||||
].index
|
||||
gas_pipes_i = n.links[n.links.carrier.isin(pipe_carrier)].index
|
||||
CH4_per_H2 = 1 / snakemake.params["sector"]["H2_retrofit_capacity_per_CH4"]
|
||||
CH4_per_H2 = 1 / snakemake.params["H2_retrofit_capacity_per_CH4"]
|
||||
fr = "H2 pipeline retrofitted"
|
||||
to = "gas pipeline"
|
||||
# today's pipe capacity
|
||||
|
@ -137,7 +137,7 @@ def _add_missing_carriers_from_costs(n, costs, carriers):
|
||||
n.import_components_from_dataframe(emissions, "Carrier")
|
||||
|
||||
|
||||
def load_costs(tech_costs, params, elec_params, Nyears=1.0):
|
||||
def load_costs(tech_costs, params, max_hours, Nyears=1.0):
|
||||
# set all asset costs and other parameters
|
||||
costs = pd.read_csv(tech_costs, index_col=[0, 1]).sort_index()
|
||||
|
||||
@ -180,7 +180,6 @@ def load_costs(tech_costs, params, elec_params, Nyears=1.0):
|
||||
dict(capital_cost=capital_cost, marginal_cost=0.0, co2_emissions=0.0)
|
||||
)
|
||||
|
||||
max_hours = elec_params["max_hours"]
|
||||
costs.loc["battery"] = costs_for_storage(
|
||||
costs.loc["battery storage"],
|
||||
costs.loc["battery inverter"],
|
||||
@ -728,7 +727,7 @@ if __name__ == "__main__":
|
||||
costs = load_costs(
|
||||
snakemake.input.tech_costs,
|
||||
snakemake.params["costs"],
|
||||
snakemake.params["electricity"],
|
||||
snakemake.params["electricity"]["max_hours"],
|
||||
Nyears,
|
||||
)
|
||||
ppl = load_powerplants(snakemake.input.powerplants)
|
||||
@ -759,10 +758,10 @@ if __name__ == "__main__":
|
||||
snakemake.input.load,
|
||||
snakemake.input.nuts3_shapes,
|
||||
snakemake.params["countries"],
|
||||
snakemake.params["load"]["scaling_factor"],
|
||||
snakemake.params["scaling_factor"],
|
||||
)
|
||||
|
||||
update_transmission_costs(n, costs, snakemake.params["lines"]["length_factor"])
|
||||
update_transmission_costs(n, costs, snakemake.params["length_factor"])
|
||||
|
||||
conventional_inputs = {
|
||||
k: v for k, v in snakemake.input.items() if k.startswith("conventional_")
|
||||
@ -783,7 +782,7 @@ if __name__ == "__main__":
|
||||
snakemake.input,
|
||||
renewable_carriers,
|
||||
extendable_carriers,
|
||||
snakemake.params["lines"]["length_factor"],
|
||||
snakemake.params["length_factor"],
|
||||
)
|
||||
|
||||
if "hydro" in renewable_carriers:
|
||||
|
@ -615,7 +615,7 @@ if __name__ == "__main__":
|
||||
options = snakemake.params["sector"]
|
||||
opts = snakemake.wildcards.sector_opts.split("-")
|
||||
|
||||
baseyear = snakemake.params["scenario"]["planning_horizons"][0]
|
||||
baseyear = snakemake.params["baseyear"]
|
||||
|
||||
overrides = override_component_attrs(snakemake.input.overrides)
|
||||
n = pypsa.Network(snakemake.input.network, override_component_attrs=overrides)
|
||||
|
@ -67,9 +67,8 @@ idx = pd.IndexSlice
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def attach_storageunits(n, costs, elec_opts):
|
||||
carriers = elec_opts["extendable_carriers"]["StorageUnit"]
|
||||
max_hours = elec_opts["max_hours"]
|
||||
def attach_storageunits(n, costs, ext_carriers, max_hours):
|
||||
carriers = ext_carriers["StorageUnit"]
|
||||
|
||||
_add_missing_carriers_from_costs(n, costs, carriers)
|
||||
|
||||
@ -99,8 +98,8 @@ def attach_storageunits(n, costs, elec_opts):
|
||||
)
|
||||
|
||||
|
||||
def attach_stores(n, costs, elec_opts):
|
||||
carriers = elec_opts["extendable_carriers"]["Store"]
|
||||
def attach_stores(n, costs, ext_carriers):
|
||||
carriers = ext_carriers["Store"]
|
||||
|
||||
_add_missing_carriers_from_costs(n, costs, carriers)
|
||||
|
||||
@ -187,8 +186,7 @@ def attach_stores(n, costs, elec_opts):
|
||||
)
|
||||
|
||||
|
||||
def attach_hydrogen_pipelines(n, costs, elec_opts):
|
||||
ext_carriers = elec_opts["extendable_carriers"]
|
||||
def attach_hydrogen_pipelines(n, costs, ext_carriers):
|
||||
as_stores = ext_carriers.get("Store", [])
|
||||
|
||||
if "H2 pipeline" not in ext_carriers.get("Link", []):
|
||||
@ -235,16 +233,17 @@ if __name__ == "__main__":
|
||||
configure_logging(snakemake)
|
||||
|
||||
n = pypsa.Network(snakemake.input.network)
|
||||
elec_config = snakemake.params["electricity"]
|
||||
ext_carriers = snakemake.params["ext_carriers"]
|
||||
max_hours = snakemake.params["max_hours"]
|
||||
|
||||
Nyears = n.snapshot_weightings.objective.sum() / 8760.0
|
||||
costs = load_costs(
|
||||
snakemake.input.tech_costs, snakemake.params["costs"], elec_config, Nyears
|
||||
snakemake.input.tech_costs, snakemake.params["costs"], max_hours, Nyears
|
||||
)
|
||||
|
||||
attach_storageunits(n, costs, elec_config)
|
||||
attach_stores(n, costs, elec_config)
|
||||
attach_hydrogen_pipelines(n, costs, elec_config)
|
||||
attach_storageunits(n, costs, ext_carriers, max_hours)
|
||||
attach_stores(n, costs, ext_carriers)
|
||||
attach_hydrogen_pipelines(n, costs, ext_carriers)
|
||||
|
||||
add_nice_carrier_names(n, snakemake.config)
|
||||
|
||||
|
@ -39,7 +39,7 @@ if __name__ == "__main__":
|
||||
for source in ["air", "soil"]:
|
||||
source_T = xr.open_dataarray(snakemake.input[f"temp_{source}_{area}"])
|
||||
|
||||
delta_T = snakemake.params["sector"]["heat_pump_sink_T"] - source_T
|
||||
delta_T = snakemake.params["heat_pump_sink_T"] - source_T
|
||||
|
||||
cop = coefficient_of_performance(delta_T, source)
|
||||
|
||||
|
@ -106,7 +106,7 @@ if __name__ == "__main__":
|
||||
snakemake = mock_snakemake("build_cutout", cutout="europe-2013-era5")
|
||||
configure_logging(snakemake)
|
||||
|
||||
cutout_params = snakemake.params["atlite"]["cutouts"][snakemake.wildcards.cutout]
|
||||
cutout_params = snakemake.params["cutouts"][snakemake.wildcards.cutout]
|
||||
|
||||
snapshots = pd.date_range(freq="h", **snakemake.params["snapshots"])
|
||||
time = [snapshots[0], snapshots[-1]]
|
||||
|
@ -130,7 +130,7 @@ if __name__ == "__main__":
|
||||
snakemake = mock_snakemake("build_hydro_profile")
|
||||
configure_logging(snakemake)
|
||||
|
||||
params_hydro = snakemake.params["renewable"]["hydro"]
|
||||
params_hydro = snakemake.params["hydro"]
|
||||
cutout = atlite.Cutout(snakemake.input.cutout)
|
||||
|
||||
countries = snakemake.params["countries"]
|
||||
|
@ -73,7 +73,7 @@ def prepare_hotmaps_database(regions):
|
||||
|
||||
df[["srid", "coordinates"]] = df.geom.str.split(";", expand=True)
|
||||
|
||||
if snakemake.params["industry"].get("hotmaps_locate_missing", False):
|
||||
if snakemake.params["hotmaps_locate_missing"]:
|
||||
df = locate_missing_industrial_sites(df)
|
||||
|
||||
# remove those sites without valid locations
|
||||
|
@ -439,7 +439,7 @@ def chemicals_industry():
|
||||
|
||||
sector = "Ammonia"
|
||||
df[sector] = 0.0
|
||||
if snakemake.params["sector"].get("ammonia", False):
|
||||
if snakemake.params["sector_amonia"]:
|
||||
df.loc["ammonia", sector] = params["MWh_NH3_per_tNH3"]
|
||||
else:
|
||||
df.loc["hydrogen", sector] = params["MWh_H2_per_tNH3_electrolysis"]
|
||||
|
@ -134,12 +134,12 @@ if __name__ == "__main__":
|
||||
ppl = ppl.query('not (Country in @available_countries and Fueltype == "Bioenergy")')
|
||||
ppl = pd.concat([ppl, opsd])
|
||||
|
||||
ppl_query = snakemake.params["electricity"]["powerplants_filter"]
|
||||
ppl_query = snakemake.params["powerplants_filter"]
|
||||
if isinstance(ppl_query, str):
|
||||
ppl.query(ppl_query, inplace=True)
|
||||
|
||||
# add carriers from own powerplant files:
|
||||
custom_ppl_query = snakemake.params["electricity"]["custom_powerplants"]
|
||||
custom_ppl_query = snakemake.params["custom_powerplants"]
|
||||
ppl = add_custom_powerplants(
|
||||
ppl, snakemake.input.custom_powerplants, custom_ppl_query
|
||||
)
|
||||
|
@ -1040,7 +1040,7 @@ if __name__ == "__main__":
|
||||
|
||||
# ******** config *********************************************************
|
||||
|
||||
retro_opts = snakemake.params["sector"]["retrofitting"]
|
||||
retro_opts = snakemake.params["retrofitting"]
|
||||
interest_rate = retro_opts["interest_rate"]
|
||||
annualise_cost = retro_opts["annualise_cost"] # annualise the investment costs
|
||||
tax_weighting = retro_opts[
|
||||
|
@ -41,7 +41,7 @@ if __name__ == "__main__":
|
||||
"build_sequestration_potentials", simpl="", clusters="181"
|
||||
)
|
||||
|
||||
cf = snakemake.params["sector"]["regional_co2_sequestration_potential"]
|
||||
cf = snakemake.params["co2seq_potential"]
|
||||
|
||||
gdf = gpd.read_file(snakemake.input.sequestration_potential[0])
|
||||
|
||||
|
@ -479,7 +479,7 @@ if __name__ == "__main__":
|
||||
if snakemake.wildcards.clusters.endswith("m"):
|
||||
n_clusters = int(snakemake.wildcards.clusters[:-1])
|
||||
conventional = set(
|
||||
snakemake.params["electricity"].get("conventional_carriers", [])
|
||||
snakemake.params["conventional_carriers"]
|
||||
)
|
||||
aggregate_carriers = conventional.intersection(aggregate_carriers)
|
||||
elif snakemake.wildcards.clusters == "all":
|
||||
@ -495,13 +495,13 @@ if __name__ == "__main__":
|
||||
n, busmap, linemap, linemap, pd.Series(dtype="O")
|
||||
)
|
||||
else:
|
||||
line_length_factor = snakemake.params["lines"]["length_factor"]
|
||||
line_length_factor = snakemake.params["length_factor"]
|
||||
Nyears = n.snapshot_weightings.objective.sum() / 8760
|
||||
|
||||
hvac_overhead_cost = load_costs(
|
||||
snakemake.input.tech_costs,
|
||||
snakemake.params["costs"],
|
||||
snakemake.params["electricity"],
|
||||
snakemake.params["max_hours"],
|
||||
Nyears,
|
||||
).at["HVAC overhead", "capital_cost"]
|
||||
|
||||
@ -539,7 +539,7 @@ if __name__ == "__main__":
|
||||
aggregate_carriers,
|
||||
line_length_factor,
|
||||
aggregation_strategies,
|
||||
snakemake.params["solving"]["solver"]["name"],
|
||||
snakemake.params["solver_name"],
|
||||
cluster_config.get("algorithm", "hac"),
|
||||
cluster_config.get("feature", "solar+onwind-time"),
|
||||
hvac_overhead_cost,
|
||||
|
@ -455,7 +455,7 @@ def plot_carbon_budget_distribution(input_eurostat):
|
||||
ax1 = plt.subplot(gs1[0, 0])
|
||||
ax1.set_ylabel("CO$_2$ emissions (Gt per year)", fontsize=22)
|
||||
ax1.set_ylim([0, 5])
|
||||
ax1.set_xlim([1990, snakemake.params["scenario"]["planning_horizons"][-1] + 1])
|
||||
ax1.set_xlim([1990, snakemake.params["planning_horizons"][-1] + 1])
|
||||
|
||||
path_cb = "results/" + snakemake.params.RDIR + "/csvs/"
|
||||
countries = snakemake.params["countries"]
|
||||
@ -555,7 +555,7 @@ if __name__ == "__main__":
|
||||
|
||||
plot_balances()
|
||||
|
||||
for sector_opts in snakemake.params["scenario"]["sector_opts"]:
|
||||
for sector_opts in snakemake.params["sector_opts"]:
|
||||
opts = sector_opts.split("-")
|
||||
for o in opts:
|
||||
if "cb" in o:
|
||||
|
@ -254,7 +254,7 @@ if __name__ == "__main__":
|
||||
costs = load_costs(
|
||||
snakemake.input.tech_costs,
|
||||
snakemake.params["costs"],
|
||||
snakemake.params["electricity"],
|
||||
snakemake.params["max_hours"],
|
||||
Nyears,
|
||||
)
|
||||
|
||||
@ -269,7 +269,7 @@ if __name__ == "__main__":
|
||||
for o in opts:
|
||||
m = re.match(r"^\d+seg$", o, re.IGNORECASE)
|
||||
if m is not None:
|
||||
solver_name = snakemake.params["solving"]["solver"]["name"]
|
||||
solver_name = snakemake.params["solver_name"]
|
||||
n = apply_time_segmentation(n, m.group(0)[:-3], solver_name)
|
||||
break
|
||||
|
||||
@ -277,11 +277,11 @@ if __name__ == "__main__":
|
||||
if "Co2L" in o:
|
||||
m = re.findall("[0-9]*\.?[0-9]+$", o)
|
||||
if len(m) > 0:
|
||||
co2limit = float(m[0]) * snakemake.params["electricity"]["co2base"]
|
||||
co2limit = float(m[0]) * snakemake.params["co2base"]
|
||||
add_co2limit(n, co2limit, Nyears)
|
||||
logger.info("Setting CO2 limit according to wildcard value.")
|
||||
else:
|
||||
add_co2limit(n, snakemake.params["electricity"]["co2limit"], Nyears)
|
||||
add_co2limit(n, snakemake.params["co2limit"], Nyears)
|
||||
logger.info("Setting CO2 limit according to config value.")
|
||||
break
|
||||
|
||||
@ -293,7 +293,7 @@ if __name__ == "__main__":
|
||||
add_gaslimit(n, limit, Nyears)
|
||||
logger.info("Setting gas usage limit according to wildcard value.")
|
||||
else:
|
||||
add_gaslimit(n, snakemake.params["electricity"].get("gaslimit"), Nyears)
|
||||
add_gaslimit(n, snakemake.params["gaslimit"], Nyears)
|
||||
logger.info("Setting gas usage limit according to config value.")
|
||||
break
|
||||
|
||||
|
@ -252,7 +252,7 @@ def build_carbon_budget(o, input_eurostat, fn, emissions_scope, report_year):
|
||||
countries, input_eurostat, opts, emissions_scope, report_year, year=2018
|
||||
)
|
||||
|
||||
planning_horizons = snakemake.params["scenario"]["planning_horizons"]
|
||||
planning_horizons = snakemake.params["planning_horizons"]
|
||||
t_0 = planning_horizons[0]
|
||||
|
||||
if "be" in o:
|
||||
@ -391,7 +391,7 @@ def update_wind_solar_costs(n, costs):
|
||||
with xr.open_dataset(profile) as ds:
|
||||
underwater_fraction = ds["underwater_fraction"].to_pandas()
|
||||
connection_cost = (
|
||||
snakemake.params["lines"]["length_factor"]
|
||||
snakemake.params["length_factor"]
|
||||
* ds["average_distance"].to_pandas()
|
||||
* (
|
||||
underwater_fraction
|
||||
@ -3300,7 +3300,7 @@ if __name__ == "__main__":
|
||||
if snakemake.params["foresight"] == "myopic":
|
||||
add_lifetime_wind_solar(n, costs)
|
||||
|
||||
conventional = snakemake.params["existing_capacities"]["conventional_carriers"]
|
||||
conventional = snakemake.params["conventional_carriers"]
|
||||
for carrier in conventional:
|
||||
add_carrier_buses(n, carrier)
|
||||
|
||||
@ -3365,7 +3365,7 @@ if __name__ == "__main__":
|
||||
if options["allam_cycle"]:
|
||||
add_allam(n, costs)
|
||||
|
||||
solver_name = snakemake.params["solving"]["solver"]["name"]
|
||||
solver_name = snakemake.params["solver_name"]
|
||||
n = set_temporal_aggregation(n, opts, solver_name)
|
||||
|
||||
limit_type = "config"
|
||||
@ -3376,8 +3376,8 @@ if __name__ == "__main__":
|
||||
limit_type = "carbon budget"
|
||||
fn = "results/" + snakemake.params.RDIR + "/csvs/carbon_budget_distribution.csv"
|
||||
if not os.path.exists(fn):
|
||||
emissions_scope = snakemake.params["energy"]["emissions"]
|
||||
report_year = snakemake.params["energy"]["eurostat_report_year"]
|
||||
emissions_scope = snakemake.params["emissions_scope"]
|
||||
report_year = snakemake.params["report_year"]
|
||||
build_carbon_budget(
|
||||
o, snakemake.input.eurostat, fn, emissions_scope, report_year
|
||||
)
|
||||
@ -3413,7 +3413,7 @@ if __name__ == "__main__":
|
||||
add_electricity_grid_connection(n, costs)
|
||||
|
||||
first_year_myopic = (snakemake.params["foresight"] == "myopic") and (
|
||||
snakemake.params["scenario"]["planning_horizons"][0] == investment_year
|
||||
snakemake.params["planning_horizons"][0] == investment_year
|
||||
)
|
||||
|
||||
if options.get("cluster_heat_buses", False) and not first_year_myopic:
|
||||
|
@ -560,7 +560,7 @@ if __name__ == "__main__":
|
||||
technology_costs = load_costs(
|
||||
snakemake.input.tech_costs,
|
||||
snakemake.params["costs"],
|
||||
snakemake.params["electricity"],
|
||||
snakemake.params["max_hours"],
|
||||
Nyears,
|
||||
)
|
||||
|
||||
|
@ -41,7 +41,7 @@ if __name__ == "__main__":
|
||||
|
||||
opts = (snakemake.wildcards.opts + "-" + snakemake.wildcards.sector_opts).split("-")
|
||||
opts = [o for o in opts if o != ""]
|
||||
solve_opts = snakemake.params["solving"]["options"]
|
||||
solve_opts = snakemake.params["options"]
|
||||
|
||||
np.random.seed(solve_opts.get("seed", 123))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user