Check if the step to log produced a new maximum. Parameters ---------- current_max : dict[str, Any] | None The current maximum target value and its parameters. Returns ------- boolean
(self, current_max: dict[str, Any] | None)
| 203 | return line + "\n" + ("-" * self._header_length) |
| 204 | |
| 205 | def _is_new_max(self, current_max: dict[str, Any] | None) -> bool: |
| 206 | """Check if the step to log produced a new maximum. |
| 207 | |
| 208 | Parameters |
| 209 | ---------- |
| 210 | current_max : dict[str, Any] | None |
| 211 | The current maximum target value and its parameters. |
| 212 | |
| 213 | Returns |
| 214 | ------- |
| 215 | boolean |
| 216 | """ |
| 217 | if current_max is None: |
| 218 | # During constrained optimization, there might not be a maximum |
| 219 | # value since the optimizer might've not encountered any points |
| 220 | # that fulfill the constraints. |
| 221 | return False |
| 222 | if self._previous_max is None: |
| 223 | self._previous_max = current_max["target"] |
| 224 | return current_max["target"] > self._previous_max |
| 225 | |
| 226 | def _update_tracker(self, current_max: dict[str, Any] | None) -> None: |
| 227 | """Update the tracker. |
no outgoing calls