From a867caa0b03a2b15e40c6639775baf2a342d6aad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Gro=C3=9Fberger?= Date: Fri, 8 Jul 2022 15:19:08 +0200 Subject: [PATCH] add debug logging evaluations in dask loop (#57) Signed-off-by: Grossberger Lukas (CR/PJ-AI-R32) --- blackboxopt/__init__.py | 2 +- .../optimization_loops/dask_distributed.py | 23 ++++++++++--------- pyproject.toml | 2 +- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/blackboxopt/__init__.py b/blackboxopt/__init__.py index 3bd57ec7..a28dbfd5 100644 --- a/blackboxopt/__init__.py +++ b/blackboxopt/__init__.py @@ -1,4 +1,4 @@ -__version__ = "4.4.3" +__version__ = "4.4.4" from parameterspace import ParameterSpace diff --git a/blackboxopt/optimization_loops/dask_distributed.py b/blackboxopt/optimization_loops/dask_distributed.py index 6630cfae..41a8fc47 100644 --- a/blackboxopt/optimization_loops/dask_distributed.py +++ b/blackboxopt/optimization_loops/dask_distributed.py @@ -76,24 +76,25 @@ def check_for_results(self, timeout_s: float = 5.0) -> List[Evaluation]: self._not_done_futures, timeout=timeout_s, return_when="FIRST_COMPLETED" ) - return_values: List[Evaluation] = [] + evaluations: List[Evaluation] = [] for f in all_futures.done: if f.status == "error": - return_values.append( - Evaluation( - objectives={o.name: None for o in self.objectives}, - stacktrace=str(f.traceback()), - **f.bbo_eval_spec - ) + evaluation = Evaluation( + objectives={o.name: None for o in self.objectives}, + stacktrace=str(f.traceback()), + **f.bbo_eval_spec ) else: - return_values.append(f.result()) + evaluation = f.result() + + self.logger.debug(evaluation.__dict__) + evaluations.append(evaluation) self._not_done_futures = all_futures.not_done - except dd.TimeoutError: - return_values = [] + return evaluations - return return_values + except dd.TimeoutError: + return [] def run_optimization_loop( diff --git a/pyproject.toml b/pyproject.toml index a1f7a31e..adad6fa5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "blackboxopt" -version = "4.4.3" +version = "4.4.4" description = "A common interface for blackbox optimization algorithms along with useful helpers like parallel optimization loops, analysis and visualization scripts." readme = "README.md" repository = "https://github.com/boschresearch/blackboxopt"