Skip to content

Commit 68c5f0d

Browse files
KristijanFaust-OETsiddharth-krishnajacek-oet
authored
Categorize benchmarks by size in metadata and use in website filters (#99)
**Sources:** Already done runs with a 10 minute timeout: https://github.com/open-energy-transition/solver-benchmark/blob/main/results/benchmark_results.csv Pypsa-eur-* runs with a timeout of aprox. ~18H: [pypsa-eur-benchmark-runs.csv](https://github.com/user-attachments/files/18800075/pypsa-eur-benchmark-runs.csv) All other non benchmarks with an timeout of 2 hours: [rest-of-benchmark-runs.csv](https://github.com/user-attachments/files/18800074/rest-of-benchmark-runs.csv) --------- Co-authored-by: Siddharth Krishna <siddharth-krishna@users.noreply.github.com> Co-authored-by: jacek-oet <jacek.bendig@openenergytransition.org>
1 parent 260f1c5 commit 68c5f0d

File tree

11 files changed

+687
-1079
lines changed

11 files changed

+687
-1079
lines changed

benchmarks/benchmark_config.yaml

Lines changed: 198 additions & 222 deletions
Large diffs are not rendered by default.

benchmarks/merge_metadata.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@
1919
# Dictionary to store unified metadata
2020
unified_metadata = {}
2121

22+
# Size name, category, and URL from benchmark_config.yaml
23+
# TODO this info should be ported to the metadata files under benchmark/<framework>/
24+
with open(benchmarks_dir / "benchmark_config.yaml", "r") as file:
25+
file_contents = yaml.safe_load(file)
26+
size_data = {}
27+
for benchmark_info in file_contents:
28+
size_data[benchmark_info["name"]] = benchmark_info
29+
2230

2331
# Helper function to process a single YAML file
2432
def process_yaml_file(file_path):
@@ -35,8 +43,26 @@ def process_yaml_file(file_path):
3543

3644
for model_name, model_info in benchmark_data.items():
3745
sizes = []
46+
other_data = {s["name"]: s for s in size_data[model_name]["sizes"]}
3847
for size in model_info.get("Sizes", []):
48+
# Hack: get the corresponding entry from benchmark_config.yaml
49+
# Please remove this code and put the info into the metadata files
50+
sp_res = str(size["Spatial resolution"]).split()[0]
51+
tm_res = str(size["Temporal resolution"]).split()[0]
52+
name = f"{sp_res}-{tm_res}"
53+
other_data_entry = other_data.get(name)
54+
if other_data_entry is None:
55+
name += "h"
56+
other_data_entry = other_data.get(name)
57+
if other_data_entry is None:
58+
raise ValueError(
59+
f"Could not find this size of {model_name} in benchmark_config.yaml:\n{size}"
60+
)
61+
3962
size_entry = {
63+
"Name": other_data_entry["name"],
64+
"Size": other_data_entry["size"],
65+
"URL": other_data_entry["url"],
4066
"Spatial resolution": size.get("Spatial resolution"),
4167
"Temporal resolution": size.get("Temporal resolution"),
4268
"N. of constraints": size.get("N. of constraints", None),

0 commit comments

Comments
 (0)