generate error for tf2ss of non-proper transfer function by murrayrm · Pull Request #492 · python-control/python-control

This PR resolves issue #399 when tf2io is called with a non-proper transfer function (which cannot be represented as a state space system). The underlying issue turned out to be in tf2ss, which had the same bug and was probably introduced in PR #370 when we started allowing non-proper transfer functions.

Added unit tests to catch the case and then fixed them by generating a ValueError when you try to convert a non-proper transfer function into a StateSpace object.

Also did some PEP8 cleanup on statesp.py.