-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plot scalar results #93
Conversation
Short brainstorm on what plot we may need:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get a MissingInputException in line 343
with the following error message running
snakemake -j1 results/toy-scenario/plotted/scalars
:
Missing input files for rule plot_scalar_results:
results/toy-scenario/postprocessed/scalars.csv
Also, when I run snakemake -j1 results/toy-scenario/postprocessed
, it leads me to AttributeError: 'NoneType' object has no attribute 'is_potentially_variable
:
ERROR: Constructing component 'Transformer.relation_build' from data=None
failed: AttributeError: 'NoneType' object has no attribute
'is_potentially_variable'
Traceback (most recent call last):
File "scripts/optimize.py", line 50, in <module>
m = Model(es)
...
Co-authored-by: MaGering <[email protected]>
…/oemof-B3 into features/plot-scalar-results
Resolved in ec05d1e. Now snakemake should trigger a model run when you try to plot results that have not been created.
Could not reproduce this. Looks like a component of the model is missing some data? |
Running |
You do not install |
Yes, the report fails if some images are missing. This is an open todo (see first post). |
You could install |
I am not sure if that works? Other than oemoflex, pandoc is written in haskell and needs to be compiled. (https://github.com/jgm/pandoc/blob/master/INSTALL.md#getting-the-pandoc-source-code) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jnnr you have asked my feedback concerning the plots. Thank you, first of all, for improving the plots! They already look very nice.
I have tested the plots with scenario base-2050
, toy-scenario ran into an error.
To my mind, my comments are not so urgent that they have to be faced in this PR or for the first release.
scalars:
- I like that for the y-axis a convenient unit seems to be chosen automatically! A bit strange looks the '0 Wh
or
0 W` to my mind. Maybe there's a solution to force 0 to adapt the unit of the next higher value. - It would be useful for readers to add values to the stacked plots. I have added two examples below from Dena-Leitstudie 2021 and Prognos 2021.
- For the model I think B/BB and the heading are quite right, as they are related to input data and output data. However, for reports I think it would be nice to actually write the full region name and remove the heading as this will be separate in a report. My suggestion is to add a second set of plots for reports without heading and with full region names.
- For your information: I only got plots for the electricity bus. I guess plots for the other busses will be added in the future.
dispatch:
snakemake -j1 results/base-2050/plotted/dispatch
gives meValueError: need at least one array to concatenate
inoemoflex/tools/plots.py, line 344, y = np.vstack(y)
Address separately
* all variable costs by region and technology * all storage losses + output by carrier and region (This would need a new functionality: Plotting different var_names together) * Check if and how it can be combined with the plot functions of joined scenarios
Should this be addressed in another PR? Then you could move these points to a new issue.
@SabineHaas: Thanks for your review. I opened a new issue #154 to collect all ideas that are still open. |
Introduces a new rule "plot_scalar_results" that draw scalar result bar plots for single scenarios. You can choose to stack the bars by setting
stacked=True
inplot_grouped_bar
. Needs rl-institut/oemoflex#45To test it, make sure to use the mentioned branch on oemoflex.
snakemake -j1 results/toy-scenario/plotted/scalars
.snakemake -j1 results/toy-scenario/report
.TODO
Address separately