Skip to content

Commit e82e146

Browse files
fix: fix io handling in structural_simplify, input_output_handling tests
1 parent 539fe81 commit e82e146

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/systems/systemstructure.jl

Lines changed: 1 addition & 1 deletion
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

test/input_output_handling.jl

Lines changed: 2 additions & 2 deletions
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

0 commit comments

Comments
 (0)