Skip to content

Commit

Permalink
Fix Constructions with RODESolution
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Sep 1, 2024
1 parent 141f597 commit be3c7fe
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SciMLBase"
uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
authors = ["Chris Rackauckas <[email protected]> and contributors"]
version = "2.51.0"
version = "2.51.1"

[deps]
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
Expand Down
14 changes: 14 additions & 0 deletions src/solutions/rode_solutions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,20 @@ struct RODESolution{T, N, uType, uType2, DType, tType, randType, P, A, IType, S,
seed::UInt64
end

function ConstructionBase.constructorof(::Type{O}) where {T, N, O <: RODESolution{T, N}}
RODESolution{T, N}
end

function ConstructionBase.setproperties(sol::RODESolution, patch::NamedTuple)
u = get(patch, :u, sol.u)
N = u === nothing ? 2 : ndims(eltype(u)) + 1
T = eltype(eltype(u))
patch = merge(getproperties(sol), patch)
return RODESolution{T, N}(patch.u, patch.u_analytic, patch.errors, patch.t, patch.W, patch.k,
patch.prob, patch.alg, patch.interp, patch.dense, patch.tslocation, patch.stats,
patch.alg_choice, patch.retcode, patch.seed)
end

Base.@propagate_inbounds function Base.getproperty(x::AbstractRODESolution, s::Symbol)
if s === :destats
Base.depwarn("`sol.destats` is deprecated. Use `sol.stats` instead.", "sol.destats")
Expand Down

0 comments on commit be3c7fe

Please sign in to comment.