Skip to content

Commit b260546

Browse files
Merge pull request #424 from AayushSabharwal/as/fix-ctor
fix: fix system not being retained in 4-argument constructor
2 parents d2e0360 + abc5b39 commit b260546

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/vector_of_array.jl

+1-4
Original file line numberDiff line numberDiff line change
@@ -297,10 +297,7 @@ function DiffEqArray(vec::AbstractVector{VT}, ts::AbstractVector, p::NTuple{N2,
297297
end
298298

299299
# first element representative
300-
function DiffEqArray(vec::AbstractVector, ts::AbstractVector, p, sys; discretes = nothing, variables = nothing, parameters = nothing, independent_variables = nothing)
301-
sys = SymbolCache(something(variables, []),
302-
something(parameters, []),
303-
something(independent_variables, []))
300+
function DiffEqArray(vec::AbstractVector, ts::AbstractVector, p, sys; discretes = nothing)
304301
_size = size(vec[1])
305302
T = eltype(vec[1])
306303
return DiffEqArray{

test/interface_tests.jl

+5
Original file line numberDiff line numberDiff line change
@@ -298,3 +298,8 @@ end
298298
@test darr.sys == "A"
299299
@test ndims(darr) == 3
300300
end
301+
302+
@testset "System retained in 4-argument constructor" begin
303+
darr = DiffEqArray([ones(2)], [1.0], :params, :sys)
304+
@test darr.sys == :sys
305+
end

0 commit comments

Comments
 (0)