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

Refactor dtype sets in imgaug.py to match migration guide from numpy #861

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kapiw04
Copy link

@kapiw04 kapiw04 commented Oct 25, 2024

citing migration guide for numpy2.0 instead of np.sctypes you should Access dtypes explicitly instead.. To maintain the functionality I did the following:

In [1]: import numpy as np
np
In [2]: np.__version__
Out[2]: '1.22.0'

In [3]: np.sctypes
Out[3]:
{'int': [numpy.int8, numpy.int16, numpy.int32, numpy.int64],
 'uint': [numpy.uint8, numpy.uint16, numpy.uint32, numpy.uint64],
 'float': [numpy.float16, numpy.float32, numpy.float64, numpy.float128],
 'complex': [numpy.complex64, numpy.complex128, numpy.complex256],
 'others': [bool, object, bytes, str, numpy.void]}

I replaced deprecated code in the imgaug.py as shown in changes below.

Additionally I checked with Ruff (which was advised here) whether there were other issues.

$ ruff check --select NPY201
All checks passed!

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.

1 participant