Skip to content

Allow default and custom messages in derived classes from PyomoException #3596

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

Merged
merged 15 commits into from
Jun 23, 2025

Conversation

michaelbynum
Copy link
Contributor

Summary/Motivation:

The new direct interface to Gurobi attempts to pass a custom message to IncompatibleModelError here:

raise IncompatibleModelError(
. However, that exception does not currently except custom messages. This PR enables custom messages.

Legal Acknowledgement

By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@mrmundt mrmundt self-requested a review May 29, 2025 20:29
@blnicho blnicho requested a review from jsiirola June 3, 2025 19:54
@mrmundt
Copy link
Contributor

mrmundt commented Jun 17, 2025

Per discussion today, we are just going to put this new functionality directly into PyomoException rather than making a new class for it. I'll work on that.

@mrmundt mrmundt changed the title Allow custom messages in IncompatibleModelError Allow default and custom messages in derived classes from PyomoException Jun 18, 2025
@jsiirola jsiirola merged commit e4c0ec0 into Pyomo:main Jun 23, 2025
52 of 65 checks passed
@blnicho blnicho moved this from Todo to Done in July 2025 Release Jun 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants