Skip to content
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

Remove solve_time since that'll be in stats #585

Merged
merged 1 commit into from
Jan 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading