Skip to content

Interconnect treats string as list #692

Description

@murrayrm

If you pass the interconnect function a string instead of a list, it treats the string as a list (of characters). For example:

P1 = ct.rss(2, 1, 1)
P1_iosys = ct.LinearIOSystem(P1, inputs='u1', outputs='y1')
P2 = ct.rss(2, 1, 1)
P2_iosys = ct.LinearIOSystem(P2, inputs='y1', outputs='y2')
P_series = ct.interconnect([P1_iosys, P2_iosys], inputs=['u1'], outputs=('y2'))

generates the following error:

ValueError: could not find signal y

The problem appears to be that ('y2') is the same as 'y2' in Python and is being interpreted as ['y', '2']. Changing this to outputs=('y2',) or outputs=['y2'] fixes the problem, but it is still a bug.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions