From f86436328320dcf5629617b47195537f18bceecf Mon Sep 17 00:00:00 2001 From: Joshua Gould Date: Wed, 28 Jun 2023 13:21:53 -0400 Subject: [PATCH] works with pandas < 2 and pandas 2 --- .github/workflows/tests.yml | 1 + gradient_free_optimizers/optimizers/smb_opt/smbo.py | 2 +- requirements.txt | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1def555..41736f3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -34,6 +34,7 @@ jobs: python -m pip install --upgrade pip python -m pip install surfaces flake8 pytest python -m pip install . + python -m pip install --upgrade pandas # surfaces install pandas < 2 - name: Lint with flake8 run: | diff --git a/gradient_free_optimizers/optimizers/smb_opt/smbo.py b/gradient_free_optimizers/optimizers/smb_opt/smbo.py index fe81a05..8d18feb 100644 --- a/gradient_free_optimizers/optimizers/smb_opt/smbo.py +++ b/gradient_free_optimizers/optimizers/smb_opt/smbo.py @@ -34,7 +34,7 @@ def init_warm_start_smbo(self, search_data): if search_data is not None: # filter out nan and inf warm_start_smbo = search_data[ - ~search_data.isin([np.nan, np.inf, -np.inf]).any(1) + ~search_data.isin([np.nan, np.inf, -np.inf]).any(axis=1) ] # filter out elements that are not in search space diff --git a/requirements.txt b/requirements.txt index 9b71807..2469f71 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ scipy <2.0.0 numpy >=1.18.1, <2.0.0 -pandas <2.0.0 +pandas scikit-learn >=0.21, !=0.23.* tqdm >=4.48.0, <5.0.0 \ No newline at end of file