Skip to content

Commit

Permalink
process checks lower and upper bound of objective values at finalization
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasWeise committed Oct 17, 2024
1 parent 5eaa636 commit d8cc11d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions moptipy/api/_process_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,8 +535,15 @@ def _validate_best_f(self) -> None:
f"{self._current_best_f}!") # noqa
if not isfinite(ff):
raise ValueError( # noqa
f"Reproduced the objective value {ff} of the best "
"solution, but it is not finite?") # noqa
f"The objective value {ff} of " # noqa
"the best solution is not finite?")
lb: Final[int | float] = self.__objective.lower_bound()
ub: Final[int | float] = self.__objective.upper_bound()
if not (lb <= ff <= ub):
raise ValueError( # noqa
f"The objective value {ff} of " # noqa
"the best solution is not within the lower and "
f"upper bound, i.e., [{lb}, {ub}]?") # noqa

def has_log(self) -> bool:
"""
Expand Down
2 changes: 1 addition & 1 deletion moptipy/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
from typing import Final

#: the version string of `moptipy`
__version__: Final[str] = "0.9.127"
__version__: Final[str] = "0.9.128"

0 comments on commit d8cc11d

Please sign in to comment.