Skip to content
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

Use NumPy recommended approach to out-of-bounds integer conversion #1496

Merged

Conversation

brandonwillard
Copy link
Member

This PR fixes new deprecation errors caused by certain types of conversions to out-of-bounds integers to integer arrays.

The error is as follows:

DeprecationWarning: NumPy will stop allowing conversion of out-of-bound Python integers to integer arrays.  The conversion of 255 to int8 will fail in the future.
For the old behavior, usually:
    np.array(value).astype(dtype)`
will give the desired result (the cast overflows).

@codecov
Copy link

codecov bot commented May 7, 2023

Codecov Report

Merging #1496 (526b185) into main (ad7a8b7) will decrease coverage by 0.03%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1496      +/-   ##
==========================================
- Coverage   75.09%   75.06%   -0.03%     
==========================================
  Files         194      176      -18     
  Lines       50151    49447     -704     
  Branches    12108    11968     -140     
==========================================
- Hits        37660    37118     -542     
+ Misses      10170    10036     -134     
+ Partials     2321     2293      -28     
Impacted Files Coverage Δ
aesara/misc/safe_asarray.py 69.23% <100.00%> (ø)

... and 19 files with indirect coverage changes

@brandonwillard brandonwillard merged commit 972cb62 into aesara-devs:main May 7, 2023
@brandonwillard brandonwillard deleted the fix-numpy-out-of-bounds branch May 7, 2023 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant