-
-
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
Fix solution stripping for ODESolution #770
Conversation
It feels hacky to rely on |
src/solutions/ode_solutions.jl
Outdated
bigT = typeof(sol).parameters[1] | ||
bigN = typeof(sol).parameters[2] |
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 not a good idea, it will not infer.
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.
Instead use @set sol.interp = interp
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.
Where does @set
come from? When I do
@set sol.interp = interp
ODESolution(sol.u, sol.u_analytic, sol.errors,
sol.t, sol.k, sol.discretes, nothing, nothing,
sol.interp, sol.dense, sol.tslocation, sol.stats,
sol.alg_choice, sol.retcode, sol.resid, sol.original)
It still gives a method error.
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.
Would something like this be better?
N = sol.u === nothing ? 2 : ndims(eltype(sol.u)) + 1
T = eltype(eltype(sol.u))
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.
Oh I see, from Accessors
Ok, this should be it now :-) |
Checklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC.
Additional context
Adds a test for stripping ODESolution objects of any function information.