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

Improve error message for common case of using Bool instead of Bin #3181

Merged
merged 3 commits into from
Jan 9, 2023

Conversation

odow
Copy link
Member

@odow odow commented Jan 9, 2023

This PR was motivated by the discourse post:
https://discourse.julialang.org/t/how-to-declare-a-boolean-variable/41279

It is one of the top-10 most read posts on the JuMP section of the discourse forum, so it is obviously a common stumbling block, particularly because we support Int for integer variables.

This PR was motivated by the discourse post:
https://discourse.julialang.org/t/how-to-declare-a-boolean-variable/41279

It is one of the top-10 most read posts on the JuMP section of the
discourse forum, so it is obviously a common stumbling block,
particularly because we support Int for integer variables.
@codecov
Copy link

codecov bot commented Jan 9, 2023

Codecov Report

Base: 98.07% // Head: 98.07% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (9b054a7) compared to base (6460d89).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3181   +/-   ##
=======================================
  Coverage   98.07%   98.07%           
=======================================
  Files          33       33           
  Lines        4563     4567    +4     
=======================================
+ Hits         4475     4479    +4     
  Misses         88       88           
Impacted Files Coverage Δ
src/macros.jl 98.51% <100.00%> (+<0.01%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@odow
Copy link
Member Author

odow commented Jan 9, 2023

This is definitely a JuMP 2.0 consideration. It's weird that we have @variable(model, x, Int) that relies on parsing the symbol :Int, and the fact that Bin isn't a variable in scope. @variable(model, x, Bool) would make more sense.

@odow odow merged commit e4b0610 into master Jan 9, 2023
@odow odow deleted the od/bool branch January 9, 2023 17:23
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.

1 participant