Skip to content

Fix param name #197

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

Merged
merged 6 commits into from
Jun 11, 2025
Merged

Fix param name #197

merged 6 commits into from
Jun 11, 2025

Conversation

klamike
Copy link
Contributor

@klamike klamike commented Jun 7, 2025

julia> using JuMP, Dualization

julia> m = Model()
A JuMP Model
├ solver: none
├ objective_sense: FEASIBILITY_SENSE
├ num_variables: 0
├ num_constraints: 0
└ Names registered in the model: none

julia> @variable m x
x

julia> @variable m p  Parameter(1.0)
@constrp

julia> @constraint m x  p
x - p  0

julia> @objective m Min x
x

julia> dualize(m, dual_names=DualNames())
ERROR: UndefVarError: `vi` not defined in `Dualization`

@joaquimg
Copy link
Member

joaquimg commented Jun 8, 2025

Thanks!
If you can add a test covering that I can speedup de merge.

@klamike
Copy link
Contributor Author

klamike commented Jun 8, 2025

In making that test I came across this conditional which doesn't seem quite right to me. Is it expected that variable_parameters is ignored when ignore_objective=true?

parameters = if ignore_objective
# only crossed terms (parameter times primal variable) of the objective
# are required
to_add = Set{MOI.VariableIndex}()
for vec in values(primal_objective.quad_cross_parameters)
for term in vec
push!(to_add, term.variable)
end
end
collect(to_add)
else
variable_parameters
end

@klamike
Copy link
Contributor Author

klamike commented Jun 8, 2025

The JuMP test added in #198 covers this as well

@joaquimg
Copy link
Member

format is failing

Copy link

codecov bot commented Jun 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.26%. Comparing base (42b6ad3) to head (4b6781c).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #197      +/-   ##
==========================================
+ Coverage   92.86%   94.26%   +1.39%     
==========================================
  Files          14       14              
  Lines         743      750       +7     
==========================================
+ Hits          690      707      +17     
+ Misses         53       43      -10     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@blegat blegat left a comment

Choose a reason for hiding this comment

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

Thanks!

@blegat blegat merged commit b577819 into jump-dev:master Jun 11, 2025
7 checks passed
@joaquimg
Copy link
Member

Thanks!

@klamike klamike deleted the mk/param_name_fix branch June 13, 2025 20:32
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