[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
6de08bd523
commit
e838b63ded
@ -401,18 +401,22 @@ rule add_electricity:
|
|||||||
if str(fn).startswith("data/")
|
if str(fn).startswith("data/")
|
||||||
},
|
},
|
||||||
base_network=resources("networks/base.nc"),
|
base_network=resources("networks/base.nc"),
|
||||||
line_rating=resources("networks/line_rating.nc")
|
line_rating=(
|
||||||
|
resources("networks/line_rating.nc")
|
||||||
if config["lines"]["dynamic_line_rating"]["activate"]
|
if config["lines"]["dynamic_line_rating"]["activate"]
|
||||||
else resources("networks/base.nc"),
|
else resources("networks/base.nc")
|
||||||
|
),
|
||||||
tech_costs=COSTS,
|
tech_costs=COSTS,
|
||||||
regions=resources("regions_onshore.geojson"),
|
regions=resources("regions_onshore.geojson"),
|
||||||
powerplants=resources("powerplants.csv"),
|
powerplants=resources("powerplants.csv"),
|
||||||
hydro_capacities=ancient("data/bundle/hydro_capacities.csv"),
|
hydro_capacities=ancient("data/bundle/hydro_capacities.csv"),
|
||||||
geth_hydro_capacities="data/geth2015_hydro_capacities.csv",
|
geth_hydro_capacities="data/geth2015_hydro_capacities.csv",
|
||||||
unit_commitment="data/unit_commitment.csv",
|
unit_commitment="data/unit_commitment.csv",
|
||||||
fuel_price=resources("monthly_fuel_price.csv")
|
fuel_price=(
|
||||||
|
resources("monthly_fuel_price.csv")
|
||||||
if config["conventional"]["dynamic_fuel_price"]
|
if config["conventional"]["dynamic_fuel_price"]
|
||||||
else [],
|
else []
|
||||||
|
),
|
||||||
load=resources("load.csv"),
|
load=resources("load.csv"),
|
||||||
nuts3_shapes=resources("nuts3_shapes.geojson"),
|
nuts3_shapes=resources("nuts3_shapes.geojson"),
|
||||||
ua_md_gdp="data/GDP_PPP_30arcsec_v3_mapped_default.csv",
|
ua_md_gdp="data/GDP_PPP_30arcsec_v3_mapped_default.csv",
|
||||||
@ -540,7 +544,8 @@ rule prepare_network:
|
|||||||
snapshots={
|
snapshots={
|
||||||
"resolution": config["snapshots"].get("resolution", False),
|
"resolution": config["snapshots"].get("resolution", False),
|
||||||
"segmentation": config["snapshots"].get("segmentation", False),
|
"segmentation": config["snapshots"].get("segmentation", False),
|
||||||
}, # TODO: use config provider
|
},
|
||||||
|
# TODO: use config provider
|
||||||
links=config_provider("links"),
|
links=config_provider("links"),
|
||||||
lines=config_provider("lines"),
|
lines=config_provider("lines"),
|
||||||
co2base=config_provider("electricity", "co2base"),
|
co2base=config_provider("electricity", "co2base"),
|
||||||
|
@ -94,7 +94,9 @@ rule build_gas_input_locations:
|
|||||||
regions_offshore=resources("regions_offshore_elec_s{simpl}_{clusters}.geojson"),
|
regions_offshore=resources("regions_offshore_elec_s{simpl}_{clusters}.geojson"),
|
||||||
output:
|
output:
|
||||||
gas_input_nodes=resources("gas_input_locations_s{simpl}_{clusters}.geojson"),
|
gas_input_nodes=resources("gas_input_locations_s{simpl}_{clusters}.geojson"),
|
||||||
gas_input_nodes_simplified=resources("gas_input_locations_s{simpl}_{clusters}_simplified.csv"),
|
gas_input_nodes_simplified=resources(
|
||||||
|
"gas_input_locations_s{simpl}_{clusters}_simplified.csv"
|
||||||
|
),
|
||||||
resources:
|
resources:
|
||||||
mem_mb=2000,
|
mem_mb=2000,
|
||||||
log:
|
log:
|
||||||
@ -287,7 +289,9 @@ rule build_biomass_potentials:
|
|||||||
biomass_potentials_all=resources(
|
biomass_potentials_all=resources(
|
||||||
"biomass_potentials_all_s{simpl}_{clusters}_{planning_horizons}.csv"
|
"biomass_potentials_all_s{simpl}_{clusters}_{planning_horizons}.csv"
|
||||||
),
|
),
|
||||||
biomass_potentials=resources("biomass_potentials_s{simpl}_{clusters}_{planning_horizons}.csv"),
|
biomass_potentials=resources(
|
||||||
|
"biomass_potentials_s{simpl}_{clusters}_{planning_horizons}.csv"
|
||||||
|
),
|
||||||
threads: 1
|
threads: 1
|
||||||
resources:
|
resources:
|
||||||
mem_mb=1000,
|
mem_mb=1000,
|
||||||
@ -814,7 +818,9 @@ rule prepare_sector_network:
|
|||||||
network=resources("networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc"),
|
network=resources("networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc"),
|
||||||
energy_totals_name=resources("energy_totals.csv"),
|
energy_totals_name=resources("energy_totals.csv"),
|
||||||
eurostat=input_eurostat,
|
eurostat=input_eurostat,
|
||||||
pop_weighted_energy_totals=resources("pop_weighted_energy_totals_s{simpl}_{clusters}.csv"),
|
pop_weighted_energy_totals=resources(
|
||||||
|
"pop_weighted_energy_totals_s{simpl}_{clusters}.csv"
|
||||||
|
),
|
||||||
shipping_demand=resources("shipping_demand_s{simpl}_{clusters}.csv"),
|
shipping_demand=resources("shipping_demand_s{simpl}_{clusters}.csv"),
|
||||||
transport_demand=resources("transport_demand_s{simpl}_{clusters}.csv"),
|
transport_demand=resources("transport_demand_s{simpl}_{clusters}.csv"),
|
||||||
transport_data=resources("transport_data_s{simpl}_{clusters}.csv"),
|
transport_data=resources("transport_data_s{simpl}_{clusters}.csv"),
|
||||||
@ -823,10 +829,14 @@ rule prepare_sector_network:
|
|||||||
co2_totals_name=resources("co2_totals.csv"),
|
co2_totals_name=resources("co2_totals.csv"),
|
||||||
co2="data/bundle-sector/eea/UNFCCC_v23.csv",
|
co2="data/bundle-sector/eea/UNFCCC_v23.csv",
|
||||||
biomass_potentials=(
|
biomass_potentials=(
|
||||||
resources("biomass_potentials_s{simpl}_{clusters}_"
|
resources(
|
||||||
+ "{}.csv".format(config["biomass"]["year"]))
|
"biomass_potentials_s{simpl}_{clusters}_"
|
||||||
|
+ "{}.csv".format(config["biomass"]["year"])
|
||||||
|
)
|
||||||
if config["foresight"] == "overnight"
|
if config["foresight"] == "overnight"
|
||||||
else resources("biomass_potentials_s{simpl}_{clusters}_{planning_horizons}.csv")
|
else resources(
|
||||||
|
"biomass_potentials_s{simpl}_{clusters}_{planning_horizons}.csv"
|
||||||
|
)
|
||||||
),
|
),
|
||||||
costs=(
|
costs=(
|
||||||
"data/costs_{}.csv".format(config["costs"]["year"])
|
"data/costs_{}.csv".format(config["costs"]["year"])
|
||||||
@ -840,9 +850,15 @@ rule prepare_sector_network:
|
|||||||
busmap=resources("busmap_elec_s{simpl}_{clusters}.csv"),
|
busmap=resources("busmap_elec_s{simpl}_{clusters}.csv"),
|
||||||
clustered_pop_layout=resources("pop_layout_elec_s{simpl}_{clusters}.csv"),
|
clustered_pop_layout=resources("pop_layout_elec_s{simpl}_{clusters}.csv"),
|
||||||
simplified_pop_layout=resources("pop_layout_elec_s{simpl}.csv"),
|
simplified_pop_layout=resources("pop_layout_elec_s{simpl}.csv"),
|
||||||
industrial_demand=resources("industrial_energy_demand_elec_s{simpl}_{clusters}_{planning_horizons}.csv"),
|
industrial_demand=resources(
|
||||||
hourly_heat_demand_total=resources("hourly_heat_demand_total_elec_s{simpl}_{clusters}.nc"),
|
"industrial_energy_demand_elec_s{simpl}_{clusters}_{planning_horizons}.csv"
|
||||||
district_heat_share=resources("district_heat_share_elec_s{simpl}_{clusters}_{planning_horizons}.csv"),
|
),
|
||||||
|
hourly_heat_demand_total=resources(
|
||||||
|
"hourly_heat_demand_total_elec_s{simpl}_{clusters}.nc"
|
||||||
|
),
|
||||||
|
district_heat_share=resources(
|
||||||
|
"district_heat_share_elec_s{simpl}_{clusters}_{planning_horizons}.csv"
|
||||||
|
),
|
||||||
temp_soil_total=resources("temp_soil_total_elec_s{simpl}_{clusters}.nc"),
|
temp_soil_total=resources("temp_soil_total_elec_s{simpl}_{clusters}.nc"),
|
||||||
temp_soil_rural=resources("temp_soil_rural_elec_s{simpl}_{clusters}.nc"),
|
temp_soil_rural=resources("temp_soil_rural_elec_s{simpl}_{clusters}.nc"),
|
||||||
temp_soil_urban=resources("temp_soil_urban_elec_s{simpl}_{clusters}.nc"),
|
temp_soil_urban=resources("temp_soil_urban_elec_s{simpl}_{clusters}.nc"),
|
||||||
|
@ -24,7 +24,7 @@ rule cluster_networks:
|
|||||||
expand(
|
expand(
|
||||||
resources("networks/elec_s{simpl}_{clusters}.nc"),
|
resources("networks/elec_s{simpl}_{clusters}.nc"),
|
||||||
**config["scenario"],
|
**config["scenario"],
|
||||||
run=config["run"]["name"]
|
run=config["run"]["name"],
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ rule extra_components_networks:
|
|||||||
expand(
|
expand(
|
||||||
resources("networks/elec_s{simpl}_{clusters}_ec.nc"),
|
resources("networks/elec_s{simpl}_{clusters}_ec.nc"),
|
||||||
**config["scenario"],
|
**config["scenario"],
|
||||||
run=config["run"]["name"]
|
run=config["run"]["name"],
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ rule prepare_elec_networks:
|
|||||||
expand(
|
expand(
|
||||||
resources("networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc"),
|
resources("networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc"),
|
||||||
**config["scenario"],
|
**config["scenario"],
|
||||||
run=config["run"]["name"]
|
run=config["run"]["name"],
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ rule prepare_sector_networks:
|
|||||||
RESULTS
|
RESULTS
|
||||||
+ "prenetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
+ "prenetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
||||||
**config["scenario"],
|
**config["scenario"],
|
||||||
run=config["run"]["name"]
|
run=config["run"]["name"],
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ rule solve_elec_networks:
|
|||||||
expand(
|
expand(
|
||||||
RESULTS + "networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc",
|
RESULTS + "networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc",
|
||||||
**config["scenario"],
|
**config["scenario"],
|
||||||
run=config["run"]["name"]
|
run=config["run"]["name"],
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ rule solve_sector_networks:
|
|||||||
RESULTS
|
RESULTS
|
||||||
+ "postnetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
+ "postnetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
||||||
**config["scenario"],
|
**config["scenario"],
|
||||||
run=config["run"]["name"]
|
run=config["run"]["name"],
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|
||||||
@ -81,7 +81,7 @@ rule solve_sector_networks_perfect:
|
|||||||
RESULTS
|
RESULTS
|
||||||
+ "maps/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}-costs-all_{planning_horizons}.pdf",
|
+ "maps/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}-costs-all_{planning_horizons}.pdf",
|
||||||
**config["scenario"],
|
**config["scenario"],
|
||||||
run=config["run"]["name"]
|
run=config["run"]["name"],
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|
||||||
@ -91,12 +91,12 @@ rule validate_elec_networks:
|
|||||||
RESULTS
|
RESULTS
|
||||||
+ "figures/.statistics_plots_elec_s{simpl}_{clusters}_ec_l{ll}_{opts}",
|
+ "figures/.statistics_plots_elec_s{simpl}_{clusters}_ec_l{ll}_{opts}",
|
||||||
**config["scenario"],
|
**config["scenario"],
|
||||||
run=config["run"]["name"]
|
run=config["run"]["name"],
|
||||||
),
|
),
|
||||||
expand(
|
expand(
|
||||||
RESULTS
|
RESULTS
|
||||||
+ "figures/.validation_{kind}_plots_elec_s{simpl}_{clusters}_ec_l{ll}_{opts}",
|
+ "figures/.validation_{kind}_plots_elec_s{simpl}_{clusters}_ec_l{ll}_{opts}",
|
||||||
**config["scenario"],
|
**config["scenario"],
|
||||||
run=config["run"]["name"],
|
run=config["run"]["name"],
|
||||||
kind=["production", "prices", "cross_border"]
|
kind=["production", "prices", "cross_border"],
|
||||||
),
|
),
|
||||||
|
@ -174,7 +174,7 @@ rule make_summary:
|
|||||||
RESULTS
|
RESULTS
|
||||||
+ "postnetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
+ "postnetworks/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}_{planning_horizons}.nc",
|
||||||
**config["scenario"],
|
**config["scenario"],
|
||||||
run=config["run"]["name"]
|
run=config["run"]["name"],
|
||||||
),
|
),
|
||||||
costs=(
|
costs=(
|
||||||
"data/costs_{}.csv".format(config["costs"]["year"])
|
"data/costs_{}.csv".format(config["costs"]["year"])
|
||||||
@ -189,7 +189,7 @@ rule make_summary:
|
|||||||
RESULTS
|
RESULTS
|
||||||
+ "maps/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}-costs-all_{planning_horizons}.pdf",
|
+ "maps/elec_s{simpl}_{clusters}_l{ll}_{opts}_{sector_opts}-costs-all_{planning_horizons}.pdf",
|
||||||
**config["scenario"],
|
**config["scenario"],
|
||||||
run=config["run"]["name"]
|
run=config["run"]["name"],
|
||||||
),
|
),
|
||||||
h2_plot=expand(
|
h2_plot=expand(
|
||||||
(
|
(
|
||||||
@ -199,7 +199,7 @@ rule make_summary:
|
|||||||
else []
|
else []
|
||||||
),
|
),
|
||||||
**config["scenario"],
|
**config["scenario"],
|
||||||
run=config["run"]["name"]
|
run=config["run"]["name"],
|
||||||
),
|
),
|
||||||
ch4_plot=expand(
|
ch4_plot=expand(
|
||||||
(
|
(
|
||||||
@ -209,7 +209,7 @@ rule make_summary:
|
|||||||
else []
|
else []
|
||||||
),
|
),
|
||||||
**config["scenario"],
|
**config["scenario"],
|
||||||
run=config["run"]["name"]
|
run=config["run"]["name"],
|
||||||
),
|
),
|
||||||
output:
|
output:
|
||||||
nodal_costs=RESULTS + "csvs/nodal_costs.csv",
|
nodal_costs=RESULTS + "csvs/nodal_costs.csv",
|
||||||
|
@ -21,7 +21,9 @@ rule add_existing_baseyear:
|
|||||||
),
|
),
|
||||||
cop_soil_total=resources("cop_soil_total_elec_s{simpl}_{clusters}.nc"),
|
cop_soil_total=resources("cop_soil_total_elec_s{simpl}_{clusters}.nc"),
|
||||||
cop_air_total=resources("cop_air_total_elec_s{simpl}_{clusters}.nc"),
|
cop_air_total=resources("cop_air_total_elec_s{simpl}_{clusters}.nc"),
|
||||||
existing_heating_distribution=resources("existing_heating_distribution_elec_s{simpl}_{clusters}_{planning_horizons}.csv"),
|
existing_heating_distribution=resources(
|
||||||
|
"existing_heating_distribution_elec_s{simpl}_{clusters}_{planning_horizons}.csv"
|
||||||
|
),
|
||||||
existing_solar="data/existing_infrastructure/solar_capacity_IRENA.csv",
|
existing_solar="data/existing_infrastructure/solar_capacity_IRENA.csv",
|
||||||
existing_onwind="data/existing_infrastructure/onwind_capacity_IRENA.csv",
|
existing_onwind="data/existing_infrastructure/onwind_capacity_IRENA.csv",
|
||||||
existing_offwind="data/existing_infrastructure/offwind_capacity_IRENA.csv",
|
existing_offwind="data/existing_infrastructure/offwind_capacity_IRENA.csv",
|
||||||
|
@ -133,7 +133,7 @@ import numpy as np
|
|||||||
import pandas as pd
|
import pandas as pd
|
||||||
import pypsa
|
import pypsa
|
||||||
import seaborn as sns
|
import seaborn as sns
|
||||||
from _helpers import configure_logging, update_p_nom_max, set_scenario_config
|
from _helpers import configure_logging, set_scenario_config, update_p_nom_max
|
||||||
from add_electricity import load_costs
|
from add_electricity import load_costs
|
||||||
from packaging.version import Version, parse
|
from packaging.version import Version, parse
|
||||||
from pypsa.clustering.spatial import (
|
from pypsa.clustering.spatial import (
|
||||||
|
@ -18,7 +18,7 @@ import numpy as np
|
|||||||
import pandas as pd
|
import pandas as pd
|
||||||
import pypsa
|
import pypsa
|
||||||
import xarray as xr
|
import xarray as xr
|
||||||
from _helpers import update_config_with_sector_opts, set_scenario_config
|
from _helpers import set_scenario_config, update_config_with_sector_opts
|
||||||
from add_electricity import calculate_annuity, sanitize_carriers, sanitize_locations
|
from add_electricity import calculate_annuity, sanitize_carriers, sanitize_locations
|
||||||
from build_energy_totals import build_co2_totals, build_eea_co2, build_eurostat_co2
|
from build_energy_totals import build_co2_totals, build_eea_co2, build_eurostat_co2
|
||||||
from networkx.algorithms import complement
|
from networkx.algorithms import complement
|
||||||
|
@ -13,8 +13,8 @@ from pathlib import Path
|
|||||||
from _helpers import (
|
from _helpers import (
|
||||||
configure_logging,
|
configure_logging,
|
||||||
progress_retrieve,
|
progress_retrieve,
|
||||||
validate_checksum,
|
|
||||||
set_scenario_config,
|
set_scenario_config,
|
||||||
|
validate_checksum,
|
||||||
)
|
)
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
@ -40,8 +40,8 @@ from _benchmark import memory_logger
|
|||||||
from _helpers import (
|
from _helpers import (
|
||||||
configure_logging,
|
configure_logging,
|
||||||
get_opt,
|
get_opt,
|
||||||
update_config_with_sector_opts,
|
|
||||||
set_scenario_config,
|
set_scenario_config,
|
||||||
|
update_config_with_sector_opts,
|
||||||
)
|
)
|
||||||
from pypsa.descriptors import get_activity_mask
|
from pypsa.descriptors import get_activity_mask
|
||||||
from pypsa.descriptors import get_switchable_as_dense as get_as_dense
|
from pypsa.descriptors import get_switchable_as_dense as get_as_dense
|
||||||
|
Loading…
Reference in New Issue
Block a user