-
-
Notifications
You must be signed in to change notification settings - Fork 211
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
Use Aliasing API for alias_u0
#2503
base: master
Are you sure you want to change the base?
Conversation
lib/OrdinaryDiffEqCore/src/solve.jl
Outdated
# If alias kwarg is just default, use alias_u0, which is false by default, or is set by a kwarg to solve | ||
# If alias_u0 is not nothing, use the alias_u0 provided by the user | ||
if isnothing(alias.alias_u0) | ||
alias = ODEAliases(alias_u0) | ||
end |
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.
This is breaking since it does not do what is documented in older versions if users just set alias_u0
.
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.
If users set alias_u0
in solve
, and ODEAliases.alias_u0
is nothing
, it uses the alias_u0
from the solve call. So the only way that the alias_u0
from the solve call isn't used is if an explicit ODEAliases
with ODEAliases.alias_u0
either true or false is put in the call to solve.
lib/OrdinaryDiffEqCore/src/solve.jl
Outdated
@@ -71,6 +71,7 @@ function DiffEqBase.__init( | |||
initialize_integrator = true, | |||
alias_u0 = false, | |||
alias_du0 = false, | |||
alias = ODEAliases(), |
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.
alias = ODEAliases(), | |
alias = ODEAliases(alias_u0 = alias_u0, alias_du0=false), |
It needs the deprecation path.
lib/OrdinaryDiffEqCore/src/solve.jl
Outdated
@@ -119,6 +120,10 @@ function DiffEqBase.__init( | |||
@warn("Dense output is incompatible with saveat. Please use the SavingCallback from the Callback Library to mix the two behaviors.") | |||
end | |||
|
|||
if !(alias isa ODEAliases) |
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.
Should check if the other alias kwargs are used and throw a depwarn in that case.
And we should allow / handle boolean alias
specification as described in the higher level issue.
62b60f1
to
d05bb41
Compare
Checklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC.
Additional context
This makes use of the Aliasing API in SciMLBase SciML/SciMLBase.jl#830
The default of
alias_u0
is preserved here, and it isn't breaking because it still respects whenalias_u0
is put in as a kwarg to solve.