sparsetools.py 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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 _sparsetools
  6. __all__ = [ # noqa: F822
  7. 'bsr_diagonal',
  8. 'bsr_eldiv_bsr',
  9. 'bsr_elmul_bsr',
  10. 'bsr_ge_bsr',
  11. 'bsr_gt_bsr',
  12. 'bsr_le_bsr',
  13. 'bsr_lt_bsr',
  14. 'bsr_matmat',
  15. 'bsr_matvec',
  16. 'bsr_matvecs',
  17. 'bsr_maximum_bsr',
  18. 'bsr_minimum_bsr',
  19. 'bsr_minus_bsr',
  20. 'bsr_ne_bsr',
  21. 'bsr_plus_bsr',
  22. 'bsr_scale_columns',
  23. 'bsr_scale_rows',
  24. 'bsr_sort_indices',
  25. 'bsr_tocsr',
  26. 'bsr_transpose',
  27. 'coo_matvec',
  28. 'coo_tocsr',
  29. 'coo_todense',
  30. 'cs_graph_components',
  31. 'csc_diagonal',
  32. 'csc_eldiv_csc',
  33. 'csc_elmul_csc',
  34. 'csc_ge_csc',
  35. 'csc_gt_csc',
  36. 'csc_le_csc',
  37. 'csc_lt_csc',
  38. 'csc_matmat',
  39. 'csc_matmat_maxnnz',
  40. 'csc_matvec',
  41. 'csc_matvecs',
  42. 'csc_maximum_csc',
  43. 'csc_minimum_csc',
  44. 'csc_minus_csc',
  45. 'csc_ne_csc',
  46. 'csc_plus_csc',
  47. 'csc_tocsr',
  48. 'csr_column_index1',
  49. 'csr_column_index2',
  50. 'csr_count_blocks',
  51. 'csr_diagonal',
  52. 'csr_eldiv_csr',
  53. 'csr_eliminate_zeros',
  54. 'csr_elmul_csr',
  55. 'csr_ge_csr',
  56. 'csr_gt_csr',
  57. 'csr_has_canonical_format',
  58. 'csr_has_sorted_indices',
  59. 'csr_hstack',
  60. 'csr_le_csr',
  61. 'csr_lt_csr',
  62. 'csr_matmat',
  63. 'csr_matmat_maxnnz',
  64. 'csr_matvec',
  65. 'csr_matvecs',
  66. 'csr_maximum_csr',
  67. 'csr_minimum_csr',
  68. 'csr_minus_csr',
  69. 'csr_ne_csr',
  70. 'csr_plus_csr',
  71. 'csr_row_index',
  72. 'csr_row_slice',
  73. 'csr_sample_offsets',
  74. 'csr_sample_values',
  75. 'csr_scale_columns',
  76. 'csr_scale_rows',
  77. 'csr_sort_indices',
  78. 'csr_sum_duplicates',
  79. 'csr_tobsr',
  80. 'csr_tocsc',
  81. 'csr_todense',
  82. 'dia_matvec',
  83. 'expandptr',
  84. 'get_csr_submatrix',
  85. 'test_throw_error',
  86. ]
  87. def __dir__():
  88. return __all__
  89. def __getattr__(name):
  90. if name not in __all__:
  91. raise AttributeError(
  92. "scipy.sparse.sparsetools is deprecated and has no attribute "
  93. f"{name}. Try looking in scipy.sparse instead.")
  94. warnings.warn(f"Please use `{name}` from the `scipy.sparse` namespace, "
  95. "the `scipy.sparse.sparsetools` namespace is deprecated.",
  96. category=DeprecationWarning, stacklevel=2)
  97. return getattr(_sparsetools, name)