Skip to content

Commit 1d239a7

Browse files
committed
code cleanup
1 parent 421131c commit 1d239a7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

control/nlsys.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2422,18 +2422,18 @@ def interconnect(
24222422
elif not found_system:
24232423
raise ValueError("could not find signal %s" % sname)
24242424
else:
2425-
# TODO: refactor code to remove duplication
24262425
if isinstance(connection, list):
24272426
# Passed a list => create input map
24282427
dprint(f" detected input list")
2429-
new_inplist.append([])
2428+
signal_list = []
24302429
for spec in connection:
24312430
isys, indices, gain = _parse_spec(syslist, spec, 'input')
24322431
for isig in indices:
2433-
new_inplist[-1].append((isys, isig, gain))
2434-
dprint(f" adding input {(isys, isig, gain)}")
2432+
signal_list.append((isys, isig, gain))
2433+
dprint(f" adding input {(isys, isig, gain)} to list")
2434+
new_inplist.append(signal_list)
24352435
else:
2436-
# Passed a single single => single input
2436+
# Passed a single signal name => add individual input(s)
24372437
isys, indices, gain = _parse_spec(syslist, connection, 'input')
24382438
for isig in indices:
24392439
new_inplist.append((isys, isig, gain))

0 commit comments

Comments
 (0)