extract.py 781 B

12345678910111213141516171819202122232425262728293031
  1. # This file is not meant for public use and will be removed in SciPy v2.0.0.
  2. # Use the `scipy.sparse` namespace for importing the functions
  3. # included below.
  4. import warnings
  5. from . import _extract
  6. __all__ = [ # noqa: F822
  7. 'coo_matrix',
  8. 'find',
  9. 'tril',
  10. 'triu',
  11. ]
  12. def __dir__():
  13. return __all__
  14. def __getattr__(name):
  15. if name not in __all__:
  16. raise AttributeError(
  17. "scipy.sparse.extract is deprecated and has no attribute "
  18. f"{name}. Try looking in scipy.sparse instead.")
  19. warnings.warn(f"Please use `{name}` from the `scipy.sparse` namespace, "
  20. "the `scipy.sparse.extract` namespace is deprecated.",
  21. category=DeprecationWarning, stacklevel=2)
  22. return getattr(_extract, name)