compressed.py 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 _compressed
  6. __all__ = [ # noqa: F822
  7. 'IndexMixin',
  8. 'SparseEfficiencyWarning',
  9. 'check_shape',
  10. 'csr_column_index1',
  11. 'csr_column_index2',
  12. 'csr_row_index',
  13. 'csr_row_slice',
  14. 'csr_sample_offsets',
  15. 'csr_sample_values',
  16. 'csr_todense',
  17. 'downcast_intp_index',
  18. 'get_csr_submatrix',
  19. 'get_index_dtype',
  20. 'get_sum_dtype',
  21. 'getdtype',
  22. 'is_pydata_spmatrix',
  23. 'isdense',
  24. 'isintlike',
  25. 'isscalarlike',
  26. 'isshape',
  27. 'isspmatrix',
  28. 'operator',
  29. 'spmatrix',
  30. 'to_native',
  31. 'upcast',
  32. 'upcast_char',
  33. 'warn',
  34. ]
  35. def __dir__():
  36. return __all__
  37. def __getattr__(name):
  38. if name not in __all__:
  39. raise AttributeError(
  40. "scipy.sparse.compressed is deprecated and has no attribute "
  41. f"{name}. Try looking in scipy.sparse instead.")
  42. warnings.warn(f"Please use `{name}` from the `scipy.sparse` namespace, "
  43. "the `scipy.sparse.compressed` namespace is deprecated.",
  44. category=DeprecationWarning, stacklevel=2)
  45. return getattr(_compressed, name)