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

[deprecation] Remove fix in favor of set_value #76

Merged
merged 6 commits into from
Feb 28, 2021
Merged

[deprecation] Remove fix in favor of set_value #76

merged 6 commits into from
Feb 28, 2021

Conversation

odow
Copy link
Member

@odow odow commented Feb 25, 2021

JuMP's Nonlinear parameters use set_value and value: https://jump.dev/JuMP.jl/stable/nlp/#Nonlinear-Parameters

We should follow that.

@codecov
Copy link

codecov bot commented Feb 25, 2021

Codecov Report

Merging #76 (f5c97e1) into master (11421e1) will increase coverage by 4.94%.
The diff coverage is 57.14%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #76      +/-   ##
==========================================
+ Coverage   72.06%   77.01%   +4.94%     
==========================================
  Files           8        8              
  Lines         469      435      -34     
==========================================
- Hits          338      335       -3     
+ Misses        131      100      -31     
Impacted Files Coverage Δ
src/ParameterJuMP.jl 86.51% <ø> (ø)
src/deprecations.jl 0.00% <0.00%> (ø)
src/variable_interface.jl 52.17% <100.00%> (+27.17%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 11421e1...594da09. Read the comment docs.

@odow odow requested a review from joaquimg February 25, 2021 01:18
Copy link
Collaborator

@joaquimg joaquimg left a comment

Choose a reason for hiding this comment

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

Set value is ok!
Not sure about the rest.

@@ -115,44 +74,3 @@ function parameter_by_name(model::Model, name::String)
end
return nothing
end

JuMP.has_lower_bound(p::ParameterRef) = false
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are the errors for missing methods very clear about what the user should do?

Copy link
Member Author

Choose a reason for hiding this comment

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

It will throw a method error. This is not defined.

Copy link
Member Author

Choose a reason for hiding this comment

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

We don't define has_lower_bound on nonlinear parameters, for example.

Copy link
Member Author

Choose a reason for hiding this comment

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

julia> has_lower_bound(p)
ERROR: MethodError: no method matching has_lower_bound(::ParameterRef)
Closest candidates are:
  has_lower_bound(::VariableRef) at /Users/oscar/.julia/packages/JuMP/y5vgk/src/variables.jl:352
Stacktrace:
 [1] top-level scope at REPL[9]:1

Copy link
Collaborator

Choose a reason for hiding this comment

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

I see, well ok. Lets got for it and think more if people get confused at some point.

@odow
Copy link
Member Author

odow commented Feb 26, 2021

Looks like my merge didn't work. Let me try again.

@odow odow merged commit 5a50e8b into master Feb 28, 2021
@odow odow deleted the od/fix branch February 28, 2021 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants