You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Summary:
<!--
Thank you for sending the PR! We appreciate you spending the time to make BoTorch better.
Help us understand your motivation by explaining why you decided to make this change.
You can learn more about contributing to BoTorch here: https://github.com/pytorch/botorch/blob/main/CONTRIBUTING.md
-->
## Motivation
Add customised error for infeasible problem. Details see #2631
### Have you read the [Contributing Guidelines on pull requests](https://github.com/pytorch/botorch/blob/main/CONTRIBUTING.md#pull-requests)?
Yes.
Pull Request resolved: #2652
Test Plan:
The customised error is tested in a similar way as the other customised errors.
## Related PRs
(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/pytorch/botorch, and link to your PR here.)
Reviewed By: saitcakmak
Differential Revision: D67280696
Pulled By: Balandat
fbshipit-source-id: 581dbe23d304966632c83feb1286071d7fbddade
🚀 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 aValueError
, see the code snippet below fromfind_interior_point()
To differentiate
ValueErrors
arising from various causes, it would be beneficial to assign a specific custom error, such asInfeasibleProblemError
, for scenarios where no feasible point is found.The text was updated successfully, but these errors were encountered: