Skip to content

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

Merged
odow merged 2 commits intomasterfrom
odow-patch-1
Jun 9, 2024
Merged

[docs] add warning about Y <= X, Set() syntax#3769
odow merged 2 commits intomasterfrom
odow-patch-1

Conversation

@odow
Copy link
Copy Markdown
Member

@odow odow commented Jun 5, 2024

x-ref #3766

@codecov
Copy link
Copy Markdown

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.

Comment thread docs/src/manual/constraints.md Outdated
Comment thread docs/src/manual/constraints.md Outdated
@@ -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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@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