diff --git a/dpnp/__init__.py b/dpnp/__init__.py index 7b39f9a280f..a6eea502e49 100644 --- a/dpnp/__init__.py +++ b/dpnp/__init__.py @@ -67,8 +67,6 @@ from .dpnp_array_api_info import __array_namespace_info__ from .dpnp_flatiter import flatiter as flatiter from .dpnp_iface_types import * -from .dpnp_iface import * -from .dpnp_iface import __all__ as _iface__all__ from .dpnp_iface_utils import * from .dpnp_iface_utils import __all__ as _ifaceutils__all__ from ._version import get_versions @@ -78,7 +76,857 @@ from . import random as random from . import scipy as scipy -__all__ = _iface__all__ + +# ============================================================================= +# Routines +# +# The order of these declarations are borrowed from the NumPy document: +# https://numpy.org/doc/stable/reference/routines.html +# ============================================================================= + +# ----------------------------------------------------------------------------- +# Array creation routines +# ----------------------------------------------------------------------------- +from .dpnp_iface_arraycreation import ( + arange, + array, + asanyarray, + asarray, + ascontiguousarray, + asfortranarray, + astype, + copy, + diag, + diagflat, + empty, + empty_like, + eye, + frombuffer, + fromfile, + fromfunction, + fromiter, + fromstring, + from_dlpack, + full, + full_like, + geomspace, + identity, + linspace, + loadtxt, + logspace, + meshgrid, + mgrid, + ogrid, + ones, + ones_like, + trace, + tri, + tril, + triu, + vander, + zeros, + zeros_like, +) + +# ----------------------------------------------------------------------------- +# Array manipulation routines +# ----------------------------------------------------------------------------- +from .dpnp_iface_manipulation import ( + append, + array_split, + asarray_chkfinite, + asfarray, + atleast_1d, + atleast_2d, + atleast_3d, + broadcast_arrays, + broadcast_to, + can_cast, + column_stack, + concat, + concatenate, + copyto, + delete, + dsplit, + dstack, + expand_dims, + flip, + fliplr, + flipud, + hsplit, + hstack, + insert, + matrix_transpose, + moveaxis, + ndim, + pad, + permute_dims, + ravel, + repeat, + require, + reshape, + resize, + result_type, + roll, + rollaxis, + rot90, + row_stack, + shape, + size, + split, + squeeze, + stack, + swapaxes, + tile, + transpose, + trim_zeros, + unstack, + vsplit, + vstack, +) + +# ----------------------------------------------------------------------------- +# Bit-wise operations +# ----------------------------------------------------------------------------- +from .dpnp_iface_bitwise import ( + binary_repr, + bitwise_and, + bitwise_count, + bitwise_invert, + bitwise_left_shift, + bitwise_not, + bitwise_or, + bitwise_right_shift, + bitwise_xor, + invert, + left_shift, + right_shift, +) + +# ----------------------------------------------------------------------------- +# Functional programming +# ----------------------------------------------------------------------------- +from .dpnp_iface_functional import ( + apply_along_axis, + apply_over_axes, + piecewise, +) + +# ----------------------------------------------------------------------------- +# Indexing routines +# ----------------------------------------------------------------------------- +from .dpnp_iface_indexing import ( + choose, + compress, + diag_indices, + diag_indices_from, + diagonal, + extract, + fill_diagonal, + flatnonzero, + indices, + iterable, + ix_, + mask_indices, + ndindex, + nonzero, + place, + put, + put_along_axis, + putmask, + ravel_multi_index, + select, + take, + take_along_axis, + tril_indices, + tril_indices_from, + triu_indices, + triu_indices_from, + unravel_index, +) + +# ----------------------------------------------------------------------------- +# Linear algebra +# ----------------------------------------------------------------------------- +from .dpnp_iface_linearalgebra import ( + dot, + einsum, + einsum_path, + inner, + kron, + matmul, + matvec, + outer, + tensordot, + vdot, + vecdot, + vecmat, +) + +# ----------------------------------------------------------------------------- +# Logic functions +# ----------------------------------------------------------------------------- +from .dpnp_iface_logic import ( + all, + allclose, + any, + array_equal, + array_equiv, + equal, + greater, + greater_equal, + isclose, + iscomplex, + iscomplexobj, + isfinite, + isfortran, + isinf, + isnan, + isneginf, + isposinf, + isreal, + isrealobj, + isscalar, + less, + less_equal, + logical_and, + logical_not, + logical_or, + logical_xor, + not_equal, +) + +# ----------------------------------------------------------------------------- +# Mathematical functions +# ----------------------------------------------------------------------------- +from .dpnp_iface_mathematical import ( + abs, + absolute, + add, + angle, + around, + ceil, + clip, + conj, + conjugate, + copysign, + cross, + cumprod, + cumsum, + cumulative_prod, + cumulative_sum, + diff, + divide, + ediff1d, + fabs, + fix, + float_power, + floor, + floor_divide, + fmax, + fmin, + fmod, + frexp, + gcd, + gradient, + heaviside, + i0, + imag, + interp, + lcm, + ldexp, + maximum, + minimum, + mod, + modf, + multiply, + nan_to_num, + negative, + nextafter, + positive, + pow, + power, + prod, + proj, + real, + real_if_close, + remainder, + rint, + round, + sign, + signbit, + sinc, + spacing, + subtract, + sum, + trapezoid, + true_divide, + trunc, +) +from .dpnp_iface_nanfunctions import ( + nancumprod, + nancumsum, + nanprod, + nansum, +) +from .dpnp_iface_statistics import convolve +from .dpnp_iface_trigonometric import ( + arccos, + arccosh, + arcsin, + arcsinh, + arctan, + arctan2, + arctanh, + asin, + asinh, + acos, + acosh, + atan, + atan2, + atanh, + cbrt, + cos, + cosh, + cumlogsumexp, + deg2rad, + degrees, + exp, + exp2, + expm1, + hypot, + log, + log10, + log1p, + log2, + logaddexp, + logaddexp2, + logsumexp, + rad2deg, + radians, + reciprocal, + reduce_hypot, + rsqrt, + sin, + sinh, + sqrt, + square, + tan, + tanh, + unwrap, +) + +# ----------------------------------------------------------------------------- +# Miscellaneous routines +# ----------------------------------------------------------------------------- +from .dpnp_iface_manipulation import broadcast_shapes +from .dpnp_iface import get_include + +# ----------------------------------------------------------------------------- +# Set routines +# ----------------------------------------------------------------------------- +from .dpnp_iface_manipulation import ( + unique, + unique_all, + unique_counts, + unique_inverse, + unique_values, +) + +# ----------------------------------------------------------------------------- +# Sorting, searching, and counting +# ----------------------------------------------------------------------------- +from .dpnp_iface_counting import count_nonzero +from .dpnp_iface_nanfunctions import nanargmax, nanargmin +from .dpnp_iface_searching import ( + argmax, + argmin, + argwhere, + searchsorted, + where, +) +from .dpnp_iface_sorting import ( + argsort, + partition, + sort, + sort_complex, +) + +# ----------------------------------------------------------------------------- +# Statistics +# ----------------------------------------------------------------------------- +from .dpnp_iface_histograms import ( + bincount, + digitize, + histogram, + histogram_bin_edges, + histogram2d, + histogramdd, +) +from .dpnp_iface_nanfunctions import ( + nanmax, + nanmean, + nanmedian, + nanmin, + nanstd, + nanvar, +) +from .dpnp_iface_statistics import ( + amax, + amin, + average, + corrcoef, + correlate, + cov, + max, + mean, + median, + min, + ptp, + std, + var, +) + +# ----------------------------------------------------------------------------- +# Window functions +# ----------------------------------------------------------------------------- +from .dpnp_iface_window import ( + bartlett, + blackman, + hamming, + hanning, + kaiser, +) + + +# ============================================================================= +# Helper functions +# ============================================================================= +from .dpnp_iface import ( + are_same_logical_tensors, + asnumpy, + as_usm_ndarray, + check_limitations, + check_supported_arrays_type, + default_float_type, + get_dpnp_descriptor, + get_normalized_queue_device, + get_result_array, + get_usm_ndarray, + get_usm_ndarray_or_scalar, + is_cuda_backend, + is_supported_array_or_scalar, + is_supported_array_type, + synchronize_array_data, +) + +# ============================================================================= +# Public API +# ============================================================================= + +# Array creation routines +__all__ = [ + "arange", + "array", + "asanyarray", + "asarray", + "ascontiguousarray", + "asfortranarray", + "astype", + "copy", + "diag", + "diagflat", + "empty", + "empty_like", + "eye", + "frombuffer", + "fromfile", + "fromfunction", + "fromiter", + "fromstring", + "from_dlpack", + "full", + "full_like", + "geomspace", + "identity", + "linspace", + "loadtxt", + "logspace", + "meshgrid", + "mgrid", + "ogrid", + "ones", + "ones_like", + "trace", + "tri", + "tril", + "triu", + "vander", + "zeros", + "zeros_like", +] + +# Array manipulation routines +__all__ += [ + "append", + "array_split", + "asarray_chkfinite", + "asfarray", + "atleast_1d", + "atleast_2d", + "atleast_3d", + "broadcast_arrays", + "broadcast_to", + "can_cast", + "column_stack", + "concat", + "concatenate", + "copyto", + "delete", + "dsplit", + "dstack", + "expand_dims", + "flip", + "fliplr", + "flipud", + "hsplit", + "hstack", + "insert", + "matrix_transpose", + "moveaxis", + "ndim", + "pad", + "permute_dims", + "ravel", + "repeat", + "require", + "reshape", + "resize", + "result_type", + "roll", + "rollaxis", + "rot90", + "row_stack", + "shape", + "size", + "split", + "squeeze", + "stack", + "swapaxes", + "tile", + "transpose", + "trim_zeros", + "unstack", + "vsplit", + "vstack", +] + +# Bitwise operations +__all__ += [ + "binary_repr", + "bitwise_and", + "bitwise_count", + "bitwise_invert", + "bitwise_left_shift", + "bitwise_not", + "bitwise_or", + "bitwise_right_shift", + "bitwise_xor", + "invert", + "left_shift", + "right_shift", +] + +# Functional programming +__all__ += [ + "apply_along_axis", + "apply_over_axes", + "piecewise", +] + +# Indexing routines +__all__ += [ + "choose", + "compress", + "diag_indices", + "diag_indices_from", + "diagonal", + "extract", + "fill_diagonal", + "flatnonzero", + "indices", + "iterable", + "ix_", + "mask_indices", + "ndindex", + "nonzero", + "place", + "put", + "put_along_axis", + "putmask", + "ravel_multi_index", + "select", + "take", + "take_along_axis", + "tril_indices", + "tril_indices_from", + "triu_indices", + "triu_indices_from", + "unravel_index", +] + +# Linear algebra +__all__ += [ + "dot", + "einsum", + "einsum_path", + "inner", + "kron", + "matmul", + "matvec", + "outer", + "tensordot", + "vdot", + "vecdot", + "vecmat", +] + +# Logic functions +__all__ += [ + "all", + "allclose", + "any", + "array_equal", + "array_equiv", + "equal", + "greater", + "greater_equal", + "isclose", + "iscomplex", + "iscomplexobj", + "isfinite", + "isfortran", + "isinf", + "isnan", + "isneginf", + "isposinf", + "isreal", + "isrealobj", + "isscalar", + "less", + "less_equal", + "logical_and", + "logical_not", + "logical_or", + "logical_xor", + "not_equal", +] + +# Mathematical functions +__all__ += [ + "abs", + "absolute", + "acos", + "acosh", + "add", + "angle", + "arccos", + "arccosh", + "arcsin", + "arcsinh", + "arctan", + "arctan2", + "arctanh", + "around", + "asin", + "asinh", + "atan", + "atan2", + "atanh", + "cbrt", + "ceil", + "clip", + "conj", + "conjugate", + "convolve", + "copysign", + "cos", + "cosh", + "cross", + "cumlogsumexp", + "cumprod", + "cumsum", + "cumulative_prod", + "cumulative_sum", + "deg2rad", + "degrees", + "diff", + "divide", + "ediff1d", + "exp", + "exp2", + "expm1", + "fabs", + "fix", + "fmax", + "fmin", + "float_power", + "floor", + "floor_divide", + "fmod", + "frexp", + "gcd", + "gradient", + "heaviside", + "hypot", + "i0", + "imag", + "interp", + "lcm", + "ldexp", + "log", + "log10", + "log1p", + "log2", + "logaddexp", + "logaddexp2", + "logsumexp", + "maximum", + "mean", + "median", + "min", + "minimum", + "mod", + "modf", + "multiply", + "nan_to_num", + "nanargmax", + "nanargmin", + "nancumprod", + "nancumsum", + "nanprod", + "nansum", + "negative", + "nextafter", + "pow", + "positive", + "power", + "prod", + "proj", + "rad2deg", + "radians", + "real", + "real_if_close", + "remainder", + "reciprocal", + "reduce_hypot", + "rint", + "round", + "rsqrt", + "sign", + "signbit", + "sin", + "sinc", + "sinh", + "sqrt", + "square", + "spacing", + "subtract", + "sum", + "tan", + "tanh", + "trapezoid", + "true_divide", + "trunc", + "unwrap", +] + +# Miscellaneous routines +__all__ += [ + "broadcast_shapes", + "get_include", +] + +# Set routines +__all__ += [ + "unique", + "unique_all", + "unique_counts", + "unique_inverse", + "unique_values", +] + +# Sorting, searching, and counting +__all__ += [ + "argmax", + "argmin", + "argwhere", + "argsort", + "count_nonzero", + "partition", + "searchsorted", + "sort", + "sort_complex", + "where", +] + +# Statistics +__all__ += [ + "amax", + "amin", + "average", + "bincount", + "corrcoef", + "correlate", + "cov", + "digitize", + "histogram", + "histogram2d", + "histogram_bin_edges", + "histogramdd", + "max", + "mean", + "median", + "min", + "nanmax", + "nanmean", + "nanmedian", + "nanmin", + "nanstd", + "nanvar", + "ptp", + "std", + "var", +] + +# Window functions +__all__ += [ + "bartlett", + "blackman", + "hamming", + "hanning", + "kaiser", +] + +# Helper functions +__all__ += [ + "are_same_logical_tensors", + "asnumpy", + "as_usm_ndarray", + "check_limitations", + "check_supported_arrays_type", + "default_float_type", + "get_dpnp_descriptor", + "get_normalized_queue_device", + "get_result_array", + "get_usm_ndarray", + "get_usm_ndarray_or_scalar", + "is_cuda_backend", + "is_supported_array_or_scalar", + "is_supported_array_type", + "synchronize_array_data", +] + __all__ += _ifaceutils__all__ # add submodules diff --git a/dpnp/dpnp_iface.py b/dpnp/dpnp_iface.py index 896078198c5..4cdc74c75ca 100644 --- a/dpnp/dpnp_iface.py +++ b/dpnp/dpnp_iface.py @@ -39,7 +39,6 @@ """ # pylint: disable=protected-access -# pylint: disable=redefined-outer-name import os @@ -51,60 +50,8 @@ from dpctl.tensor._device import normalize_queue_device import dpnp -from dpnp.dpnp_algo import * -from dpnp.dpnp_array import dpnp_array - -__all__ = [ - "are_same_logical_tensors", - "asnumpy", - "as_usm_ndarray", - "check_limitations", - "check_supported_arrays_type", - "default_float_type", - "get_dpnp_descriptor", - "get_include", - "get_normalized_queue_device", - "get_result_array", - "get_usm_ndarray", - "get_usm_ndarray_or_scalar", - "is_cuda_backend", - "is_supported_array_or_scalar", - "is_supported_array_type", - "synchronize_array_data", -] - -from dpnp.dpnp_iface_arraycreation import * -from dpnp.dpnp_iface_arraycreation import __all__ as __all__arraycreation -from dpnp.dpnp_iface_bitwise import * -from dpnp.dpnp_iface_bitwise import __all__ as __all__bitwise -from dpnp.dpnp_iface_counting import * -from dpnp.dpnp_iface_counting import __all__ as __all__counting -from dpnp.dpnp_iface_functional import * -from dpnp.dpnp_iface_functional import __all__ as __all__functional -from dpnp.dpnp_iface_histograms import * -from dpnp.dpnp_iface_histograms import __all__ as __all__histograms -from dpnp.dpnp_iface_indexing import * -from dpnp.dpnp_iface_indexing import __all__ as __all__indexing -from dpnp.dpnp_iface_linearalgebra import * -from dpnp.dpnp_iface_linearalgebra import __all__ as __all__linearalgebra -from dpnp.dpnp_iface_logic import * -from dpnp.dpnp_iface_logic import __all__ as __all__logic -from dpnp.dpnp_iface_manipulation import * -from dpnp.dpnp_iface_manipulation import __all__ as __all__manipulation -from dpnp.dpnp_iface_mathematical import * -from dpnp.dpnp_iface_mathematical import __all__ as __all__mathematical -from dpnp.dpnp_iface_nanfunctions import * -from dpnp.dpnp_iface_nanfunctions import __all__ as __all__nanfunctions -from dpnp.dpnp_iface_searching import * -from dpnp.dpnp_iface_searching import __all__ as __all__searching -from dpnp.dpnp_iface_sorting import * -from dpnp.dpnp_iface_sorting import __all__ as __all__sorting -from dpnp.dpnp_iface_statistics import * -from dpnp.dpnp_iface_statistics import __all__ as __all__statistics -from dpnp.dpnp_iface_trigonometric import * -from dpnp.dpnp_iface_trigonometric import __all__ as __all__trigonometric -from dpnp.dpnp_iface_window import * -from dpnp.dpnp_iface_window import __all__ as __all__window + +from .dpnp_array import dpnp_array # pylint: disable=no-name-in-module from .dpnp_utils import ( @@ -113,23 +60,6 @@ use_origin_backend, ) -__all__ += __all__arraycreation -__all__ += __all__bitwise -__all__ += __all__counting -__all__ += __all__functional -__all__ += __all__histograms -__all__ += __all__indexing -__all__ += __all__linearalgebra -__all__ += __all__logic -__all__ += __all__manipulation -__all__ += __all__mathematical -__all__ += __all__nanfunctions -__all__ += __all__searching -__all__ += __all__sorting -__all__ += __all__statistics -__all__ += __all__trigonometric -__all__ += __all__window - def are_same_logical_tensors(ar1, ar2): """ @@ -437,7 +367,7 @@ def get_dpnp_descriptor( # If input object is a scalar, it means it was allocated on host memory. # We need to copy it to USM memory according to compute follows data. if dpnp.isscalar(ext_obj): - ext_obj = array( + ext_obj = dpnp.array( ext_obj, dtype=alloc_dtype, usm_type=alloc_usm_type, @@ -464,7 +394,7 @@ def get_dpnp_descriptor( ext_obj_offset = 0 if ext_obj.strides != shape_offsets or ext_obj_offset != 0: - ext_obj = array(ext_obj, order="C") + ext_obj = dpnp.array(ext_obj, order="C") # while dpnp functions are based on DPNP_QUEUE # we need to create a copy on device associated with DPNP_QUEUE @@ -478,7 +408,7 @@ def get_dpnp_descriptor( dpctl.utils.get_execution_queue([queue, default_queue]) is not None ) if not queue_is_default: - ext_obj = array(ext_obj, sycl_queue=default_queue) + ext_obj = dpnp.array(ext_obj, sycl_queue=default_queue) dpnp_desc = dpnp_descriptor(ext_obj) if dpnp_desc.is_valid: # pylint: disable=using-constant-test diff --git a/dpnp/dpnp_iface_arraycreation.py b/dpnp/dpnp_iface_arraycreation.py index 4b5633864b1..12c65d116a7 100644 --- a/dpnp/dpnp_iface_arraycreation.py +++ b/dpnp/dpnp_iface_arraycreation.py @@ -61,47 +61,6 @@ # pylint: disable=no-name-in-module from .dpnp_utils import get_usm_allocations, map_dtype_to_device -__all__ = [ - "arange", - "array", - "asanyarray", - "asarray", - "ascontiguousarray", - "asfortranarray", - "astype", - "copy", - "diag", - "diagflat", - "empty", - "empty_like", - "eye", - "frombuffer", - "fromfile", - "fromfunction", - "fromiter", - "fromstring", - "from_dlpack", - "full", - "full_like", - "geomspace", - "identity", - "linspace", - "loadtxt", - "logspace", - "meshgrid", - "mgrid", - "ogrid", - "ones", - "ones_like", - "trace", - "tri", - "tril", - "triu", - "vander", - "zeros", - "zeros_like", -] - def _get_empty_array( a, diff --git a/dpnp/dpnp_iface_bitwise.py b/dpnp/dpnp_iface_bitwise.py index 34b0594af06..733fbc69724 100644 --- a/dpnp/dpnp_iface_bitwise.py +++ b/dpnp/dpnp_iface_bitwise.py @@ -49,21 +49,6 @@ import dpnp.backend.extensions.ufunc._ufunc_impl as ufi from dpnp.dpnp_algo.dpnp_elementwise_common import DPNPBinaryFunc, DPNPUnaryFunc -__all__ = [ - "binary_repr", - "bitwise_and", - "bitwise_count", - "bitwise_invert", - "bitwise_left_shift", - "bitwise_not", - "bitwise_or", - "bitwise_right_shift", - "bitwise_xor", - "invert", - "left_shift", - "right_shift", -] - def binary_repr(num, width=None): """ diff --git a/dpnp/dpnp_iface_counting.py b/dpnp/dpnp_iface_counting.py index 443823c3faa..a4b85aa8529 100644 --- a/dpnp/dpnp_iface_counting.py +++ b/dpnp/dpnp_iface_counting.py @@ -43,8 +43,6 @@ import dpnp -__all__ = ["count_nonzero"] - def count_nonzero(a, axis=None, *, keepdims=False, out=None): """ diff --git a/dpnp/dpnp_iface_functional.py b/dpnp/dpnp_iface_functional.py index f292085e7f1..1985eced2e7 100644 --- a/dpnp/dpnp_iface_functional.py +++ b/dpnp/dpnp_iface_functional.py @@ -51,8 +51,6 @@ # pylint: disable=no-name-in-module from dpnp.dpnp_utils import get_usm_allocations -__all__ = ["apply_along_axis", "apply_over_axes", "piecewise"] - def apply_along_axis(func1d, axis, arr, *args, **kwargs): """ diff --git a/dpnp/dpnp_iface_histograms.py b/dpnp/dpnp_iface_histograms.py index b7e884a663c..8f3363e79fe 100644 --- a/dpnp/dpnp_iface_histograms.py +++ b/dpnp/dpnp_iface_histograms.py @@ -57,15 +57,6 @@ # pylint: disable=no-name-in-module from .dpnp_utils import get_usm_allocations -__all__ = [ - "bincount", - "digitize", - "histogram", - "histogram_bin_edges", - "histogram2d", - "histogramdd", -] - # range is a keyword argument to many functions, so save the builtin so they can # use it. _range = range diff --git a/dpnp/dpnp_iface_indexing.py b/dpnp/dpnp_iface_indexing.py index 482cc862057..b0039a68f44 100644 --- a/dpnp/dpnp_iface_indexing.py +++ b/dpnp/dpnp_iface_indexing.py @@ -64,36 +64,6 @@ from .dpnp_array import dpnp_array from .dpnp_utils import call_origin, get_usm_allocations -__all__ = [ - "choose", - "compress", - "diag_indices", - "diag_indices_from", - "diagonal", - "extract", - "fill_diagonal", - "flatnonzero", - "indices", - "iterable", - "ix_", - "mask_indices", - "ndindex", - "nonzero", - "place", - "put", - "put_along_axis", - "putmask", - "ravel_multi_index", - "select", - "take", - "take_along_axis", - "tril_indices", - "tril_indices_from", - "triu_indices", - "triu_indices_from", - "unravel_index", -] - def _ravel_multi_index_checks(multi_index, dims, order): dpnp.check_supported_arrays_type(*multi_index) diff --git a/dpnp/dpnp_iface_linearalgebra.py b/dpnp/dpnp_iface_linearalgebra.py index a76f10c5588..a0068a3597e 100644 --- a/dpnp/dpnp_iface_linearalgebra.py +++ b/dpnp/dpnp_iface_linearalgebra.py @@ -54,21 +54,6 @@ dpnp_vecdot, ) -__all__ = [ - "dot", - "einsum", - "einsum_path", - "inner", - "kron", - "matmul", - "matvec", - "outer", - "tensordot", - "vdot", - "vecdot", - "vecmat", -] - # TODO: implement a specific scalar-array kernel def _call_multiply(a, b, out=None, outer_calc=False): diff --git a/dpnp/dpnp_iface_logic.py b/dpnp/dpnp_iface_logic.py index 67ce9b65b54..8e0d19ac7d8 100644 --- a/dpnp/dpnp_iface_logic.py +++ b/dpnp/dpnp_iface_logic.py @@ -55,36 +55,6 @@ from .dpnp_utils import get_usm_allocations -__all__ = [ - "all", - "allclose", - "any", - "array_equal", - "array_equiv", - "equal", - "greater", - "greater_equal", - "isclose", - "iscomplex", - "iscomplexobj", - "isfinite", - "isfortran", - "isinf", - "isnan", - "isneginf", - "isposinf", - "isreal", - "isrealobj", - "isscalar", - "less", - "less_equal", - "logical_and", - "logical_not", - "logical_or", - "logical_xor", - "not_equal", -] - def _isclose_scalar_tol(a, b, rtol, atol, equal_nan): """ diff --git a/dpnp/dpnp_iface_manipulation.py b/dpnp/dpnp_iface_manipulation.py index d56c8ebbf5e..85892da8b97 100644 --- a/dpnp/dpnp_iface_manipulation.py +++ b/dpnp/dpnp_iface_manipulation.py @@ -40,8 +40,6 @@ """ -# pylint: disable=duplicate-code - import math import operator import warnings @@ -97,67 +95,6 @@ class UniqueInverseResult(NamedTuple): inverse_indices: dpnp.ndarray -__all__ = [ - "append", - "array_split", - "asarray_chkfinite", - "asfarray", - "atleast_1d", - "atleast_2d", - "atleast_3d", - "broadcast_arrays", - "broadcast_shapes", - "broadcast_to", - "can_cast", - "column_stack", - "concat", - "concatenate", - "copyto", - "delete", - "dsplit", - "dstack", - "expand_dims", - "flip", - "fliplr", - "flipud", - "hsplit", - "hstack", - "insert", - "matrix_transpose", - "moveaxis", - "ndim", - "pad", - "permute_dims", - "ravel", - "repeat", - "require", - "reshape", - "resize", - "result_type", - "roll", - "rollaxis", - "rot90", - "row_stack", - "shape", - "size", - "split", - "squeeze", - "stack", - "swapaxes", - "tile", - "transpose", - "trim_zeros", - "unique", - "unique_all", - "unique_counts", - "unique_inverse", - "unique_values", - "unstack", - "vsplit", - "vstack", -] - - def _check_stack_arrays(arrays): """Validate a sequence type of arrays to stack.""" diff --git a/dpnp/dpnp_iface_mathematical.py b/dpnp/dpnp_iface_mathematical.py index b4b28695145..a93d04728d2 100644 --- a/dpnp/dpnp_iface_mathematical.py +++ b/dpnp/dpnp_iface_mathematical.py @@ -40,7 +40,6 @@ """ # pylint: disable=protected-access -# pylint: disable=duplicate-code # pylint: disable=no-name-in-module @@ -85,71 +84,6 @@ from .dpnp_utils.dpnp_utils_linearalgebra import dpnp_cross from .dpnp_utils.dpnp_utils_reduction import dpnp_wrap_reduction_call -__all__ = [ - "abs", - "absolute", - "add", - "angle", - "around", - "ceil", - "clip", - "conj", - "conjugate", - "copysign", - "cross", - "cumprod", - "cumsum", - "cumulative_prod", - "cumulative_sum", - "diff", - "divide", - "ediff1d", - "fabs", - "fix", - "float_power", - "floor", - "floor_divide", - "fmax", - "fmin", - "fmod", - "frexp", - "gcd", - "gradient", - "heaviside", - "i0", - "imag", - "interp", - "lcm", - "ldexp", - "maximum", - "minimum", - "mod", - "modf", - "multiply", - "nan_to_num", - "negative", - "nextafter", - "positive", - "pow", - "power", - "prod", - "proj", - "real", - "real_if_close", - "remainder", - "rint", - "round", - "sign", - "signbit", - "sinc", - "spacing", - "subtract", - "sum", - "trapezoid", - "true_divide", - "trunc", -] - def _get_max_min(dtype): """Get the maximum and minimum representable values for an inexact dtype.""" diff --git a/dpnp/dpnp_iface_nanfunctions.py b/dpnp/dpnp_iface_nanfunctions.py index 711baf3015e..b8abad2a208 100644 --- a/dpnp/dpnp_iface_nanfunctions.py +++ b/dpnp/dpnp_iface_nanfunctions.py @@ -39,28 +39,11 @@ """ -# pylint: disable=duplicate-code - import warnings import dpnp from dpnp.dpnp_utils.dpnp_utils_statistics import dpnp_median -__all__ = [ - "nanargmax", - "nanargmin", - "nancumprod", - "nancumsum", - "nanmax", - "nanmean", - "nanmedian", - "nanmin", - "nanprod", - "nanstd", - "nansum", - "nanvar", -] - def _replace_nan_no_mask(a, val): """ diff --git a/dpnp/dpnp_iface_searching.py b/dpnp/dpnp_iface_searching.py index 4447baf81a9..6eefe010b69 100644 --- a/dpnp/dpnp_iface_searching.py +++ b/dpnp/dpnp_iface_searching.py @@ -47,8 +47,6 @@ from .dpnp_array import dpnp_array from .dpnp_utils.dpnp_utils_reduction import dpnp_wrap_reduction_call -__all__ = ["argmax", "argmin", "argwhere", "searchsorted", "where"] - def _get_search_res_dt(a, out): """Get a data type used by dpctl for result array in search function.""" diff --git a/dpnp/dpnp_iface_sorting.py b/dpnp/dpnp_iface_sorting.py index 036f96e3b53..db33a88c748 100644 --- a/dpnp/dpnp_iface_sorting.py +++ b/dpnp/dpnp_iface_sorting.py @@ -39,8 +39,6 @@ """ -# pylint: disable=duplicate-code - import dpctl.tensor as dpt import numpy from dpctl.tensor._numpy_helper import normalize_axis_index @@ -57,8 +55,6 @@ map_dtype_to_device, ) -__all__ = ["argsort", "partition", "sort", "sort_complex"] - def _wrap_sort_argsort( a, diff --git a/dpnp/dpnp_iface_statistics.py b/dpnp/dpnp_iface_statistics.py index 877baedfd4e..7e092184366 100644 --- a/dpnp/dpnp_iface_statistics.py +++ b/dpnp/dpnp_iface_statistics.py @@ -60,23 +60,6 @@ from .dpnp_utils.dpnp_utils_reduction import dpnp_wrap_reduction_call from .dpnp_utils.dpnp_utils_statistics import dpnp_cov, dpnp_median -__all__ = [ - "amax", - "amin", - "average", - "convolve", - "corrcoef", - "correlate", - "cov", - "max", - "mean", - "median", - "min", - "ptp", - "std", - "var", -] - def _count_reduce_items(arr, axis, where=True): """ @@ -719,10 +702,10 @@ def _convolve_fft(a, v, l_pad, r_pad, rtype): padded_size = a.size + r_pad + 1 fft_size = 2 ** int(math.ceil(math.log2(padded_size))) - af = dpnp.fft.fft(a, fft_size) # pylint: disable=no-member - vf = dpnp.fft.fft(v, fft_size) # pylint: disable=no-member + af = dpnp.fft.fft(a, fft_size) + vf = dpnp.fft.fft(v, fft_size) - r = dpnp.fft.ifft(af * vf) # pylint: disable=no-member + r = dpnp.fft.ifft(af * vf) if dpnp.issubdtype(rtype, dpnp.floating): r = r.real elif dpnp.issubdtype(rtype, dpnp.integer) or rtype == dpnp.bool: diff --git a/dpnp/dpnp_iface_trigonometric.py b/dpnp/dpnp_iface_trigonometric.py index feed2966d9e..a46f06c10e0 100644 --- a/dpnp/dpnp_iface_trigonometric.py +++ b/dpnp/dpnp_iface_trigonometric.py @@ -53,52 +53,6 @@ from .dpnp_algo.dpnp_elementwise_common import DPNPBinaryFunc, DPNPUnaryFunc from .dpnp_utils.dpnp_utils_reduction import dpnp_wrap_reduction_call -__all__ = [ - "arccos", - "arccosh", - "arcsin", - "arcsinh", - "arctan", - "arctan2", - "arctanh", - "asin", - "asinh", - "acos", - "acosh", - "atan", - "atan2", - "atanh", - "cbrt", - "cos", - "cosh", - "cumlogsumexp", - "deg2rad", - "degrees", - "exp", - "exp2", - "expm1", - "hypot", - "log", - "log10", - "log1p", - "log2", - "logaddexp", - "logaddexp2", - "logsumexp", - "rad2deg", - "radians", - "reciprocal", - "reduce_hypot", - "rsqrt", - "sin", - "sinh", - "sqrt", - "square", - "tan", - "tanh", - "unwrap", -] - def _get_accumulation_res_dt(a, dtype): """Get a dtype used by dpctl for result array in accumulation function.""" diff --git a/dpnp/dpnp_iface_window.py b/dpnp/dpnp_iface_window.py index 171bd03904e..f8d6df07443 100644 --- a/dpnp/dpnp_iface_window.py +++ b/dpnp/dpnp_iface_window.py @@ -48,8 +48,6 @@ import dpnp import dpnp.backend.extensions.window._window_impl as wi -__all__ = ["bartlett", "blackman", "hamming", "hanning", "kaiser"] - def _call_window_kernel( M, _window_kernel, device=None, usm_type=None, sycl_queue=None, beta=None diff --git a/dpnp/linalg/dpnp_iface_linalg.py b/dpnp/linalg/dpnp_iface_linalg.py index 8df2a3907a1..95bb849afa3 100644 --- a/dpnp/linalg/dpnp_iface_linalg.py +++ b/dpnp/linalg/dpnp_iface_linalg.py @@ -40,7 +40,6 @@ """ # pylint: disable=invalid-name -# pylint: disable=no-member # pylint: disable=no-name-in-module from typing import NamedTuple diff --git a/dpnp/linalg/dpnp_utils_linalg.py b/dpnp/linalg/dpnp_utils_linalg.py index ff388675c18..8fda45a7b4d 100644 --- a/dpnp/linalg/dpnp_utils_linalg.py +++ b/dpnp/linalg/dpnp_utils_linalg.py @@ -36,11 +36,9 @@ """ -# pylint: disable=duplicate-code # pylint: disable=invalid-name # pylint: disable=no-name-in-module # pylint: disable=protected-access -# pylint: disable=useless-import-alias from typing import NamedTuple diff --git a/dpnp/scipy/special/_erf.py b/dpnp/scipy/special/_erf.py index 693b7574386..31e33f517d8 100644 --- a/dpnp/scipy/special/_erf.py +++ b/dpnp/scipy/special/_erf.py @@ -38,9 +38,9 @@ """ +# pylint: disable=no-name-in-module # pylint: disable=protected-access -# pylint: disable=no-name-in-module import dpnp.backend.extensions.ufunc._ufunc_impl as ufi from dpnp.dpnp_algo.dpnp_elementwise_common import DPNPUnaryFunc