Skip to content

Conversation

@murrayrm
Copy link
Member

While use the iosys module, I noticed that the following construct did something unexpected:

lateral = ct.NonlinearIOSystem(vehicle_update, vehicle_output,
    states=2, name='lateral', inputs=('phi'), outputs=('y', 'theta')
)

This is supposed to be a single input, multi-output system, but I got a system with 3 (?) inputs. Turns out that the string 'phi' was being interpreted as an array of length three since I didn't write it explicitly as a tuple, ('phi',) and hence it was an array of length 3.

This PR checks to see if inputs, outputs, or states are a single string object, in which case it assumes you want are specifying a single signal with the string as the name.

I also fixed a small bug where the prefix for setting the default name (if no name string is given for a single) was being ignored.

@coveralls
Copy link

coveralls commented Jun 17, 2019

Coverage Status

Coverage increased (+0.03%) to 82.128% when pulling b29233e on murrayrm:iosys_fix_input into 089936f on python-control:master.

@murrayrm murrayrm merged commit 732149c into python-control:master Jun 30, 2019
@murrayrm murrayrm deleted the iosys_fix_input branch July 1, 2019 05:20
@murrayrm murrayrm added this to the 0.8.3 milestone Jan 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants