We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a9c45d7 commit 9bf050cCopy full SHA for 9bf050c
climada/util/calibrate/bayesian_optimizer.py
@@ -329,14 +329,16 @@ def _append_improvement(self, target):
329
330
def _is_new_max(self, instance):
331
"""Determine if a guessed value is the new maximum"""
332
- if instance.max is None:
+ instance_max = instance.max
333
+ if not instance_max or instance_max.get("target") is None:
334
# During constrained optimization, there might not be a maximum
335
# value since the optimizer might've not encountered any points
336
# that fulfill the constraints.
337
return False
338
- if instance.max["target"] > self._previous_max:
339
+ if instance_max["target"] > self._previous_max:
340
return True
341
+
342
343
344
def _maybe_stop_early(self, instance):
0 commit comments