Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Customised Error for infeasible problem #2631

Open
Waschenbacher opened this issue Nov 16, 2024 · 1 comment
Open

[Feature Request] Customised Error for infeasible problem #2631

Waschenbacher opened this issue Nov 16, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@Waschenbacher
Copy link

🚀 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.

@Waschenbacher Waschenbacher added the enhancement New feature or request label Nov 16, 2024
@Balandat
Copy link
Contributor

Balandat commented Nov 17, 2024

That makes a lot of sense; I'd be happy to include such a change. Would you be willing to put up a PR for this?

There are probably a few other places where we could use such an error, e.g. here and here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants