From d4c5c49619a4c23eaa8785467a1b31cffcbb6d82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20P=2E=20D=C3=BCrholt?= Date: Mon, 11 Dec 2023 15:28:55 +0100 Subject: [PATCH] Botorch 0.9.5 (#317) * bump minimal botorch version to 0.9.5 --- bofire/data_models/features/continuous.py | 4 +++- bofire/strategies/samplers/polytope.py | 2 +- setup.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bofire/data_models/features/continuous.py b/bofire/data_models/features/continuous.py index f68aa33ad..eeaad4d43 100644 --- a/bofire/data_models/features/continuous.py +++ b/bofire/data_models/features/continuous.py @@ -65,7 +65,9 @@ def round(self, values: pd.Series) -> pd.Series: allowed_values = np.arange( self.lower_bound, self.upper_bound + self.stepsize, self.stepsize ) - idx = abs(values.values.reshape([3, 1]) - allowed_values).argmin(axis=1) # type: ignore + idx = abs(values.values.reshape([len(values), 1]) - allowed_values).argmin( + axis=1 + ) return pd.Series( data=self.lower_bound + idx * self.stepsize, index=values.index ) diff --git a/bofire/strategies/samplers/polytope.py b/bofire/strategies/samplers/polytope.py index 444db3394..4a720ad33 100644 --- a/bofire/strategies/samplers/polytope.py +++ b/bofire/strategies/samplers/polytope.py @@ -142,7 +142,7 @@ def _ask(self, n: int) -> pd.DataFrame: equality_constraints=combined_eqs if len(combined_eqs) > 0 else None, n_burnin=self.n_burnin, thinning=self.n_thinning, - seed=self.seed, + seed=self.rng.integers(1, 1000), ).squeeze(dim=0) # check that the random generated candidates are not always the same diff --git a/setup.py b/setup.py index 58d23cf94..db8502fbf 100644 --- a/setup.py +++ b/setup.py @@ -42,7 +42,7 @@ ], extras_require={ "optimization": [ - "botorch>=0.9.4", + "botorch>=0.9.5", "multiprocess", "plotly", "formulaic>=0.6.0",