Skip to content

Commit

Permalink
Remove solve_time since that'll be in stats
Browse files Browse the repository at this point in the history
  • Loading branch information
Vaibhavdixit02 authored Jan 4, 2024
1 parent 350e3d8 commit 5a8dc06
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/solutions/optimization_solutions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Representation of the solution to a non-linear optimization defined by an Optimi
[the return code documentation](https://docs.sciml.ai/SciMLBase/stable/interfaces/Solutions/#retcodes).
- `original`: if the solver is wrapped from an alternative solver ecosystem, such as
Optim.jl, then this is the original return from said solver library.
- `solve_time`: Solve time from the solver in Seconds
- `stats`: statistics of the solver, such as the number of function evaluations required.
"""
struct OptimizationSolution{T, N, uType, C <: AbstractOptimizationCache, A, OV, O, S, ST} <:
Expand All @@ -25,15 +24,13 @@ struct OptimizationSolution{T, N, uType, C <: AbstractOptimizationCache, A, OV,
objective::OV
retcode::ReturnCode.T
original::O # original output of the optimizer
solve_time::S # [s] solve time from the solver
stats::ST
end

function build_solution(cache::AbstractOptimizationCache,
alg, u, objective;
retcode = ReturnCode.Default,
original = nothing,
solve_time = nothing,
stats = nothing,
kwargs...)
T = eltype(eltype(u))
Expand All @@ -43,9 +40,8 @@ function build_solution(cache::AbstractOptimizationCache,
retcode = symbol_to_ReturnCode(retcode)

OptimizationSolution{T, N, typeof(u), typeof(cache), typeof(alg),
typeof(objective), typeof(original), typeof(solve_time),
typeof(stats)}(u, cache, alg, objective, retcode, original,
solve_time, stats)
typeof(objective), typeof(original), typeof(stats)}(u, cache,
alg, objective, retcode, original, solve_time, stats)
end

TruncatedStacktraces.@truncate_stacktrace OptimizationSolution 1 2
Expand Down

0 comments on commit 5a8dc06

Please sign in to comment.