[Feature Request] Customised Error for infeasible problem #2631
Open
Description
🚀 Feature Request
Replace the general ValueError
with a custom error, when infeasible point is found.
Motivation
We are calling the get_polytope_samples()
function and would like to catch the error caused by infeasibility. Currently, infeasible case would raise a ValueError
, see the code snippet below from find_interior_point()
if result.status == 2:
raise ValueError(
"No feasible point found. Constraint polytope appears empty. "
+ "Check your constraints."
)
elif result.status > 0:
raise ValueError(
"Problem checking constraint specification. "
+ f"linprog status: {result.message}"
)
To differentiate ValueErrors
arising from various causes, it would be beneficial to assign a specific custom error, such as InfeasibleProblemError
, for scenarios where no feasible point is found.