-
Notifications
You must be signed in to change notification settings - Fork 5
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
Fix NumPy deprecation warning #289
Conversation
I think
Probably to make this work we'll need to check if it is indeed a NumPy array first, then check the dtype; e.g.
This might do the same thing, and seems a bit more obvious:
Edit: This might mean that our |
ee7b3c0
to
0bbcf4d
Compare
I updated the PR. This probably needs to be fixed in Nengo core too. |
aa4b1a0
to
a3e12e9
Compare
Finally got a green build. :) |
These methods were not working correctly for scalar arrays like `np.array(42)` because the `isinstance` check on, for example, `np.integer` was not correct. This also fixes a deprecation warning See [1] for details in the release notes. Using `np.floating` will capture more types than np.float, but is arguably closer to what one would expect from an `is_float` function and consistent with the `is_integer` function. [1]: https://numpy.org/devdocs/release/1.20.0-notes.html#using-the-aliases-of-builtin-types-like-np-int-is-deprecated
a3e12e9
to
ac1edb0
Compare
Motivation and context:
See 1 for details in the release notes. Using
np.floating
willcapture more types than np.float, but is arguably closer to what one
would expect from an
is_float
function and consistent with theis_integer
function.Interactions with other PRs:
none
How has this been tested?
existing tests
How long should this take to review?
Types of changes:
Checklist:
I think this change does not need a changelog entry as it shouldn't affect the public API, but if desired I can add one.