Skip to content

Commit

Permalink
🤖 Format .jl files (#408)
Browse files Browse the repository at this point in the history
Co-authored-by: dpo <[email protected]>
  • Loading branch information
github-actions[bot] and dpo authored Jun 3, 2022
1 parent 1f2dc06 commit a47fd5b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/nls/counters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ for fun in fieldnames(NLSCounters)
end

for fun in fieldnames(Counters)
@eval $NLPModels.increment!(nls::AbstractNLSModel, ::Val{$(Meta.quot(fun))}) = nls.counters.counters.$fun += 1
@eval $NLPModels.increment!(nls::AbstractNLSModel, ::Val{$(Meta.quot(fun))}) =
nls.counters.counters.$fun += 1
end

function LinearOperators.reset!(nls::AbstractNLSModel)
Expand Down
4 changes: 2 additions & 2 deletions test/nlp/counters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ end
if VERSION VersionNumber(1, 7, 3)
@testset "Allocations for NLP counters" begin
nlp = SimpleNLPModel()

increment!(nlp, :neval_obj)
alloc_mem = @allocated increment!(nlp, :neval_obj)
@test alloc_mem == 0
end
end
end
5 changes: 2 additions & 3 deletions test/nls/counters.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@testset "Increase coverage of NLSCounters" begin

nls = SimpleNLSModel()

obj(nls, nls.meta.x0)
Expand Down Expand Up @@ -35,9 +34,9 @@ if VERSION ≥ VersionNumber(1, 7, 3)
increment!(nls, :neval_obj)
alloc_mem = @allocated increment!(nls, :neval_obj)
@test alloc_mem == 0

increment!(nls, :neval_residual)
alloc_mem2 = @allocated increment!(nls, :neval_residual)
@test alloc_mem2 == 0
end
end
end

0 comments on commit a47fd5b

Please sign in to comment.