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

[docs] add warning about Y <= X, Set() syntax #3769

Merged
merged 2 commits into from
Jun 9, 2024
Merged

[docs] add warning about Y <= X, Set() syntax #3769

merged 2 commits into from
Jun 9, 2024

Conversation

odow
Copy link
Member

@odow odow commented Jun 5, 2024

x-ref #3766

Copy link

codecov bot commented Jun 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.38%. Comparing base (886a652) to head (99cf38d).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3769   +/-   ##
=======================================
  Coverage   98.38%   98.38%           
=======================================
  Files          44       44           
  Lines        5879     5885    +6     
=======================================
+ Hits         5784     5790    +6     
  Misses         95       95           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

docs/src/manual/constraints.md Outdated Show resolved Hide resolved
docs/src/manual/constraints.md Outdated Show resolved Hide resolved
@@ -1238,8 +1238,9 @@ julia> @constraint(model, x in MOI.ExponentialCone())
## Set inequality syntax

For modeling convenience, the syntax `@constraint(model, x >= y, Set())` is
Copy link
Contributor

Choose a reason for hiding this comment

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

Note that as per https://docs.julialang.org/en/v1/manual/unicode-input/
can be "trivially" inputted as \succeq.

Wouldn't it be possible to:

@constraint(model, x \succeq y)
# error: specify one of the conic sets
@constraint(model, x >= y, <... Some conic set ...>)
# warning: use \succeq instead
@constraint(model, x \succeq y, <... Some non-conic set ...>)
# warning: use >= instead
@constraint(model, x >= y)
# becomes @constraint(model, x - y, Nonnegatives)
@constraint(model, x <= y)
# becomes @constraint(model, x - y, Nonpositives)

Is the concern that someone writes @constraint(model, x >= y) thinking it means PSDCone,
it silently works, and doesn't do what's expected? Or is there some other concern?

Copy link
Member Author

Choose a reason for hiding this comment

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

Is the concern that someone writes @constraint(model, x >= y) thinking it means PSDCone,
it silently works, and doesn't do what's expected?

Yes.

We won't be adding support for \succeq. There is too much risk of confusion.

Copy link
Contributor

Choose a reason for hiding this comment

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

:/ I really feel such a decision should be made with a larger headcount than i see here.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll open a new issue

@odow odow merged commit 5e0a975 into master Jun 9, 2024
11 checks passed
@odow odow deleted the odow-patch-1 branch June 9, 2024 21:40
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.

2 participants