Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
420 changes: 198 additions & 222 deletions benchmarks/benchmark_config.yaml

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions benchmarks/merge_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@
# Dictionary to store unified metadata
unified_metadata = {}

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


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

for model_name, model_info in benchmark_data.items():
sizes = []
other_data = {s["name"]: s for s in size_data[model_name]["sizes"]}
for size in model_info.get("Sizes", []):
# Hack: get the corresponding entry from benchmark_config.yaml
# Please remove this code and put the info into the metadata files
sp_res = str(size["Spatial resolution"]).split()[0]
tm_res = str(size["Temporal resolution"]).split()[0]
name = f"{sp_res}-{tm_res}"
other_data_entry = other_data.get(name)
if other_data_entry is None:
name += "h"
other_data_entry = other_data.get(name)
if other_data_entry is None:
raise ValueError(
f"Could not find this size of {model_name} in benchmark_config.yaml:\n{size}"
)

size_entry = {
"Name": other_data_entry["name"],
"Size": other_data_entry["size"],
"URL": other_data_entry["url"],
"Spatial resolution": size.get("Spatial resolution"),
"Temporal resolution": size.get("Temporal resolution"),
"N. of constraints": size.get("N. of constraints", None),
Expand Down
Loading
Loading