remove hardcoded config overwrite
plot_validation: adjust carrier labels
This commit is contained in:
parent
9fbc626862
commit
86a4b775fd
@ -19,8 +19,6 @@ if not exists("config/config.yaml"):
|
|||||||
|
|
||||||
|
|
||||||
configfile: "config/config.yaml"
|
configfile: "config/config.yaml"
|
||||||
configfile: "config/config.validation.yaml"
|
|
||||||
configfile: "config/test/config.validation.yaml"
|
|
||||||
|
|
||||||
|
|
||||||
COSTS = f"data/costs_{config['costs']['year']}.csv"
|
COSTS = f"data/costs_{config['costs']['year']}.csv"
|
||||||
|
@ -36,7 +36,7 @@ if __name__ == "__main__":
|
|||||||
# %%
|
# %%
|
||||||
|
|
||||||
def rename_index(ds):
|
def rename_index(ds):
|
||||||
specific = ds.index.map(lambda x: f"{x[1]}\n({x[0].lower()})")
|
specific = ds.index.map(lambda x: f"{x[1]}\n({x[0]})")
|
||||||
generic = ds.index.get_level_values("carrier")
|
generic = ds.index.get_level_values("carrier")
|
||||||
duplicated = generic.duplicated(keep=False)
|
duplicated = generic.duplicated(keep=False)
|
||||||
index = specific.where(duplicated, generic)
|
index = specific.where(duplicated, generic)
|
||||||
|
@ -28,9 +28,9 @@ if __name__ == "__main__":
|
|||||||
from _helpers import mock_snakemake
|
from _helpers import mock_snakemake
|
||||||
|
|
||||||
snakemake = mock_snakemake(
|
snakemake = mock_snakemake(
|
||||||
"plot_electricity_production",
|
"plot_validation_electricity_production",
|
||||||
simpl="",
|
simpl="",
|
||||||
opts="Ept-12h",
|
opts="Ept",
|
||||||
clusters="37",
|
clusters="37",
|
||||||
ll="v1.0",
|
ll="v1.0",
|
||||||
)
|
)
|
||||||
@ -69,7 +69,7 @@ if __name__ == "__main__":
|
|||||||
data.columns.names = ["Kind", "Country", "Carrier"]
|
data.columns.names = ["Kind", "Country", "Carrier"]
|
||||||
data = data.mul(n.snapshot_weightings.generators, axis=0)
|
data = data.mul(n.snapshot_weightings.generators, axis=0)
|
||||||
|
|
||||||
# %% total production per carrier
|
# total production per carrier
|
||||||
fig, ax = plt.subplots(figsize=(6, 6))
|
fig, ax = plt.subplots(figsize=(6, 6))
|
||||||
|
|
||||||
df = data.groupby(level=["Kind", "Carrier"], axis=1).sum().sum().unstack().T
|
df = data.groupby(level=["Kind", "Carrier"], axis=1).sum().sum().unstack().T
|
||||||
@ -78,7 +78,7 @@ if __name__ == "__main__":
|
|||||||
ax.grid(axis="y")
|
ax.grid(axis="y")
|
||||||
fig.savefig(snakemake.output.production_bar, bbox_inches="tight")
|
fig.savefig(snakemake.output.production_bar, bbox_inches="tight")
|
||||||
|
|
||||||
# %% highest diffs
|
# highest diffs
|
||||||
|
|
||||||
fig, ax = plt.subplots(figsize=(6, 10))
|
fig, ax = plt.subplots(figsize=(6, 10))
|
||||||
|
|
||||||
@ -94,7 +94,7 @@ if __name__ == "__main__":
|
|||||||
ax.grid(axis="y")
|
ax.grid(axis="y")
|
||||||
fig.savefig(snakemake.output.production_deviation_bar, bbox_inches="tight")
|
fig.savefig(snakemake.output.production_deviation_bar, bbox_inches="tight")
|
||||||
|
|
||||||
# %% seasonal operation
|
# seasonal operation
|
||||||
|
|
||||||
fig, axes = plt.subplots(3, 1, figsize=(9, 9))
|
fig, axes = plt.subplots(3, 1, figsize=(9, 9))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user