Skip to content

Commit 8704ec9

Browse files
authored
Merge pull request #177 from IntelPython/remove-star-import-in-init
Remove star import and add `__all__`
2 parents f109abf + 397ef79 commit 8704ec9

2 files changed

Lines changed: 129 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
### Added
99
* 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)
1010

11+
### Changed
12+
* Import ufuncs explicitly in `__init__.py` and add `__all__` to module [gh-177](https://github.com/IntelPython/mkl_umath/pull/177)
13+
1114
### Fixed
1215
* Build with ICX compiler from 2026.0 release [gh-155](https://github.com/IntelPython/mkl_umath/pull/155)
1316
* `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)

mkl_umath/__init__.py

Lines changed: 126 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,133 @@
3737
restore_numpy_umath,
3838
use_in_numpy,
3939
)
40-
from ._ufuncs import *
40+
from ._ufuncs import (
41+
absolute,
42+
add,
43+
arccos,
44+
arccosh,
45+
arcsin,
46+
arcsinh,
47+
arctan,
48+
arctanh,
49+
cbrt,
50+
ceil,
51+
conjugate,
52+
copysign,
53+
cos,
54+
cosh,
55+
divide,
56+
equal,
57+
exp,
58+
exp2,
59+
expm1,
60+
fabs,
61+
floor,
62+
fmax,
63+
fmin,
64+
frexp,
65+
greater,
66+
greater_equal,
67+
isfinite,
68+
isinf,
69+
isnan,
70+
ldexp,
71+
less,
72+
less_equal,
73+
log,
74+
log1p,
75+
log2,
76+
log10,
77+
logical_and,
78+
logical_not,
79+
logical_or,
80+
logical_xor,
81+
modf,
82+
multiply,
83+
negative,
84+
nextafter,
85+
not_equal,
86+
positive,
87+
reciprocal,
88+
rint,
89+
sign,
90+
sin,
91+
sinh,
92+
spacing,
93+
sqrt,
94+
square,
95+
subtract,
96+
tan,
97+
tanh,
98+
trunc,
99+
)
41100
from ._version import __version__
42101

43-
# TODO: add __all__ with public API and remove star imports
102+
__all__ = [
103+
"absolute",
104+
"add",
105+
"arccos",
106+
"arccosh",
107+
"arcsin",
108+
"arcsinh",
109+
"arctan",
110+
"arctanh",
111+
"cbrt",
112+
"ceil",
113+
"conjugate",
114+
"copysign",
115+
"cos",
116+
"cosh",
117+
"divide",
118+
"equal",
119+
"exp",
120+
"exp2",
121+
"expm1",
122+
"fabs",
123+
"floor",
124+
"fmax",
125+
"fmin",
126+
"frexp",
127+
"greater",
128+
"greater_equal",
129+
"isfinite",
130+
"isinf",
131+
"isnan",
132+
"ldexp",
133+
"less",
134+
"less_equal",
135+
"log",
136+
"log10",
137+
"log1p",
138+
"log2",
139+
"logical_and",
140+
"logical_not",
141+
"logical_or",
142+
"logical_xor",
143+
"modf",
144+
"multiply",
145+
"negative",
146+
"nextafter",
147+
"not_equal",
148+
"positive",
149+
"reciprocal",
150+
"rint",
151+
"sign",
152+
"sin",
153+
"sinh",
154+
"spacing",
155+
"sqrt",
156+
"square",
157+
"subtract",
158+
"tan",
159+
"tanh",
160+
"trunc",
161+
"is_patched",
162+
"mkl_umath",
163+
"patch_numpy_umath",
164+
"restore",
165+
"restore_numpy_umath",
166+
"use_in_numpy",
167+
]
44168

45169
del _init_helper

0 commit comments

Comments
 (0)