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

Added type info in NL error message #1872

Merged
merged 4 commits into from
Feb 19, 2019
Merged

Conversation

coreysharris
Copy link
Contributor

Type checking for parsing nonlinear expression was missng the GenericAffExpr case. Also added type information to the catch-all error.

Copy link
Member

@odow odow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

src/parse_nlp.jl Outdated
function _parse_NL_expr_runtime(m::Model, x::GenericAffExpr, tape, parent, values)
error("Unexpected affine expression $x in nonlinear expression. " *
"Affine expressions (e.g., created using @expression) and " *
"nonlinear expression cannot be mixed.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: nonlinear expressions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed... fixed.

test/nlp.jl Outdated
"Affine expressions (e.g., created using @expression) and " *
"nonlinear expressions cannot be mixed."
)
@test_throws expected_exception @NLexpression(m, A)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

m should be model (also below)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in both places

@mlubin mlubin merged commit fbc5c80 into jump-dev:master Feb 19, 2019
@mlubin
Copy link
Member

mlubin commented Feb 19, 2019

Thanks!

@blegat blegat added the Backports: 0.19 Change should be backported to release-0.19 label May 10, 2019
mlubin pushed a commit that referenced this pull request May 12, 2019
* Added type info in NL error message

* Fix typo (twice)

* Add tests for errors when using Aff/Quadx in NLexpressions

* Fix typo
@mlubin mlubin removed the Backports: 0.19 Change should be backported to release-0.19 label May 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants