diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f21d433200..5cf88d9266d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ Also, that release drops support for Python 3.9, making Python 3.10 the minimum * Redesigned `dpnp.modf` function to be a part of `ufunc` and `vm` pybind11 extensions [#2654](https://github.com/IntelPython/dpnp/pull/2654) * Refactored `dpnp.fft` and `dpnp.random` submodules by removing wildcard imports and defining explicit public exports [#2649](https://github.com/IntelPython/dpnp/pull/2649) * Added support for the `out` keyword to accept a tuple, bringing ufunc signatures into alignment with those in NumPy [#2664](https://github.com/IntelPython/dpnp/pull/2664) +* Unified public API definitions in `dpnp.linalg` and `dpnp.scipy` submodules [#2663](https://github.com/IntelPython/dpnp/pull/2663) ### Deprecated diff --git a/dpnp/linalg/__init__.py b/dpnp/linalg/__init__.py index 46c8740ffa3..e04928393a8 100644 --- a/dpnp/linalg/__init__.py +++ b/dpnp/linalg/__init__.py @@ -38,9 +38,6 @@ from .dpnp_iface_linalg import ( LinAlgError, -) -from .dpnp_iface_linalg import __all__ as __all__linalg -from .dpnp_iface_linalg import ( cholesky, cond, cross, @@ -74,4 +71,37 @@ vector_norm, ) -__all__ = __all__linalg +__all__ = [ + "LinAlgError", + "cholesky", + "cond", + "cross", + "det", + "diagonal", + "eig", + "eigh", + "eigvals", + "eigvalsh", + "inv", + "lstsq", + "matmul", + "matrix_norm", + "matrix_power", + "matrix_rank", + "matrix_transpose", + "multi_dot", + "norm", + "outer", + "pinv", + "qr", + "solve", + "svd", + "svdvals", + "slogdet", + "tensordot", + "tensorinv", + "tensorsolve", + "trace", + "vecdot", + "vector_norm", +] diff --git a/dpnp/linalg/dpnp_iface_linalg.py b/dpnp/linalg/dpnp_iface_linalg.py index 9f77287ef5c..8df2a3907a1 100644 --- a/dpnp/linalg/dpnp_iface_linalg.py +++ b/dpnp/linalg/dpnp_iface_linalg.py @@ -72,41 +72,6 @@ dpnp_svd, ) -__all__ = [ - "LinAlgError", - "cholesky", - "cond", - "cross", - "det", - "diagonal", - "eig", - "eigh", - "eigvals", - "eigvalsh", - "inv", - "lstsq", - "matmul", - "matrix_norm", - "matrix_power", - "matrix_rank", - "matrix_transpose", - "multi_dot", - "norm", - "outer", - "pinv", - "qr", - "solve", - "svd", - "svdvals", - "slogdet", - "tensordot", - "tensorinv", - "tensorsolve", - "trace", - "vecdot", - "vector_norm", -] - # Need to set the module explicitly, because it's initially exposed by LAPACK # pybind11 extension and to add the docstrings LinAlgError.__module__ = "dpnp.linalg" diff --git a/dpnp/linalg/dpnp_utils_linalg.py b/dpnp/linalg/dpnp_utils_linalg.py index 823bc7757f3..ff388675c18 100644 --- a/dpnp/linalg/dpnp_utils_linalg.py +++ b/dpnp/linalg/dpnp_utils_linalg.py @@ -54,27 +54,6 @@ import dpnp.backend.extensions.lapack._lapack_impl as li from dpnp.dpnp_utils import get_usm_allocations -__all__ = [ - "assert_2d", - "assert_stacked_2d", - "assert_stacked_square", - "dpnp_cholesky", - "dpnp_cond", - "dpnp_det", - "dpnp_eigh", - "dpnp_inv", - "dpnp_lstsq", - "dpnp_matrix_power", - "dpnp_matrix_rank", - "dpnp_multi_dot", - "dpnp_norm", - "dpnp_pinv", - "dpnp_qr", - "dpnp_slogdet", - "dpnp_solve", - "dpnp_svd", -] - # pylint:disable=missing-class-docstring class EighResult(NamedTuple): diff --git a/dpnp/scipy/linalg/_decomp_lu.py b/dpnp/scipy/linalg/_decomp_lu.py index b7478182731..d2a58fba14d 100644 --- a/dpnp/scipy/linalg/_decomp_lu.py +++ b/dpnp/scipy/linalg/_decomp_lu.py @@ -51,11 +51,6 @@ dpnp_lu_solve, ) -__all__ = [ - "lu_factor", - "lu_solve", -] - def lu_factor(a, overwrite_a=False, check_finite=True): """ diff --git a/dpnp/scipy/linalg/_utils.py b/dpnp/scipy/linalg/_utils.py index 274a3593f2c..be736e076d8 100644 --- a/dpnp/scipy/linalg/_utils.py +++ b/dpnp/scipy/linalg/_utils.py @@ -51,11 +51,6 @@ from dpnp.dpnp_utils import get_usm_allocations from dpnp.linalg.dpnp_utils_linalg import _common_type -__all__ = [ - "dpnp_lu_factor", - "dpnp_lu_solve", -] - def _align_lu_solve_broadcast(lu, b): """Align LU and RHS batch dimensions with SciPy-like rules.""" diff --git a/dpnp/scipy/special/_erf.py b/dpnp/scipy/special/_erf.py index f9699aa79a6..693b7574386 100644 --- a/dpnp/scipy/special/_erf.py +++ b/dpnp/scipy/special/_erf.py @@ -44,8 +44,6 @@ import dpnp.backend.extensions.ufunc._ufunc_impl as ufi from dpnp.dpnp_algo.dpnp_elementwise_common import DPNPUnaryFunc -__all__ = ["erf", "erfc", "erfcinv", "erfcx", "erfinv"] - # pylint: disable=too-few-public-methods class DPNPErf(DPNPUnaryFunc):