Coverage for /var/srv/projects/api.amasfac.comuna18.com/tmp/venv/lib/python3.9/site-packages/pandas/compat/numpy/__init__.py: 79%

15 statements  

« prev     ^ index     » next       coverage.py v6.4.4, created at 2023-07-17 14:22 -0600

1""" support numpy compatibility across versions """ 

2import numpy as np 

3 

4from pandas.util.version import Version 

5 

6# numpy versioning 

7_np_version = np.__version__ 

8_nlv = Version(_np_version) 

9np_version_under1p21 = _nlv < Version("1.21") 

10np_version_under1p22 = _nlv < Version("1.22") 

11np_version_gte1p22 = _nlv >= Version("1.22") 

12is_numpy_dev = _nlv.dev is not None 

13_min_numpy_ver = "1.20.3" 

14 

15if is_numpy_dev or not np_version_under1p22: 15 ↛ 18line 15 didn't jump to line 18, because the condition on line 15 was never false

16 np_percentile_argname = "method" 

17else: 

18 np_percentile_argname = "interpolation" 

19 

20 

21if _nlv < Version(_min_numpy_ver): 21 ↛ 22line 21 didn't jump to line 22, because the condition on line 21 was never true

22 raise ImportError( 

23 f"this version of pandas is incompatible with numpy < {_min_numpy_ver}\n" 

24 f"your numpy version is {_np_version}.\n" 

25 f"Please upgrade numpy to >= {_min_numpy_ver} to use this pandas version" 

26 ) 

27 

28 

29__all__ = [ 

30 "np", 

31 "_np_version", 

32 "is_numpy_dev", 

33]