Skip to content

Commit 254661e

Browse files
authored
Merge pull request #1687 from SciML/myb/format
Always use reshape to prevent misformat
2 parents f81a613 + b19555f commit 254661e

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/parameters.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function isparameter(x)
55
x = unwrap(x)
66
if istree(x) && operation(x) isa Symbolic
77
getmetadata(x, MTKParameterCtx, false) ||
8-
isparameter(operation(x))
8+
isparameter(operation(x))
99
elseif istree(x) && operation(x) == (getindex)
1010
isparameter(arguments(x)[1])
1111
elseif x isa Symbolic

src/utils.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@ function iv_from_nested_derivative(x, op = Differential)
223223
if istree(x) && operation(x) == getindex
224224
iv_from_nested_derivative(arguments(x)[1], op)
225225
elseif istree(x)
226-
operation(x) isa op ? iv_from_nested_derivative(arguments(x)[1], op) : arguments(x)[1]
226+
operation(x) isa op ? iv_from_nested_derivative(arguments(x)[1], op) :
227+
arguments(x)[1]
227228
elseif issym(x)
228229
x
229230
else

test/linearize.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ desired_order = [f.x, p.x]
7373
lsys = ModelingToolkit.reorder_states(lsys, states(ssys), desired_order)
7474

7575
@test lsys.A == [-2 0; 1 -2]
76-
@test lsys.B == reshape([1; 0;;], 2, 1) # reshape required when testing on Julia v1.6
76+
@test lsys.B == reshape([1, 0], 2, 1)
7777
@test lsys.C == [0 1]
7878
@test lsys.D[] == 0
7979

0 commit comments

Comments
 (0)