Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/scipy/_lib/uarray.py: 57%

14 statements  

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

1"""`uarray` provides functions for generating multimethods that dispatch to 

2multiple different backends 

3 

4This should be imported, rather than `_uarray` so that an installed version could 

5be used instead, if available. This means that users can call 

6`uarray.set_backend` directly instead of going through SciPy. 

7 

8""" 

9 

10 

11# Prefer an installed version of uarray, if available 

12try: 

13 import uarray as _uarray 

14except ImportError: 

15 _has_uarray = False 

16else: 

17 from scipy._lib._pep440 import Version as _Version 

18 

19 _has_uarray = _Version(_uarray.__version__) >= _Version("0.8") 

20 del _uarray 

21 del _Version 

22 

23 

24if _has_uarray: 

25 from uarray import * 

26 from uarray import _Function 

27else: 

28 from ._uarray import * 

29 from ._uarray import _Function 

30 

31del _has_uarray