Skip to content

Commit be3c7fe

Browse files
Fix Constructions with RODESolution
1 parent 141f597 commit be3c7fe

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "SciMLBase"
22
uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
33
authors = ["Chris Rackauckas <[email protected]> and contributors"]
4-
version = "2.51.0"
4+
version = "2.51.1"
55

66
[deps]
77
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"

src/solutions/rode_solutions.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,20 @@ struct RODESolution{T, N, uType, uType2, DType, tType, randType, P, A, IType, S,
5151
seed::UInt64
5252
end
5353

54+
function ConstructionBase.constructorof(::Type{O}) where {T, N, O <: RODESolution{T, N}}
55+
RODESolution{T, N}
56+
end
57+
58+
function ConstructionBase.setproperties(sol::RODESolution, patch::NamedTuple)
59+
u = get(patch, :u, sol.u)
60+
N = u === nothing ? 2 : ndims(eltype(u)) + 1
61+
T = eltype(eltype(u))
62+
patch = merge(getproperties(sol), patch)
63+
return RODESolution{T, N}(patch.u, patch.u_analytic, patch.errors, patch.t, patch.W, patch.k,
64+
patch.prob, patch.alg, patch.interp, patch.dense, patch.tslocation, patch.stats,
65+
patch.alg_choice, patch.retcode, patch.seed)
66+
end
67+
5468
Base.@propagate_inbounds function Base.getproperty(x::AbstractRODESolution, s::Symbol)
5569
if s === :destats
5670
Base.depwarn("`sol.destats` is deprecated. Use `sol.stats` instead.", "sol.destats")

0 commit comments

Comments
 (0)