From 9ed66d6408950268ca2cfb1f21e6b7730385398f Mon Sep 17 00:00:00 2001 From: Filippo Airaldi Date: Mon, 17 Jun 2024 16:17:37 +0200 Subject: [PATCH 1/2] small changes to adapt to Python 3.9 --- benchmarking/run.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/benchmarking/run.py b/benchmarking/run.py index 2bba752..d9cfb56 100644 --- a/benchmarking/run.py +++ b/benchmarking/run.py @@ -106,8 +106,8 @@ def run_problem( seed: int, csv: str, device: str, - n_init: int | None = None, - callback: Callable[[SyntheticTestFunction], str] | None = None, + n_init: Optional[int] = None, + callback: Optional[Callable[[SyntheticTestFunction], str]] = None, ) -> None: """Solves the given problem with the given method, and writes the results to csv.""" # set hyperparameters @@ -315,9 +315,9 @@ def run_benchmark( seed: int, csv: str, device: str, - n_init: int | None = None, - setup_callback: Callable[[], None] | None = None, - save_callback: Callable[[SyntheticTestFunction], str] | None = None, + n_init: Optional[int] = None, + setup_callback: Optional[Callable[[], None]] = None, + save_callback: Optional[Callable[[SyntheticTestFunction], str]] = None, ) -> None: """Sets default values and then runs the given benchmarks""" filterwarnings("ignore", "Optimization failed", module="botorch") @@ -348,9 +348,9 @@ def run_benchmarks( n_jobs: int, csv: str, devices: list[torch.device], - n_init: int | None = None, - setup_callback: Callable[[], None] | None = None, - save_callback: Callable[[SyntheticTestFunction], str] | None = None, + n_init: Optional[int] = None, + setup_callback: Optional[Callable[[], None]] = None, + save_callback: Optional[Callable[[SyntheticTestFunction], str]] = None, ) -> None: """Runs the benchmarks for the given problems, methods and horizons, repeated per the number of trials, distributively across the given devices.""" From 83ea1c1e47d8fb289435c951861e7a5844e86754 Mon Sep 17 00:00:00 2001 From: Filippo Airaldi Date: Mon, 17 Jun 2024 16:21:04 +0200 Subject: [PATCH 2/2] fixed requirements to improve reproducibility --- benchmarking/requirements-benchmarking.txt | 10 +++++----- mpc-tuning/requirements-mpc-tuning.txt | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/benchmarking/requirements-benchmarking.txt b/benchmarking/requirements-benchmarking.txt index 31bd947..05019f9 100644 --- a/benchmarking/requirements-benchmarking.txt +++ b/benchmarking/requirements-benchmarking.txt @@ -1,10 +1,10 @@ torch==2.1.2 botorch==0.9.5 -matplotlib>=3.7.1 -numpy>=1.24.4 -pandas>=2.1.0 -scipy>=1.11.0 +matplotlib==3.9.0 +numpy==1.24.4 +pandas==2.1.0 +scipy==1.11.0 joblib==1.3.2 globopt==1.0.0 gpytorch==1.11 -prettytable>=3.8.0 +prettytable==3.10.0 diff --git a/mpc-tuning/requirements-mpc-tuning.txt b/mpc-tuning/requirements-mpc-tuning.txt index 76e8ded..05c5dcd 100644 --- a/mpc-tuning/requirements-mpc-tuning.txt +++ b/mpc-tuning/requirements-mpc-tuning.txt @@ -3,11 +3,11 @@ mpcrl==1.2.0rc4 torch==2.1.2 botorch==0.9.5 gymnasium==0.29.1 -matplotlib>=3.7.1 -numpy>=1.24.4 -pandas>=2.1.0 -scipy>=1.11.0 +matplotlib==3.9.0 +numpy==1.24.4 +pandas==2.1.0 +scipy==1.11.0 joblib==1.3.2 globopt==1.0.0 gpytorch==1.11 -prettytable>=3.8.0 +prettytable==3.10.0