Generalize the benchmarking framework at country level#543
Conversation
Conflicts: doc/release_notes.rst
Co-authored-by: Daniel Rüdt <[email protected]>
Conflicts: scripts/_helpers.py
Conflicts: scripts/_helpers.py
…p_report_benchmakr
Conflicts: config/benchmarking.default.yaml rules/sb.smk scripts/sb/clean_tyndp_output_benchmark.py scripts/sb/clean_tyndp_report_benchmark.py scripts/sb/make_benchmark.py scripts/sb/plot_benchmark.py
| ax.bar_label(c, fmt="%.0f", padding=3, fontsize=8) | ||
| ax.bar_label( | ||
| c, | ||
| fmt=lambda x: f"{x:.1f}" if 0 < abs(x) < 10 else f"{x:.0f}", |
There was a problem hiding this comment.
it is not good practice to have different rounding in the same plot because it reduces comparability, better to have all numbers in the same format
| fmt=lambda x: f"{x:.1f}" if 0 < abs(x) < 10 else f"{x:.0f}", | |
| fmt=lambda x: f"{x:.1f}", |
There was a problem hiding this comment.
I agree with both sentiments. Maybe you could increase the width of the plot so that the bars are wider giving more room to the figure labels?
There was a problem hiding this comment.
We could also reduce the font or tilt the text
There was a problem hiding this comment.
Good ideas, we can make the figure wider, rotate the text, reduce font size, have different label positions
for i, (bar, val) in enumerate(zip(bars, values)):
offset = 0.05 if i % 2 == 0 else 0.15
ax.text(bar.get_x() + bar.get_width()/2, bar.get_height() + offset,
f'{val:.1f}', ha='center', va='bottom')
I would favour that instead of having different roundings.
There was a problem hiding this comment.
Here is my suggestion: when we have large numbers and / or many sources, the bar labels are rotated.
Any further thoughts? @lisazeyen @daniel-rdt
There was a problem hiding this comment.
To me, this looks much better! Thank you @tgilon! We could even have it always rotated by 90° so it is consistent. But no strong opinion on that.
Co-authored-by: lisazeyen <[email protected]>
lisazeyen
left a comment
There was a problem hiding this comment.
@tgilon thanks for the changes! I think it is nearly ready to be merged, only the merge conflicts need to be resolved and it would be good if we can change the layout of the figure so that we can have one more decimal in the bar plots.
Conflicts:
README.md
config/benchmarking.default.yaml
doc/release_notes.rst

Closes #540.
Changes proposed in this Pull Request
This PR extends the benchmarking framework with a new bus-level and country-level overview. Where data is available, the benchmarks are produced both at EU27-level and at a spatially resolved level for each technology in a table.
The carrier-level tables now report on missing buses/countries (i.e. where a carrier is not defined for a given bus/country). The table-level tables report on missing carriers (i.e. where Open-TYNDP and reference carriers do not match) and the maximum number of missing buses/countries from the underlying carrier data.
Tasks
power_capacitypower_generationhydrogen_supplyhydrogen_demandWorkflow
benchmarking.spatial.by_busandbenchmarking.spatial.by_country, which control whether benchmarking at this level is performedclean_tyndp_output_benchmarkproduces bus-level data where possibleclean_tyndp_report_benchmarkhas been refactored for claritymake_benchmarkandplot_benchmarkalways generateby_busandby_countryoutputs. These outputs are empty if the configuration is disabled.Open issues
Power capacities
Hydrogen demand
Notes
Using the latest produced results (
20260311), we get the following figures and tables. A set of figures has been made available here to make the review easier.Overall overview by countries
Overall overview by bus
Power capacities at country-level
Power capacities at bus-level
Checklist
pixi.toml(usingpixi add <dependency-name>).config/config.default.yaml.doc/configtables/*.csv.config/test/*.yaml.doc/*.rstfiles.doc/release_notes.rstis added.READMEanddoc/index.rst.