Skip to content

Commit 024ff83

Browse files
committedMar 18, 2024
fix: fix io handling in structural_simplify, input_output_handling tests
1 parent a29b41e commit 024ff83

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed
 

Diff for: ‎src/systems/systemstructure.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ function _structural_simplify!(state::TearingState, io; simplify = false,
630630
if has_io
631631
ModelingToolkit.markio!(state, orig_inputs, io...)
632632
end
633-
if io !== nothing || any(isinput, state.fullvars)
633+
if io !== nothing
634634
state, input_idxs = ModelingToolkit.inputs_to_parameters!(state, io)
635635
else
636636
input_idxs = 0:-1 # Empty range

Diff for: ‎test/input_output_handling.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ end
5050
@test !is_bound(sys31, sys1.v[2])
5151

5252
# simplification turns input variables into parameters
53-
ssys = structural_simplify(sys)
53+
ssys, _ = structural_simplify(sys, ([u], []))
5454
@test ModelingToolkit.isparameter(unbound_inputs(ssys)[])
5555
@test !is_bound(ssys, u)
5656
@test u Set(unbound_inputs(ssys))
@@ -236,7 +236,7 @@ i = findfirst(isequal(u[1]), out)
236236
@variables x(t) u(t) [input = true]
237237
eqs = [D(x) ~ u]
238238
@named sys = ODESystem(eqs, t)
239-
@test_nowarn structural_simplify(sys)
239+
@test_nowarn structural_simplify(sys, ([u], []))
240240

241241
#=
242242
## Disturbance input handling

Diff for: ‎test/reduction.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ eqs = [D(x) ~ σ * (y - x)
234234
u ~ z + a]
235235

236236
lorenz1 = ODESystem(eqs, t, name = :lorenz1)
237-
lorenz1_reduced = structural_simplify(lorenz1)
237+
lorenz1_reduced, _ = structural_simplify(lorenz1, ([z], []))
238238
@test z in Set(parameters(lorenz1_reduced))
239239

240240
# #2064

0 commit comments

Comments
 (0)
Please sign in to comment.