lil.py 981 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 _lil
  6. __all__ = [ # noqa: F822
  7. 'INT_TYPES',
  8. 'IndexMixin',
  9. 'bisect_left',
  10. 'check_reshape_kwargs',
  11. 'check_shape',
  12. 'get_index_dtype',
  13. 'getdtype',
  14. 'isscalarlike',
  15. 'isshape',
  16. 'isspmatrix',
  17. 'isspmatrix_lil',
  18. 'lil_matrix',
  19. 'spmatrix',
  20. 'upcast_scalar',
  21. ]
  22. def __dir__():
  23. return __all__
  24. def __getattr__(name):
  25. if name not in __all__:
  26. raise AttributeError(
  27. "scipy.sparse.lil is deprecated and has no attribute "
  28. f"{name}. Try looking in scipy.sparse instead.")
  29. warnings.warn(f"Please use `{name}` from the `scipy.sparse` namespace, "
  30. "the `scipy.sparse.lil` namespace is deprecated.",
  31. category=DeprecationWarning, stacklevel=2)
  32. return getattr(_lil, name)