@@ -56,44 +56,11 @@ function connector_type(sys::AbstractSystem)
56
56
n_stream > 0 ? StreamConnector () : RegularConnector ()
57
57
end
58
58
59
- Base. @kwdef struct Connection
60
- inners = nothing
61
- outers = nothing
62
- end
63
-
64
- # everything is inner by default until we expand the connections
65
- Connection (syss) = Connection (inners= syss)
66
- get_systems (c:: Connection ) = c. inners
67
- function Base. in (e:: Symbol , c:: Connection )
68
- (c. inners != = nothing && any (k-> nameof (k) === e, c. inners)) ||
69
- (c. outers != = nothing && any (k-> nameof (k) === e, c. outers))
70
- end
71
-
72
- function renamespace (sym:: Symbol , connection:: Connection )
73
- inners = connection. inners === nothing ? [] : renamespace .(sym, connection. inners)
74
- if connection. outers != = nothing
75
- for o in connection. outers
76
- push! (inners, renamespace (sym, o))
77
- end
78
- end
79
- Connection (;inners= inners)
80
- end
81
-
82
- const EMPTY_VEC = []
83
-
84
- function Base. show (io:: IO , :: MIME"text/plain" , c:: Connection )
85
- # It is a bit unfortunate that the display of an array of `Equation`s won't
86
- # call this.
87
- @unpack outers, inners = c
88
- if outers === nothing && inners === nothing
89
- print (io, " <Connection>" )
90
- else
91
- syss = Iterators. flatten ((something (inners, EMPTY_VEC), something (outers, EMPTY_VEC)))
92
- splitting_idx = length (inners)
93
- sys_str = join ((string (nameof (s)) * (i <= splitting_idx ? (" ::inner" ) : (" ::outer" )) for (i, s) in enumerate (syss)), " , " )
94
- print (io, " <" , sys_str, " >" )
95
- end
59
+ struct Connection
60
+ systems
96
61
end
62
+ Connection () = Connection (nothing )
63
+ get_systems (c:: Connection ) = c. systems
97
64
98
65
# symbolic `connect`
99
66
function connect (sys1:: AbstractSystem , sys2:: AbstractSystem , syss:: AbstractSystem... )
0 commit comments