update deprecations for NumPy 1.24
import functools as _functools
import sys as _sys
-import warnings as _warnings
import numpy as _numpy
@@ -100,7 +99,6 @@ from numpy import unsignedinteger # NOQA
# Booleans
# -----------------------------------------------------------------------------
from numpy import bool_ # NOQA
-from numpy import bool8 # NOQA
# -----------------------------------------------------------------------------
# Integers
@@ -111,7 +109,6 @@ from numpy import intc # NOQA
from numpy import int_ # NOQA
from numpy import longlong # NOQA
from numpy import intp # NOQA
-from numpy import int0 # NOQA
from numpy import int8 # NOQA
from numpy import int16 # NOQA
from numpy import int32 # NOQA
@@ -126,7 +123,6 @@ from numpy import uintc # NOQA
from numpy import uint # NOQA
from numpy import ulonglong # NOQA
from numpy import uintp # NOQA
-from numpy import uint0 # NOQA
from numpy import uint8 # NOQA
from numpy import uint16 # NOQA
from numpy import uint32 # NOQA
@@ -912,29 +908,13 @@ def show_config(*, _full=False):
_deprecated_apis = [
- 'MachAr', # NumPy 1.22
+ 'int0',
+ 'uint0',
+ 'bool8',
]
-_deprecated_scalar_aliases = { # NumPy 1.20
- 'int': (int, 'cupy.int_'),
- 'bool': (bool, 'cupy.bool_'),
- 'float': (float, 'cupy.float_'),
- 'complex': (complex, 'cupy.complex_'),
-}
-
def __getattr__(name):
- value = _deprecated_scalar_aliases.get(name)
- if value is not None:
- attr, eq_attr = value
- _warnings.warn(
- f'`cupy.{name}` is a deprecated alias for the Python scalar type '
- f'`{name}`. Please use the builtin `{name}` or its corresponding '
- f'NumPy scalar type `{eq_attr}` instead.',
- DeprecationWarning, stacklevel=2
- )
- return attr
-
if name in _deprecated_apis:
return getattr(_numpy, name)
