Skip to content

Commit 27e7215

Browse files
Runner: use metadata file as input, remove benchmark_config.yaml (#126)
This PR fixes #117: - Updates `runner/run_benchmarks.py` to use a metadata file (e.g. `results/metadata.yaml`) as input instead of the special `benchmarks_config.yaml` - Deletes `benchmarks_config.yaml` - Adds the info (e.g. URL) from `benchmarks_config.yaml` into the individual metadata files - Adds a CI check that `results/metadata.yaml` contains the merged metadata of all metadata files under `benchmarks/`
1 parent 72c0575 commit 27e7215

File tree

16 files changed

+376
-626
lines changed

16 files changed

+376
-626
lines changed

.github/workflows/ci.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,17 @@ jobs:
3333
pre-commit install
3434
pre-commit run --all-files
3535
36+
- name: Check benchmark metadata
37+
run: |
38+
python benchmarks/merge_metadata.py
39+
if git diff --quiet; then
40+
echo "git diff is empty, metadata must be up to date"
41+
else
42+
git diff
43+
printf "ERROR: git diff non empty, metadata needs updating, please run the following command:\npython benchmarks/merge_metadata.py"
44+
exit 1
45+
fi
46+
3647
- name: Run Streamlit App Action
3748
uses: streamlit/streamlit-app-action@v0.0.3
3849
with:
@@ -48,7 +59,7 @@ jobs:
4859
- name: Run sample benchmarks
4960
shell: bash -el {0}
5061
run: |
51-
./runner/benchmark_all.sh -y "tests" benchmarks/tests.yaml
62+
./runner/benchmark_all.sh -y "tests" tests/sample_benchmarks_metadata.yaml
5263
echo ""
5364
cat results/benchmark_results.csv
5465
if awk -F',' 'NR>1 {if ($6 != "ok") exit 1}' results/benchmark_results.csv; then

benchmarks/benchmark_config.yaml

Lines changed: 0 additions & 450 deletions
This file was deleted.

benchmarks/genx-extended/Metadata.yaml

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ genx-15-zones_elec_trex:
88
Time horizon: Single period (1 year)
99
MILP features:
1010
Sizes:
11-
- Temporal resolution: 168
11+
- Name: 15-168h
12+
Size: R
13+
URL: https://storage.googleapis.com/solver-benchmarks/genx-15-zones_elec_trex.lp
14+
Temporal resolution: 168
1215
Spatial resolution: 15
1316
N. of constraints: 11832658
1417
N. of continuous variables: 13777226
1518
N. of integer variables:
1619
N. of binary variables:
17-
1820
genx-15-zones_elec_trex_co2:
1921
Short description: This is a one-year example which contains 15 zones. This example includes transmission expansion, a CO2 emissions constraint.
2022
Model name: GenX
@@ -25,13 +27,15 @@ genx-15-zones_elec_trex_co2:
2527
Time horizon: Single period (1 year)
2628
MILP features:
2729
Sizes:
28-
- Temporal resolution: 168
30+
- Name: 15-168h
31+
Size: R
32+
URL: https://storage.googleapis.com/solver-benchmarks/genx-15-zones_elec_trex_co2.lp
33+
Temporal resolution: 168
2934
Spatial resolution: 15
3035
N. of constraints: 5051253
3136
N. of continuous variables: 4573584
3237
N. of integer variables:
3338
N. of binary variables:
34-
3539
genx-15-zones_elec_trex_co2_uc:
3640
Short description: This is a one-year example which contains 15 zones. This example includes transmission expansion, a CO2 emissions constraint and unit commitment for conventional generators.
3741
Model name: GenX
@@ -42,13 +46,15 @@ genx-15-zones_elec_trex_co2_uc:
4246
Time horizon: Single period (1 year)
4347
MILP features: Unit commitment
4448
Sizes:
45-
- Temporal resolution: 168
49+
- Name: 15-168h
50+
Size: R
51+
URL: https://storage.googleapis.com/solver-benchmarks/genx-15-zones_elec_trex_co2_uc.lp
52+
Temporal resolution: 168
4653
Spatial resolution: 15
4754
N. of constraints: 20128499
4855
N. of continuous variables: 13897939
4956
N. of integer variables: 3417368
5057
N. of binary variables: 120960
51-
5258
genx-15-zones_elec_trex_uc:
5359
Short description: This is a one-year example which contains 15 zones. This example includes transmission expansion and unit commitment for conventional generators.
5460
Model name: GenX
@@ -59,13 +65,15 @@ genx-15-zones_elec_trex_uc:
5965
Time horizon: Single period (1 year)
6066
MILP features: Unit commitment
6167
Sizes:
62-
- Temporal resolution: 168
68+
- Name: 15-168h
69+
Size: R
70+
URL: https://storage.googleapis.com/solver-benchmarks/genx-15-zones_elec_trex_uc.lp
71+
Temporal resolution: 168
6372
Spatial resolution: 15
6473
N. of constraints: 20128499
6574
N. of continuous variables: 13897939
6675
N. of integer variables: 3417368
6776
N. of binary variables: 120960
68-
6977
genx-15-zones_elec_co2:
7078
Short description: This is a one-year example which contains 15 zones. This example includes a CO2 emissions constraint.
7179
Model name: GenX
@@ -76,13 +84,15 @@ genx-15-zones_elec_co2:
7684
Time horizon: Single period (1 year)
7785
MILP features: Unit commitment
7886
Sizes:
79-
- Temporal resolution: 168
87+
- Name: 15-168h
88+
Size: R
89+
URL: https://storage.googleapis.com/solver-benchmarks/genx_15-zones_elec_co2.lp
90+
Temporal resolution: 168
8091
Spatial resolution: 15
8192
N. of constraints: 11832633
8293
N. of continuous variables: 13777201
8394
N. of integer variables:
8495
N. of binary variables:
85-
8696
genx-15-zones_elec_co2_uc:
8797
Short description: This is a one-year example which contains 15 zones. This example includes a CO2 emissions constraint and unit commitment for conventional generators.
8898
Model name: GenX
@@ -93,13 +103,15 @@ genx-15-zones_elec_co2_uc:
93103
Time horizon: Single period (1 year)
94104
MILP features: Unit commitment
95105
Sizes:
96-
- Temporal resolution: 168
106+
- Name: 15-168h
107+
Size: R
108+
URL: https://storage.googleapis.com/solver-benchmarks/genx-15-zones_elec_co2_uc.lp
109+
Temporal resolution: 168
97110
Spatial resolution: 15
98111
N. of constraints: 20128473
99112
N. of continuous variables: 13897913
100113
N. of integer variables: 3417368
101114
N. of binary variables: 120960
102-
103115
genx-15-zones_elec_uc:
104116
Short description: This is a one-year example which contains 15 zones. This example includes unit commitment for conventional generators.
105117
Model name: GenX
@@ -110,7 +122,10 @@ genx-15-zones_elec_uc:
110122
Time horizon: Single period (1 year)
111123
MILP features: Unit commitment
112124
Sizes:
113-
- Temporal resolution: 168
125+
- Name: 15-168h
126+
Size: R
127+
URL: https://storage.googleapis.com/solver-benchmarks/genx-15-zones_elec_uc.lp
128+
Temporal resolution: 168
114129
Spatial resolution: 15
115130
N. of constraints: 20128472
116131
N. of continuous variables: 13897912

0 commit comments

Comments
 (0)