bsr.py 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 _bsr
  6. __all__ = [ # noqa: F822
  7. 'bsr_matmat',
  8. 'bsr_matrix',
  9. 'bsr_matvec',
  10. 'bsr_matvecs',
  11. 'bsr_sort_indices',
  12. 'bsr_tocsr',
  13. 'bsr_transpose',
  14. 'check_shape',
  15. 'csr_matmat_maxnnz',
  16. 'get_index_dtype',
  17. 'getdata',
  18. 'getdtype',
  19. 'isshape',
  20. 'isspmatrix',
  21. 'isspmatrix_bsr',
  22. 'spmatrix',
  23. 'to_native',
  24. 'upcast',
  25. 'warn',
  26. ]
  27. def __dir__():
  28. return __all__
  29. def __getattr__(name):
  30. if name not in __all__:
  31. raise AttributeError(
  32. "scipy.sparse.bsr is deprecated and has no attribute "
  33. f"{name}. Try looking in scipy.sparse instead.")
  34. warnings.warn(f"Please use `{name}` from the `scipy.sparse` namespace, "
  35. "the `scipy.sparse.bsr` namespace is deprecated.",
  36. category=DeprecationWarning, stacklevel=2)
  37. return getattr(_bsr, name)