Skip to content

Commit 1526a53

Browse files
Use eager import for dpnp.scipy
1 parent c624329 commit 1526a53

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

dpnp/__init__.py

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -71,25 +71,12 @@
7171
from .dpnp_iface_utils import *
7272
from .dpnp_iface_utils import __all__ as _ifaceutils__all__
7373
from ._version import get_versions
74+
from . import scipy as scipy
7475

7576
__all__ = _iface__all__
7677
__all__ += _ifaceutils__all__
78+
__all__ += ["scipy"]
7779

7880

79-
# expose dpnp.scipy submodule lazily (PEP 562)
80-
def __getattr__(name):
81-
if name == "scipy":
82-
mod = import_module("dpnp.scipy")
83-
globals()["scipy"] = mod
84-
return mod
85-
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
86-
87-
88-
# make "scipy" visible in dir(dpnp) and star-imports
89-
try:
90-
__all__.append("scipy")
91-
except Exception:
92-
pass
93-
9481
__version__ = get_versions()["version"]
9582
del get_versions

0 commit comments

Comments
 (0)