SciML / SciML/Optimization.jl

`__solve` interface support

Open
#1,007 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
839
Forks
100
Avg merge
20h 43m
Merged PRs (30d)
38

Description

Some of the subpackages in Optimization.jl do not support interfaces like SciMLBase.__solve(prob::OptimizationProblem, alg, args...; kwargs...), while others do. For example, SciMLBase has some traits for solvers that support the cache interface:

https://github.com/SciML/SciMLBase.jl/blob/6f1a1d077182cde28e951417484b17b6b771252f/src/solve.jl#L128-L139

We usually define

function __solve(prob, alg, args...; kwargs)
    cache = __init(prob, alg)
    sol = solve!(cache) # or solve!(integrator)
end

for some specific problem solvers (ODE, SDE, or BVP), but it seems the __solve is directly defined on OptimizationCache in Optimization.jl, while we are also doing similar init and solve cache things in Optimization.jl under the hood, why not use the same interface in Optimization.jl too?

Keep track of this issue from https://github.com/SciML/BoundaryValueDiffEq.jl/pull/350 for better integration of Optimization.jl.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with SciMLBase/src/solve.jl and the OptimizationCache implementation, then compare the Optimization.jl subpackages that define __solve with the __init and solve! flow described here. Done means the relevant optimization solvers consistently support the __solve(prob, alg, args...; kwargs...) interface and retain compatibility with the BoundaryValueDiffEq.jl integration.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.