From e5a4e17a49b0d1a0f1f4c9473f6e1f9f696069fe Mon Sep 17 00:00:00 2001 From: Yuichi Motoyama Date: Wed, 21 Aug 2024 11:13:26 +0900 Subject: [PATCH 1/3] change version number (2.1-dev) --- physbo/__init__.py | 2 +- setup.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/physbo/__init__.py b/physbo/__init__.py index b1435725..b3512ca9 100644 --- a/physbo/__init__.py +++ b/physbo/__init__.py @@ -14,4 +14,4 @@ from .predictor import base_predictor from .variable import variable -__version__ = "2.0.1" +__version__ = "2.1-dev" diff --git a/setup.cfg b/setup.cfg index 7339eaf6..0a58bc54 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = physbo -version = 2.0.1 +version = 2.1.dev1 description = optimization tool for PHYSics based on Bayesian Optimization long_description = file: README.md long_description_content_type = text/markdown From 2a033370125f2f165c9e4a9b1f85ef6bf5a5dd22 Mon Sep 17 00:00:00 2001 From: Yuichi Motoyama Date: Fri, 30 Aug 2024 15:23:25 +0900 Subject: [PATCH 2/3] fixed policy.load for MPI mode --- physbo/search/discrete/policy.py | 8 +++++++- physbo/search/discrete_multi/policy.py | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/physbo/search/discrete/policy.py b/physbo/search/discrete/policy.py index 27d72d7e..250f59b7 100644 --- a/physbo/search/discrete/policy.py +++ b/physbo/search/discrete/policy.py @@ -694,7 +694,13 @@ def load(self, file_history, file_training=None, file_predictor=None): self.predictor = pickle.load(f) N = self.history.total_num_search - self.actions = self._delete_actions(self.history.chosen_actions[:N]) + + visited = self.history.chosen_actions[:N] + local_index = np.searchsorted(self.actions, visited) + local_index = local_index[ + np.take(self.actions, local_index, mode="clip") == visited + ] + self.actions = self._delete_actions(local_index) def export_predictor(self): """ diff --git a/physbo/search/discrete_multi/policy.py b/physbo/search/discrete_multi/policy.py index 40cc35a7..877201f4 100644 --- a/physbo/search/discrete_multi/policy.py +++ b/physbo/search/discrete_multi/policy.py @@ -490,7 +490,13 @@ def load(self, file_history, file_training_list=None, file_predictor_list=None): self.load_predictor_list(file_predictor_list) N = self.history.total_num_search - self.actions = self._delete_actions(self.history.chosen_actions[:N]) + + visited = self.history.chosen_actions[:N] + local_index = np.searchsorted(self.actions, visited) + local_index = local_index[ + np.take(self.actions, local_index, mode="clip") == visited + ] + self.actions = self._delete_actions(local_index) def save_predictor_list(self, file_name): with open(file_name, "wb") as f: From cfad27f31211e79bcc2e0da9f49e4c296d046c58 Mon Sep 17 00:00:00 2001 From: Yuichi Motoyama Date: Fri, 30 Aug 2024 13:43:12 +0900 Subject: [PATCH 3/3] update pyproject --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8b498e8f..acb682d8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["setuptools", "wheel", "cython", "numpy<1.20; python_version<'3.10'", "numpy; python_version>='3.10'"] +requires = ["setuptools", "wheel", "cython", "numpy<2.0"] build-backend = "setuptools.build_meta"