@@ -344,7 +344,8 @@ function System(eqs::Vector{Equation}, iv, dvs, ps, brownians = [];
344
344
continuous_events = SymbolicContinuousCallback[], discrete_events = SymbolicDiscreteCallback[],
345
345
connector_type = nothing , assertions = Dict {BasicSymbolic, String} (),
346
346
metadata = MetadataT (), gui_metadata = nothing ,
347
- is_dde = nothing , tstops = [], tearing_state = nothing ,
347
+ is_dde = nothing , tstops = [], inputs = OrderedSet {BasicSymbolic} (),
348
+ outputs = OrderedSet {BasicSymbolic} (), tearing_state = nothing ,
348
349
ignored_connections = nothing , parent = nothing ,
349
350
description = " " , name = nothing , discover_from_metadata = true ,
350
351
initializesystem = nothing , is_initializesystem = false , is_discrete = false ,
@@ -379,8 +380,8 @@ function System(eqs::Vector{Equation}, iv, dvs, ps, brownians = [];
379
380
380
381
defaults = anydict (defaults)
381
382
guesses = anydict (guesses)
382
- inputs = OrderedSet {BasicSymbolic} ()
383
- outputs = OrderedSet {BasicSymbolic} ()
383
+ inputs = OrderedSet {BasicSymbolic} (inputs )
384
+ outputs = OrderedSet {BasicSymbolic} (outputs )
384
385
for subsys in systems
385
386
for var in ModelingToolkit. inputs (subsys)
386
387
push! (inputs, renamespace (subsys, var))
@@ -764,6 +765,7 @@ function flatten(sys::System, noeqs = false)
764
765
discrete_events = discrete_events (sys), assertions = assertions (sys),
765
766
is_dde = is_dde (sys), tstops = symbolic_tstops (sys),
766
767
initialization_eqs = initialization_equations (sys),
768
+ inputs = inputs (sys), outputs = outputs (sys),
767
769
# without this, any defaults/guesses obtained from metadata that were
768
770
# later removed by the user will be re-added. Right now, we just want to
769
771
# retain `defaults(sys)` as-is.
0 commit comments