Skip to content

Commit

Permalink
add debug logging evaluations in dask loop (#57)
Browse files Browse the repository at this point in the history
Signed-off-by: Grossberger Lukas (CR/PJ-AI-R32) <Lukas.Grossberger@de.bosch.com>
  • Loading branch information
LGro authored Jul 8, 2022
1 parent 84706e1 commit a867caa
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion blackboxopt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "4.4.3"
__version__ = "4.4.4"

from parameterspace import ParameterSpace

Expand Down
23 changes: 12 additions & 11 deletions blackboxopt/optimization_loops/dask_distributed.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit a867caa

Please sign in to comment.