Skip to content

Commit 6b93b19

Browse files
committed
test op change
1 parent f24068c commit 6b93b19

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

test/downstream/inversemodel.jl

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,28 +131,28 @@ sol = solve(prob, Rodas5P())
131131

132132
# we need to provide `op` so the initialization system knows what to hold constant
133133
# the values don't matter
134-
Sf, simplified_sys = Blocks.get_sensitivity_function(model, :y; op); # This should work without providing an operating opint containing a dummy derivative
134+
Sf, simplified_sys = get_sensitivity_function(model, :y; op); # This should work without providing an operating opint containing a dummy derivative
135135
x = state_values(Sf)
136136
p = parameter_values(Sf)
137137
# If this somehow passes, mention it on
138138
# https://github.com/SciML/ModelingToolkit.jl/issues/2786
139139
matrices1 = Sf(x, p, 0)
140-
matrices2, _ = Blocks.get_sensitivity(model, :y; op); # Test that we get the same result when calling the higher-level API
140+
matrices2, _ = get_sensitivity(model, :y; op); # Test that we get the same result when calling the higher-level API
141141
@test matrices1.f_x matrices2.A[1:6, 1:6]
142142
nsys = get_named_sensitivity(model, :y; op) # Test that we get the same result when calling an even higher-level API
143143
@test matrices2.A nsys.A
144144

145145
# Test the same thing for comp sensitivities
146146

147147
# This should work without providing an operating opint containing a dummy derivative
148-
Sf, simplified_sys = Blocks.get_comp_sensitivity_function(model, :y; op);
148+
Sf, simplified_sys = get_comp_sensitivity_function(model, :y; op);
149149
x = state_values(Sf)
150150
p = parameter_values(Sf)
151151
# If this somehow passes, mention it on
152152
# https://github.com/SciML/ModelingToolkit.jl/issues/2786
153153
matrices1 = Sf(x, p, 0)
154154
# Test that we get the same result when calling the higher-level API
155-
matrices2, _ = Blocks.get_comp_sensitivity(model, :y; op)
155+
matrices2, _ = get_comp_sensitivity(model, :y; op)
156156
@test matrices1.f_x matrices2.A[1:6, 1:6]
157157
# Test that we get the same result when calling an even higher-level API
158158
nsys = get_named_comp_sensitivity(model, :y; op)
@@ -172,15 +172,16 @@ nsys = get_named_comp_sensitivity(model, :y; op)
172172
output = :y
173173
# we need to provide `op` so the initialization system knows which
174174
# values to hold constant
175-
lin_fun, ssys = Blocks.get_sensitivity_function(model, output; op = op1)
176-
matrices1 = linearize(ssys, lin_fun, op = op1)
177-
matrices2 = linearize(ssys, lin_fun, op = op2)
175+
lin_fun, ssys = get_sensitivity_function(model, output; op = op1)
176+
matrices1, extras1 = linearize(ssys, lin_fun, op = op1)
177+
matrices2, extras2 = linearize(ssys, lin_fun, op = op2)
178+
@test extras1.x != extras2.x
178179
S1f = ss(matrices1...)
179180
S2f = ss(matrices2...)
180181
@test S1f != S2f
181182

182-
matrices1, ssys = Blocks.get_sensitivity(model, output; op = op1)
183-
matrices2, ssys = Blocks.get_sensitivity(model, output; op = op2)
183+
matrices1, ssys = get_sensitivity(model, output; op = op1)
184+
matrices2, ssys = get_sensitivity(model, output; op = op2)
184185
S1 = ss(matrices1...)
185186
S2 = ss(matrices2...)
186187
@test S1 != S2

0 commit comments

Comments
 (0)