Skip to content

Commit 628218d

Browse files
committed
Generate plots
1 parent b9d2bc4 commit 628218d

32 files changed

+86
-29
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ This folder contains the code and instructions needed to compare Pyoframe's perf
44

55
## Running energy model benchmark locally
66

7-
1. Download the California Test System data. Specifically, place the [load data](https://drive.google.com/file/d/1Sz8st7g4Us6oijy1UYMPUvkA1XeZlIr8/view?usp=drive_link), [generation data](https://drive.google.com/file/d/1CxLlcwAEUy-JvJQdAfVydJ1p9Ecot-4d/view?usp=drive_link), and [line data](https://github.com/staadecker/CATS-CaliforniaTestSystem/blob/master/GIS/CATS_lines.json) in the `/benchmarks/energy_model/data`.
7+
1. Download the California Test System data. Specifically, place the [load data](https://drive.google.com/file/d/1Sz8st7g4Us6oijy1UYMPUvkA1XeZlIr8/view?usp=drive_link), [generation data](https://drive.google.com/file/d/1CxLlcwAEUy-JvJQdAfVydJ1p9Ecot-4d/view?usp=drive_link), and [line data](https://github.com/staadecker/CATS-CaliforniaTestSystem/blob/master/GIS/CATS_lines.json) in the `/benchmarks/energy_planning/data`.

Snakefile renamed to benchmarks/Snakefile

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configfile: "src/benchmarks/config.yaml"
1+
configfile: "config.yaml"
22

33
def generate_all_runs():
44
import itertools
@@ -23,19 +23,29 @@ def generate_all_runs():
2323

2424
rule all:
2525
input:
26-
"src/benchmarks/results.csv"
26+
expand("{problem}/results/{solver}.png", problem=config["problems"], solver=config["solvers"]),
27+
"results.csv"
28+
29+
rule plot_results:
30+
input:
31+
"results.csv"
32+
output:
33+
mem_plot="{problem}/results/memory_{solver}.png",
34+
time_plot="{problem}/results/time_{solver}.png"
35+
script:
36+
"plot_results.py"
2737

2838
rule collect_benchmarks:
2939
input:
30-
[f"src/benchmarks/{problem}/results/{library}_{solver}_{size}.tsv"
40+
[f"{problem}/results/{library}_{solver}_{size}.tsv"
3141
for problem, size, library, solver in generate_all_runs()]
3242
output:
33-
"src/benchmarks/results.csv"
43+
"results.csv"
3444
script:
35-
"src/benchmarks/collect_benchmarks.py"
45+
"collect_benchmarks.py"
3646

3747
rule run_benchmark:
3848
benchmark:
39-
repeat("src/benchmarks/{problem}/results/{library}_{solver}_{size}.tsv", config["repeat"])
49+
repeat("{problem}/results/{library}_{solver}_{size}.tsv", config["repeat"])
4050
shell:
41-
"python src/benchmarks/run_benchmark.py {wildcards.problem} --library {wildcards.library} --solver {wildcards.solver} --size {wildcards.size}"
51+
"python run_benchmark.py {wildcards.problem} --library {wildcards.library} --solver {wildcards.solver} --size {wildcards.size}"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def collect_benchmarks(input_files):
1515
size = name[2]
1616
dfs.append(
1717
pl.read_csv(input_file, separator="\t")
18-
.mean()
18+
.mean() # TODO also compute std(). Maybe at the plotting stage.
1919
.with_columns(
2020
problem=pl.lit(problem),
2121
library=pl.lit(library),
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ from pathlib import Path
55

66
CATS_GITHUB_URL = "https://raw.githubusercontent.com/WISPO-POP/CATS-CaliforniaTestSystem/f260d8bd89e68997bf12d24e767475b2f2b88a77/GIS/"
77

8-
ENERGY_BENCHMARKS = Path("benchmarks/energy_model")
8+
ENERGY_BENCHMARKS = Path("benchmarks/energy_planning")
99
PREPROCESS_DIR = ENERGY_BENCHMARKS / "data/preprocess"
1010
POSTPROCESS_DIR = ENERGY_BENCHMARKS / "data/postprocess"
1111
SCRIPTS_DIR = ENERGY_BENCHMARKS / "scripts"
File renamed without changes.

src/benchmarks/energy_model/scripts/compute_capacity_factors.py.ipynb renamed to benchmarks/energy_planning/scripts/compute_capacity_factors.py.ipynb

File renamed without changes.

0 commit comments

Comments
 (0)