SciML / Roadmap

A place for discussing the future of differential equations in Julia
0 stars 1 forks source link

Dependency Reduction for Usage of the Common Interface #9

Closed ChrisRackauckas closed 7 years ago

ChrisRackauckas commented 7 years ago

One problem I have noticed is that in the way I am using the common interface, I have had to add dependencies for the separate dispatches. For example, convergence testing, the only ODE specific code has:

function test_convergence(dts::AbstractArray,prob::AbstractODEProblem,alg;save_timeseries=true,adaptive=false,kwargs...)
  N = length(dts)
  solutions = [solve(prob,alg;dt=dts[i],save_timeseries=save_timeseries,adaptive=adaptive,kwargs...) for i=1:N]
  auxdata = Dict(:dts =>  dts)
  ConvergenceSimulation(solutions,dts,auxdata=auxdata)
end

This code works for any package which implements the common interface solve, but this code inside of DiffEqDevTools only works for the packages which implement the common interface and are dependents of DiffEqDevTools. Is there a way to get around having everything be a dependency here?

I don't necessarily care about this problem too much in dev tools, but the same problem then applies to more user facing tools like parameter estimation and sensitivity analysis. Is this a case that will need extern modules?

mauro3 commented 7 years ago

I'm sorry, I don't follow. What do you mean with "...and are dependents of DiffEqDevTools."?

ChrisRackauckas commented 7 years ago

I'm sorry, I don't follow. What do you mean with "...and are dependents of DiffEqDevTools."?

This code requires that DiffEqDevTools does using OrdinaryDiffEq in order to use the solve, and so it will require every solver package. This means that, even though it would work with ODEInterface if you just copy/pasted it into the REPL (one it implements the common interface outside of OrdinaryDiffEq), it won't work from DiffEqDevTools without requiring ODEInterface and using ODEInterface. That's the hiccup.

ChrisRackauckas commented 7 years ago

Is this fixed by @mauro3 noticing that solve wasn't exported from DiffEqBase. Thanks for the fix! The deps are fixed on the masters.