Skip to content

Commit

Permalink
simplify name of Ampl models
Browse files Browse the repository at this point in the history
  • Loading branch information
dpo committed May 25, 2024
1 parent 7470bdf commit aba5db3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ampl_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ mutable struct AmplModel <: AbstractNLPModel{Float64, Vector{Float64}}
nlnet = nlnet,
minimize = minimize,
islp = islp,
name = stub,
name = split(fname, ".")[1], # do not include path or extension in model name
)

nlp = new(meta, asl, Counters(), safe)
Expand Down
1 change: 1 addition & 0 deletions test/ampl_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,4 @@ x = hs6min.meta.x0
@test obj(hs6min, x) obj(hs6max, x)
@test all(grad(hs6min, x) .≈ grad(hs6max, x))
@test all(Matrix(hess(hs6min, x)) .≈ Matrix(hess(hs6max, x)))
@test hs6min.meta.name == "hs6"

0 comments on commit aba5db3

Please sign in to comment.