Apply suggestions from Martha's code review

Co-authored-by: Martha Frysztacki <martha.frysztacki@kit.edu>
This commit is contained in:
Seth 2022-03-28 12:10:51 +02:00 committed by GitHub
parent 3c5212826e
commit e45c7a65ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -181,7 +181,7 @@ def plot_map(n, ax=None, attribute='p_nom', opts={}):
return fig return fig
def plot_total_energy_pie(n, ax=None, opts={}): def plot_total_energy_pie(n, opts, ax=None):
if ax is None: ax = plt.gca() if ax is None: ax = plt.gca()
ax.set_title('Energy per technology', fontdict=dict(fontsize="medium")) ax.set_title('Energy per technology', fontdict=dict(fontsize="medium"))
@ -199,7 +199,7 @@ def plot_total_energy_pie(n, ax=None, opts={}):
t1.remove() t1.remove()
t2.remove() t2.remove()
def plot_total_cost_bar(n, ax=None, opts={}): def plot_total_cost_bar(n, opts, ax=None):
if ax is None: ax = plt.gca() if ax is None: ax = plt.gca()
total_load = (n.snapshot_weightings.generators * n.loads_t.p.sum(axis=1)).sum() total_load = (n.snapshot_weightings.generators * n.loads_t.p.sum(axis=1)).sum()
@ -258,13 +258,7 @@ if __name__ == "__main__":
set_plot_style() set_plot_style()
paths, config, wildcards, logs, out = ( config, wildcards = snakemake.config, snakemake.wildcards
snakemake.input,
snakemake.config,
snakemake.wildcards,
snakemake.log,
snakemake.output,
)
map_figsize = config["plotting"]['map']['figsize'] map_figsize = config["plotting"]['map']['figsize']
map_boundaries = config["plotting"]['map']['boundaries'] map_boundaries = config["plotting"]['map']['boundaries']