Skip to content
This repository was archived by the owner on Nov 17, 2025. It is now read-only.

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

Merged
brandonwillard merged 1 commit intoaesara-devs:mainfrom
brandonwillard:fix-numpy-out-of-bounds
May 7, 2023
Merged

Use NumPy recommended approach to out-of-bounds integer conversion#1496
brandonwillard merged 1 commit intoaesara-devs:mainfrom
brandonwillard:fix-numpy-out-of-bounds

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant