Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/scipy/sparse/coo.py: 70%

10 statements  

« prev     ^ index     » next       coverage.py v7.3.2, created at 2023-12-12 06:31 +0000

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 

5import warnings 

6from . import _coo 

7 

8 

9__all__ = [ # noqa: F822 

10 'SparseEfficiencyWarning', 

11 'check_reshape_kwargs', 

12 'check_shape', 

13 'coo_matrix', 

14 'coo_matvec', 

15 'coo_tocsr', 

16 'coo_todense', 

17 'downcast_intp_index', 

18 'get_index_dtype', 

19 'getdata', 

20 'getdtype', 

21 'isshape', 

22 'isspmatrix', 

23 'isspmatrix_coo', 

24 'operator', 

25 'spmatrix', 

26 'to_native', 

27 'upcast', 

28 'upcast_char', 

29 'warn', 

30] 

31 

32 

33def __dir__(): 

34 return __all__ 

35 

36 

37def __getattr__(name): 

38 if name not in __all__: 

39 raise AttributeError( 

40 "scipy.sparse.coo is deprecated and has no attribute " 

41 f"{name}. Try looking in scipy.sparse instead.") 

42 

43 warnings.warn(f"Please use `{name}` from the `scipy.sparse` namespace, " 

44 "the `scipy.sparse.coo` namespace is deprecated.", 

45 category=DeprecationWarning, stacklevel=2) 

46 

47 return getattr(_coo, name)