- Notifications
You must be signed in to change notification settings - Fork441
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
@@ -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, |
roryyorkeDec 30, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Numpy scalar type hierarchy is here:https://docs.scipy.org/doc/numpy-1.13.0/reference/arrays.scalars.html
This PR fixes the SciPy 1.0 compatibility issues raised in issue#164. There are two main changes:
Updated
statesp.py
andxferfcn.py
to use the new forms of thescipy.signal
library, for which thelti
class no longer has accessors fornum
,den
, etc. The fix is to directly call thess2tf
andtf2ss
functions.Also had to add a check for scalars that are of a
numpy
data type, specifically forint64
. Prior to Python 3, checking againstint
worked correctly, but this is no longer the case. As a fix, I added checks throughout the library againstnumpy.number
, which captures all scalar data types innumpy
.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).