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

Use Aliasing API for alias_u0 #2503

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Conversation

jClugstor
Copy link
Contributor

Checklist

  • [ x] Appropriate tests were added
  • [ x] Any code changes were done in a way that does not break public API
  • [ x] All documentation related to code changes were updated
  • [ x] The new code follows the
    contributor guidelines, in particular the SciML Style Guide and
    COLPRAC.
  • [ x] Any new documentation only uses public API

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 when alias_u0 is put in as a kwarg to solve.

Comment on lines 170 to 193
# 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
Copy link
Member

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.

Copy link
Contributor Author

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.

@@ -71,6 +71,7 @@ function DiffEqBase.__init(
initialize_integrator = true,
alias_u0 = false,
alias_du0 = false,
alias = ODEAliases(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
alias = ODEAliases(),
alias = ODEAliases(alias_u0 = alias_u0, alias_du0=false),

It needs the deprecation path.

@@ -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)
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants