Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions config/plot_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plotting:
network_style_config_file: "config/plotting_styles/network_map.mplstyle"
transparent: false
statistics:
clip_numerical_zeroes: false
clip_numerical_zeroes: true
cost_panel:
y_axis: "annualized system cost bEUR/a" # only true if investment period is one year
cost_map:
Expand Down Expand Up @@ -64,7 +64,7 @@ plotting:
conv_techs: [ "gas", "gas-heat", "gas-AC", "AC-gas", "coal", "coal-AC","solar thermal","AC-heat","AC-AC","stations-AC","uranium", "H2-AC", "H2-gas",]
storage_techs: [ "hydro+PHS", "battery", "AC-battery", "H2", "AC-H2" , "AC-heat"]

nan_color: "pink"
nan_color: "brown"

tech_colors:
blank: "white"
Expand Down Expand Up @@ -127,11 +127,11 @@ plotting:
biomass to liquid: '#32CD32'
BioSNG: '#123456'
# coal
coal carbon capture: '#8487e8'
coal-CCS: '#8487e8'
coal cc: '#8487e8'
coal ccs: '#8487e8'
coal power plant retrofit: '#8487e8'
coal carbon capture: '#8c8dad'
coal-CCS: '#8c8dad'
coal cc: '#8c8dad'
coal ccs: '#8c8dad'
coal power plant retrofit: '#8c8dad'
# gas
gas: '#e0986c'
# gas: '#e05b09'
Expand Down Expand Up @@ -240,8 +240,8 @@ plotting:
services rural resistive heater: '#a5ed9d'
services urban decentral resistive heater: '#98e991'
urban central resistive heater: '#8cdf85'
retrofitting: '#8487e8'
building retrofitting: '#8487e8'
retrofitting: '#8c8dad'
building retrofitting: '#8c8dad'

# hydrogen
H2 for industry: "#f073da"
Expand Down Expand Up @@ -286,6 +286,7 @@ plotting:
services urban decentral solar thermal: '#dfb953'
urban central solar thermal: '#d7b24c'
solar rooftop: '#ffea80'
csp: "#ffe76e"
# wind
wind: "#235ebc"
onwind: "#235ebc"
Expand Down Expand Up @@ -332,6 +333,8 @@ plotting:
industry new electricity: '#2d2a66'
agriculture electricity: '#494778'
load shedding: "#dd2e23"
Load shedding: "#dd2e23"
Load Shedding: "#dd2e23"
# syngas
Sabatier: '#9850ad'
methanation: '#c44ce6'
Expand Down Expand Up @@ -400,7 +403,6 @@ plotting:
CCGT: "Combined-Cycle Gas"
gas CCGT: "Combined-Cycle Gas"
gas ccs: "Gas with Carbon Capture"
CCGT gas: "Combined-Cycle Gas"
gas: Gas
heat pump: "Heat Pump"
stations-AC: "Reservoir & Dam"
Expand All @@ -424,12 +426,11 @@ plotting:
solar thermal: "Solar Thermal"
uranium: "Nuclear"
hydroelectricity: "Hydroelectricity"
energy:
coal: "Coal"
offwind: "Offshore Wind"
onwind: "Onshore Wind"
solar: "Solar"
solar thermal: "Solar Thermal"
coal: "Coal"
offwind: "Offshore Wind"
onwind: "Onshore Wind"
solar: "Solar"
solar thermal: "Solar Thermal"

