infiniteopt / InfiniteOpt.jl

An intuitive modeling interface for infinite-dimensional optimization problems.
https://infiniteopt.github.io/InfiniteOpt.jl/stable
MIT License
251 stars 17 forks source link

Fix legacy NLP interface #340

Closed pulsipher closed 4 months ago

pulsipher commented 4 months ago

This fixes a bug in the legacy NLP interface that is triggered when a nonlinear measure is in an affine/quadratic expression. Previously, this caused an error in the JuMP interface so InfiniteOpt used a try-catch hack to deal with detecting this case. Now with GenericNonlinearExpr JuMP no longer errors and actually allows mixing of NonlinearExpression and GenericNonlinearExpr (see https://github.com/jump-dev/JuMP.jl/issues/3740).

This PR fixes this bug and makes v0.5 version of InfiniteOpt work with JuMP's legacy interface.

Please note that the current master branch of InfiniteOpt uses JuMP's new nonlinear API and is more performant and less hacky. It will be released with v0.6 once a few more breaking changes are finalized.

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.74%. Comparing base (0961b36) to head (3f84083).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## release-0.5 #340 +/- ## =============================================== - Coverage 99.77% 99.74% -0.03% =============================================== Files 36 36 Lines 7107 7110 +3 =============================================== + Hits 7091 7092 +1 - Misses 16 18 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.