Skip to content

Conversation

@odow
Copy link
Member

@odow odow commented Mar 30, 2025

@codecov
Copy link

codecov bot commented Mar 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (b4006ab) to head (64ba26d).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #3967   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           43        43           
  Lines         6073      6077    +4     
=========================================
+ Hits          6073      6077    +4     

☔ 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.

@WalterMadelim
Copy link
Contributor

@odow
I think name(model) can be added to solution_summary(model)?
Existing:

solution_summary(; result = 1, verbose = false)
├ solver_name          : Gurobi
├ Termination

Revamped:

solution_summary(; result = 1, verbose = false)
├ My_Model was solved by Gurobi
├ Termination

where My_Model::String = name(model)

@odow
Copy link
Member Author

odow commented Mar 31, 2025

The name is printed as part of show(::IO, ::AbstractModel).

I don't think we need to print the model name because in most cases it will be the default. The model name is also unrelated to the solution.

If you're solving multiple models in various orders and you're printing the solution summary to some sort of log file, then you should add some additional information to identify the models.

For example:

julia> using JuMP, HiGHS

julia> begin
           model = Model(HiGHS.Optimizer)
           set_silent(model)
           set_name(model, "My Model")
           @variable(model, x >= 0)
           optimize!(model)
           contents = sprint() do io
               show(io, model)
               println(io)
               show(io, solution_summary(model))
           end;
           print(contents)
       end
My Model
├ solver: HiGHS
├ objective_sense: FEASIBILITY_SENSE
├ num_variables: 1
├ num_constraints: 1
│ └ VariableRef in MOI.GreaterThan{Float64}: 1
└ Names registered in the model
  └ :x
solution_summary(; result = 1, verbose = false)
├ solver_name          : HiGHS
├ Termination
│ ├ termination_status : OPTIMAL
│ ├ result_count       : 1
│ ├ raw_status         : kHighsModelStatusOptimal
│ └ objective_bound    : 0.00000e+00
├ Solution (result = 1)
│ ├ primal_status        : FEASIBLE_POINT
│ ├ dual_status          : FEASIBLE_POINT
│ ├ objective_value      : 0.00000e+00
│ ├ dual_objective_value : 0.00000e+00
│ └ relative_gap         : 0.00000e+00
└ Work counters
  ├ solve_time (sec)   : 2.51860e-05
  ├ simplex_iterations : 0
  ├ barrier_iterations : 0
  └ node_count         : -1

@odow odow merged commit ca7edf6 into master Mar 31, 2025
11 checks passed
@odow odow deleted the od/set-name-model branch March 31, 2025 00:46
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.

3 participants