Commit 318d07c1 authored by Jorn Baayen's avatar Jorn Baayen

GoalProgrammingMixin: Guard against nonpositive function nominals.

parent 1e04cea8
......@@ -582,6 +582,9 @@ class GoalProgrammingMixin(OptimizationProblem):
if not np.isfinite(goal.function_range[0]) or not np.isfinite(goal.function_range[1]):
raise Exception("No function range specified for goal {}".format(goal))
if goal.function_nominal <= 0:
raise Exception("Nonpositive nominal value specified for goal {}".format(goal))
if goal.target_min:
if isinstance(goal.target_min, Timeseries):
if np.any(np.isfinite(goal.target_min.values)) and np.any(np.isnan(goal.target_min.values)):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment