Skip to content

Commit 8d49c83

Browse files
committed
Clean up dead code
1 parent 117161a commit 8d49c83

File tree

1 file changed

+4
-37
lines changed

1 file changed

+4
-37
lines changed

src/systems/connectors.jl

Lines changed: 4 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -56,44 +56,11 @@ function connector_type(sys::AbstractSystem)
5656
n_stream > 0 ? StreamConnector() : RegularConnector()
5757
end
5858

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
9661
end
62+
Connection() = Connection(nothing)
63+
get_systems(c::Connection) = c.systems
9764

9865
# symbolic `connect`
9966
function connect(sys1::AbstractSystem, sys2::AbstractSystem, syss::AbstractSystem...)

0 commit comments

Comments
 (0)