-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
Split SciMLBase from DiffEqBase #1
Conversation
There are many reasons for this. 1. DiffEqBase.jl has grown to be a base between the differential equation solvers, with common tools for nonlinear solvers and callbacks adding a ton of dependencies. Users like @mauro3 noticed this in SciML/DiffEqBase.jl#618 2. A lot of DiffEqBase was becoming unrelated to differential equations. OptimizationProblem, NonlinearProblem, all of those functions, etc. It's a full interface for SciML, not DiffEq which is by now a subset of the full ecosystem. But it needed to play the Base role, which meant that nonlinear problems were defined in the repo carrying all of the dependencies for the ODE solver's callback system. 3. It started inviting circular dependencies. Some of these problems are pervasive. We need to get the simplest form to GalacticOptim.jl, Quadrature.jl, NonlinearSolve.jl, etc. which are becoming the DiffEq's of their respective regimes (though there's not as much to do in those areas). But this meant NonlinearSolve.jl needed NonlinearProblem, but NonlinearSolve.jl was used in the callbacks, so... it had its own problem type. This gives an issue to a system like MTK which then has no unique type to target. 4. There's a lot of churn on the DiffEq solver portions of DiffEqBase, but relatively little on the actual interface portions. So it makes sense to let them be more stable. 5. There's a ton of packages which are @requires in DiffEqBase, which adds to the compile time. This was done because the library was supposed to avoid dependencies, but as the central piece of the differential equation solvers it really couldn't, and so it used required to fake lower dependencies but some of those like ForwardDiff.jl should really be promoted to being a real dependency now that it doesn't have the "idea" of being no-dependency. For backwards compatibility, DiffEqBase reexports SciMLBase and imports a ton of the abstract types it used to have. This should allow for the migration to take place over time, while still fixing some of the MTK and NonlinearSolve issues that need a fix ASAP. DiffEqBase will have a companion PR to match it. There are some remaining issues here though: 1. I would like to get rid of the LabelledArrays dependency. Is there a good generic to use for the names? `nameof`? 2. Is the split at the right level? 3. I want to drop the Queryverse stuff like TableTraits and IteratorInterfaceExtensions since we have Tables.jl
Tested SciML/NonlinearSolve.jl#25 works. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you move the some of the DiffEqBase tests here, too? It's probably pretty tricky to do, though.
I plan to add a bunch of downstream tests. |
Yeah, makes sense. I like this a lot. This should cut down a lot of complication time. BTW, do we want to move OrdinaryDiffEq's generic dense output to DiffEqBase? Then other solvers and callbacks can use that interface. |
I agree, it's great to separate the more basic non-DiffEq stuff. Is the plan also to move common functionality (e.g., generic interpolation, initialization, and keyword arguments) that appears in OrdinaryDiffEq and StochasticDiffEq (and to some extent also in DelayDiffEq and StochasticDelayDiffEq) to DiffEqBase then? I assume this would make it a bit easier to synchronize changes in OrdinaryDiffEq, StochasticDiffEq, DelayDiffEq etc. and maybe would allow us to drop the dependency on OrdinaryDiffEq in StochasticDiffEq. |
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" | ||
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" | ||
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" | ||
TreeViews = "a2a6695c-b41b-5b7d-aed9-dbfdeacea5d7" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was a bit surprised to see that the latest release is from July 2018 and the repo contains no Project.toml but only a REQUIRE file. But I assume it just indicates that the package is very stable and no changes are expected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's super stable. @pfitzseb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. I don't think there are any actively maintained consumers of TreeViews's tree views anymore though ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do we define for VSCode and Juno nowadays then? TreeViews still seems to work for Juno?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. VSCode's tree views (in the workspace) aren't customizable atm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noticed that we defined eltype
for instances of DESolutionRow
and AbstractSciMLOperator
although the Julia docs recommend to define it for types.
Did you check if the PRs improve the compile time of DiffEqBase?
It seems https://github.com/SciML/DiffEqBase.jl/blob/b5ac95fedb065af3b9aeb95a09eb2fa043b7424f/src/solutions/solution_interface.jl#L158 is equivalent to return keys(sol.u[1]) so maybe use |
No, that's a secondary concern here. Right now it's a big shuffle so I'm more concerned about correctness. |
Yes, precisely. And we'll want to PR to upstream packages telling them about SciMLBase.jl.
Oh buddy, it's even worse than that: https://github.com/SciML/DiffEqBase.jl/blob/master/src/interpolation.jl That's the kind of thing I hope we can start cleaning up.
Yes that looks like it works. |
Co-authored-by: David Widmann <[email protected]>
Co-authored-by: David Widmann <[email protected]>
@@ -0,0 +1,42 @@ | |||
Tables.isrowtable(::Type{<:DESolution}) = true | |||
Tables.columns(x::DESolution) = Tables.columntable(Tables.rows(x)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we have this definition previously? At first glance, it doesn't seem necessary (the fallback in Tables.jl should do the same thing)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise, all the Tables.jl stuff here looks great
DelayDiffEq passed. |
LSODA passed. |
Sundials passed. |
DiffEqCallbacks passed. |
DiffEqJump passed |
DiffEqBase and ModelingToolkit passed |
DiffEqSensitivity passed |
StochasticDelayDiffEq passed |
DiffEqUncertainty passed |
This is kind of a hack, but it looks like there was a major regression in that library and I'm not quite sure why, but given I found this while working on SciML/SciMLBase.jl#1 I'm putting a fix to ElasticArrays right inline and will upstream that later. I'm kind of confused because I don't see a recent tag from ElasticArrays but it could've been a versioning thing.
There are many reasons for this.
For backwards compatibility, DiffEqBase reexports SciMLBase and imports a ton of the abstract types it used to have. This should allow for the migration to take place over time, while still fixing some of the MTK and NonlinearSolve issues that need a fix ASAP.
DiffEqBase will have a companion PR to match it.
There are some remaining issues here though:
nameof
?Downstream changes to setup: