rl-institut / oemof-B3

An open-source energy system model for Brandenburg/Berlin.
https://oemof-b3.readthedocs.io/
GNU Affero General Public License v3.0
9 stars 5 forks source link

snakemake -j1 plot_conv_pp_scalars raises color error #328

Closed Stefanie08 closed 12 months ago

Stefanie08 commented 1 year ago

If the rule snakmake -j1 plot_conv_pp_scalars is run, following error message is raised:

INFO -
Traceback (most recent call last):
  File "scripts/plot_conv_pp_scalars.py", line 170, in <module>
    plot_grouped_bar(ax, df_pivot, COLORS, UNIT)
  File "scripts/plot_conv_pp_scalars.py", line 122, in plot_grouped_bar
    color=[color_dict[key] for key in df.columns],
  File "scripts/plot_conv_pp_scalars.py", line 122, in <listcomp>
    color=[color_dict[key] for key in df.columns],
KeyError: 'biomass'

Upon checking the line 170 of plot_conv_pp_scalars.py, following note was found:

 fig, ax = plt.subplots(figsize=(12, 6))

    # TODO: Check if oemoflex' function can be imported and used here
    plot_grouped_bar(ax, df_pivot, COLORS, UNIT)

Performing the test might solve the above mentioned problem.