Skip to content

Fixes for SciPy 1.0 compatibility #170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 2, 2018

Conversation

murrayrm
Copy link
Member

This PR fixes the SciPy 1.0 compatibility issues raised in issue #164. There are two main changes:

  • Updated statesp.py and xferfcn.py to use the new forms of the scipy.signal library, for which the lti class no longer has accessors for num, den, etc. The fix is to directly call the ss2tf and tf2ss functions.

  • Also had to add a check for scalars that are of a numpy data type, specifically for int64. Prior to Python 3, checking against int worked correctly, but this is no longer the case. As a fix, I added checks throughout the library against numpy.number, which captures all scalar data types in numpy.

I also checked (manually) to insure that this version works against scipy-0.19.0, which should mean it is OK for backward compatibility (this can be checked with PR #169 is merged).

@@ -221,18 +222,18 @@ def feedback(sys1, sys2=1, sign=-1):
"""

# Check for correct input types.
if not isinstance(sys1, (int, float, complex, tf.TransferFunction,
ss.StateSpace, frd.FRD)):
if not isinstance(sys1, (int, float, complex, np.number,
Copy link
Contributor

@roryyorke roryyorke Dec 30, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm struggling to find docs on numpy.number; it has a __doc__ string, but no entry, e.g., here: https://docs.scipy.org/doc/numpy-1.13.0/genindex.html . This use seems reasonable, just not sure how standard it is.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@murrayrm murrayrm merged commit c4f1c34 into python-control:master Jan 2, 2018
@murrayrm murrayrm deleted the fix_scipy-1.0 branch January 2, 2018 16:07
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