base.py 1016 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 _base
  6. __all__ = [ # noqa: F822
  7. 'MAXPRINT',
  8. 'SparseEfficiencyWarning',
  9. 'SparseFormatWarning',
  10. 'SparseWarning',
  11. 'asmatrix',
  12. 'check_reshape_kwargs',
  13. 'check_shape',
  14. 'get_sum_dtype',
  15. 'isdense',
  16. 'isintlike',
  17. 'isscalarlike',
  18. 'issparse',
  19. 'isspmatrix',
  20. 'spmatrix',
  21. 'validateaxis',
  22. ]
  23. def __dir__():
  24. return __all__
  25. def __getattr__(name):
  26. if name not in __all__:
  27. raise AttributeError(
  28. "scipy.sparse.base is deprecated and has no attribute "
  29. f"{name}. Try looking in scipy.sparse instead.")
  30. warnings.warn(f"Please use `{name}` from the `scipy.sparse` namespace, "
  31. "the `scipy.sparse.base` namespace is deprecated.",
  32. category=DeprecationWarning, stacklevel=2)
  33. return getattr(_base, name)