preferred_order:
- electric load
Expand Down
5 changes: 4 additions & 1 deletion workflow/scripts/_pypsa_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,13 @@ def calc_lcoe(
capex = n.statistics.expanded_capex(groupby=grouper, **kwargs)
tot_capex = n.statistics.capex(groupby=grouper, **kwargs)
supply = n.statistics.supply(groupby=grouper, **kwargs)

# restore original marginal costs
n.links.marginal_cost = original_marginal_costs

# incase no grouper was specified, get different levels
if grouper is None:
supply = supply.groupby(level=[0, 1]).sum()

outputs = pd.concat(
[opex, capex, tot_capex, rev, supply],
axis=1,
Expand Down
6 changes: 4 additions & 2 deletions workflow/scripts/plot_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,9 @@ def calc_link_plot_width(row, carrier="AC", additions=False):
# ============ === Stats by bus ===
# calc costs & sum over component types to keep bus & carrier (remove no loc)
costs = network.statistics.capex(groupby=["location", "carrier"])
costs = costs.groupby(level=[1, 2]).sum().drop("")
costs = costs.groupby(level=[1, 2]).sum()
if "" in costs.index:
costs.drop("", inplace=True)
# we miss some buses by grouping epr location, fill w 0s
bus_idx = pd.MultiIndex.from_product([network.buses.index, ["AC"]])
costs = costs.reindex(bus_idx.union(costs.index), fill_value=0)
Expand Down Expand Up @@ -632,7 +634,7 @@ def calc_plot_width(row, carrier="AC"):
"plot_network",
topology="current+FCG",
# co2_pathway="exp175default",
co2_pathway="SSP2-PkBudg1000_CHAb",
co2_pathway="SSP2-PkBudg1000-CHA-pypsaelh2",
planning_horizons="2030",
# heating_demand="positive",
configfiles=["resources/tmp/remind_coupled_cg.yaml"],
Expand Down
2 changes: 1 addition & 1 deletion workflow/scripts/plot_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def plot_static_per_carrier(ds: DataFrame, ax: axes.Axes, colors: DataFrame, dro
planning_horizons="2025",
# co2_pathway="exp175default",
# planning_horizons="2130",
co2_pathway="SSP2-PkBudg1000_CHAb",
co2_pathway="SSP2-PkBudg1000-CHA-pypsaelh2",
topology="current+FCG",
# heating_demand="positive",
configfiles="resources/tmp/remind_coupled_cg.yaml",
Expand Down
26 changes: 10 additions & 16 deletions workflow/scripts/plot_summary_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ def plot_pathway_capacities(
year = cap_df.columns.get_level_values(0)[0]
cap_df = cap_df.droplevel(0, axis=1).rename(columns={"Unnamed: 4_level_1": year})
cap_df /= PLOT_CAP_UNITS
cap_df.drop("Load Shedding", level="carrier", inplace=True)

# get stores relevant for reporting according to config, use later
stores = (
Expand Down Expand Up @@ -278,7 +279,7 @@ def plot_pathway_capacities(
labels.reverse()

if capacity_df.index.difference(caps_stores.index).empty:
ax.set_ylabel(f"Installed Capacity [{PLOT_CAP_LABEL}h]")
ax.set_ylabel(f"Installed Storage Capacity [{PLOT_CAP_LABEL}h]")
else:
ax.set_ylabel(f"Installed Capacity [{PLOT_CAP_LABEL}]")
ax.set_ylim([0, capacity_df.sum(axis=0).max() * 1.1])
Expand Down Expand Up @@ -807,6 +808,10 @@ def plot_co2_shadow_price(file_list: list, config: dict, fig_name=None):
fig.savefig(fig_name, transparent=config["transparent"])


def plot_investments(file_list: list, config: dict, fig_name=None, ax: object = None):
pass


# TODO move to a separate rule
def write_data(data_paths: dict, outp_dir: os.PathLike):
"""Write some selected data
Expand Down Expand Up @@ -856,20 +861,9 @@ def write_data(data_paths: dict, outp_dir: os.PathLike):
"plot_summary",
topology="current+FCG",
# co2_pathway="exp175default",
co2_pathway="SSP2-PkBudg1000-freeze",
co2_pathway="SSP2-PkBudg1000-CHA-pypsaelh2",
heating_demand="positive",
configfiles=["resources/tmp/remind_coupled.yaml"],
planning_horizons=[
2020,
2025,
2030,
# 2035,
# 2040,
# 2045,
# 2050,
# 2055,
# 2060,
],
configfiles=["resources/tmp/remind_coupled_cg.yaml"],
)

configure_logging(snakemake)
Expand Down Expand Up @@ -920,8 +914,8 @@ def write_data(data_paths: dict, outp_dir: os.PathLike):
"battery",
"coal",
"coal-CCS",
"CCGT",
"OCGT",
"gas CCGT",
"gas OCGT",
"CCGT-CCS",
"H2 Electrolysis",
],
Expand Down
2 changes: 1 addition & 1 deletion workflow/scripts/plot_time_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ def plot_price_heatmap(
co2_pathway="SSP2-PkBudg1000-CHA-pypsaelh2",
heating_demand="positive",
configfiles=["resources/tmp/remind_coupled_cg.yaml"],
planning_horizons="2035",
planning_horizons="2050",
winter_day1="12-10 21:00", # mm-dd HH:MM
winter_day2="12-17 12:00", # mm-dd HH:MM
spring_day1="03-31 21:00", # mm-dd HH:MM
Expand Down
Loading