csc.py 838 B

12345678910111213141516171819202122232425262728293031323334
  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 _csc
  6. __all__ = [ # noqa: F822
  7. 'csc_matrix',
  8. 'csc_tocsr',
  9. 'expandptr',
  10. 'get_index_dtype',
  11. 'isspmatrix_csc',
  12. 'spmatrix',
  13. 'upcast',
  14. ]
  15. def __dir__():
  16. return __all__
  17. def __getattr__(name):
  18. if name not in __all__:
  19. raise AttributeError(
  20. "scipy.sparse.csc is deprecated and has no attribute "
  21. f"{name}. Try looking in scipy.sparse instead.")
  22. warnings.warn(f"Please use `{name}` from the `scipy.sparse` namespace, "
  23. "the `scipy.sparse.csc` namespace is deprecated.",
  24. category=DeprecationWarning, stacklevel=2)
  25. return getattr(_csc, name)