From 6df5329e16d4e401e3fa26f1f6015e76605d818d Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Thu, 19 Mar 2026 00:44:16 -0700 Subject: [PATCH 1/2] Remove star import and add __all__ --- mkl_umath/__init__.py | 128 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 126 insertions(+), 2 deletions(-) diff --git a/mkl_umath/__init__.py b/mkl_umath/__init__.py index d060399..71b50b1 100644 --- a/mkl_umath/__init__.py +++ b/mkl_umath/__init__.py @@ -37,9 +37,133 @@ restore_numpy_umath, use_in_numpy, ) -from ._ufuncs import * +from ._ufuncs import ( + absolute, + add, + arccos, + arccosh, + arcsin, + arcsinh, + arctan, + arctanh, + cbrt, + ceil, + conjugate, + copysign, + cos, + cosh, + divide, + equal, + exp, + exp2, + expm1, + fabs, + floor, + fmax, + fmin, + frexp, + greater, + greater_equal, + isfinite, + isinf, + isnan, + ldexp, + less, + less_equal, + log, + log1p, + log2, + log10, + logical_and, + logical_not, + logical_or, + logical_xor, + modf, + multiply, + negative, + nextafter, + not_equal, + positive, + reciprocal, + rint, + sign, + sin, + sinh, + spacing, + sqrt, + square, + subtract, + tan, + tanh, + trunc, +) from ._version import __version__ -# TODO: add __all__ with public API and remove star imports +__all__ = [ + "absolute", + "add", + "arccos", + "arccosh", + "arcsin", + "arcsinh", + "arctan", + "arctanh", + "cbrt", + "ceil", + "conjugate", + "copysign", + "cos", + "cosh", + "divide", + "equal", + "exp", + "exp2", + "expm1", + "fabs", + "floor", + "fmax", + "fmin", + "frexp", + "greater", + "greater_equal", + "isfinite", + "isinf", + "isnan", + "ldexp", + "less", + "less_equal", + "log", + "log10", + "log1p", + "log2", + "logical_and", + "logical_not", + "logical_or", + "logical_xor", + "modf", + "multiply", + "negative", + "nextafter", + "not_equal", + "positive", + "reciprocal", + "rint", + "sign", + "sin", + "sinh", + "spacing", + "sqrt", + "square", + "subtract", + "tan", + "tanh", + "trunc", + "is_patched", + "mkl_umath", + "patch_numpy_umath", + "restore", + "restore_numpy_umath", + "use_in_numpy", +] del _init_helper From 397ef79f99225472e022a7ba9ef8bd7444eecff8 Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Thu, 19 Mar 2026 00:47:35 -0700 Subject: [PATCH 2/2] add gh-177 to changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7333b3..a976b29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added * Added `patch_numpy_umath` and `restore_numpy_umath` functions for patching NumPy, and improved the patching implementation [gh-170](https://github.com/IntelPython/mkl_umath/pull/170) +### Changed +* Import ufuncs explicitly in `__init__.py` and add `__all__` to module [gh-177](https://github.com/IntelPython/mkl_umath/pull/177) + ### Fixed * Build with ICX compiler from 2026.0 release [gh-155](https://github.com/IntelPython/mkl_umath/pull/155) * `mkl_umath` now uses `intel_thread` for MKL threading to fix transient crashes during Python teardown when used in an environment with PyPI NumPy [gh-171](https://github.com/IntelPython/mkl_umath/pull/171)