decomp.py 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. # This file is not meant for public use and will be removed in SciPy v2.0.0.
  2. # Use the `scipy.linalg` namespace for importing the functions
  3. # included below.
  4. import warnings
  5. from . import _decomp
  6. __all__ = [ # noqa: F822
  7. 'eig', 'eigvals', 'eigh', 'eigvalsh',
  8. 'eig_banded', 'eigvals_banded',
  9. 'eigh_tridiagonal', 'eigvalsh_tridiagonal', 'hessenberg', 'cdf2rdf',
  10. 'array', 'isfinite', 'inexact', 'nonzero', 'iscomplexobj', 'cast',
  11. 'flatnonzero', 'argsort', 'iscomplex', 'einsum', 'eye', 'inf',
  12. 'LinAlgError', 'norm', 'get_lapack_funcs'
  13. ]
  14. def __dir__():
  15. return __all__
  16. def __getattr__(name):
  17. if name not in __all__:
  18. raise AttributeError(
  19. "scipy.linalg.decomp is deprecated and has no attribute "
  20. f"{name}. Try looking in scipy.linalg instead.")
  21. warnings.warn(f"Please use `{name}` from the `scipy.linalg` namespace, "
  22. "the `scipy.linalg.decomp` namespace is deprecated.",
  23. category=DeprecationWarning, stacklevel=2)
  24. return getattr(_decomp, name)