We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ca623bc commit 6b7c47eCopy full SHA for 6b7c47e
1 file changed
src/hyperactive/opt/_common.py
@@ -1,5 +1,7 @@
1
"""Common functions used by multiple optimizers."""
2
3
+import warnings
4
+
5
__all__ = ["_score_params"]
6
7
@@ -14,7 +16,11 @@ def _score_params(params, meta):
14
16
error_score = meta["error_score"]
15
17
18
try:
- return float(experiment(**params))
- except Exception: # noqa: B904
19
- # Catch all exceptions and assign error_score
20
- return error_score
+ return float(experiment(params))
+ except Exception as e:
21
+ warnings.warn(
22
+ f"Experiment raised {type(e).__name__}: {e}. "
23
+ f"Assigning error_score={error_score}.",
24
+ stacklevel=2,
25
+ )
26
+ return float(error_score)
0 commit comments