Merge pull request #1098 from bobbyxng/plot_summary_fix

Bug-fix: plot_summary script generating empty pdfs.
This commit is contained in:
lisazeyen 2024-06-11 15:51:27 +02:00 committed by GitHub
commit f2014c231a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 6 deletions

View File

@ -73,7 +73,7 @@ if config["foresight"] == "perfect":
rule all: rule all:
input: input:
expand(RESULTS + "graphs/costs.pdf", run=config["run"]["name"]), expand(RESULTS + "graphs/costs.svg", run=config["run"]["name"]),
default_target: True default_target: True

View File

@ -233,9 +233,9 @@ rule plot_summary:
eurostat="data/eurostat/Balances-April2023", eurostat="data/eurostat/Balances-April2023",
co2="data/bundle/eea/UNFCCC_v23.csv", co2="data/bundle/eea/UNFCCC_v23.csv",
output: output:
costs=RESULTS + "graphs/costs.pdf", costs=RESULTS + "graphs/costs.svg",
energy=RESULTS + "graphs/energy.pdf", energy=RESULTS + "graphs/energy.svg",
balances=RESULTS + "graphs/balances-energy.pdf", balances=RESULTS + "graphs/balances-energy.svg",
threads: 2 threads: 2
resources: resources:
mem_mb=10000, mem_mb=10000,

View File

@ -353,7 +353,7 @@ def plot_balances():
frameon=False, frameon=False,
) )
fig.savefig(snakemake.output.balances[:-10] + k + ".pdf", bbox_inches="tight") fig.savefig(snakemake.output.balances[:-10] + k + ".svg", bbox_inches="tight")
def historical_emissions(countries): def historical_emissions(countries):
@ -563,7 +563,7 @@ def plot_carbon_budget_distribution(input_eurostat, options):
) )
plt.grid(axis="y") plt.grid(axis="y")
path = snakemake.output.balances.split("balances")[0] + "carbon_budget.pdf" path = snakemake.output.balances.split("balances")[0] + "carbon_budget.svg"
plt.savefig(path, bbox_inches="tight") plt.savefig(path, bbox_inches="tight")