Skip to content

Update xferfcn.py - numpy deprecations. #539

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
Feb 9, 2021

Conversation

dapperfu
Copy link
Contributor

@dapperfu dapperfu commented Feb 8, 2021

DeprecationWarning: np.int is a deprecated alias for the builtin int. To silence this warning, use int by itself. Doing this will not modify any behavior and is safe. When replacing np.int, you may wish to use e.g. np.int64 or np.int32 to specify the precision. If you wish to review your current use, check the release note link for additional information.

https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

Changed the logic to check for an instance of both 32 & 64-bit ints.

The np.int is covered by the builtin int:

>>> isinstance(np.int(1), (int, np.int32, np.int64))
True
>>> isinstance(int(1), (int, np.int32, np.int64))
True

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 88.271% when pulling 0c03dd7 on AutomotiveDevOps:master into c04431f on python-control:master.

@bnavigator
Copy link
Contributor

Thanks for the heads up. Looks good to me.

In the long term, wie should just cast to float (or complex) without checking.

@bnavigator bnavigator merged commit cc67807 into python-control:master Feb 9, 2021
@murrayrm murrayrm added this to the 0.9.0 milestone Mar 20, 2021
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.

4 participants