Coverage for /usr/local/lib/python3.10/dist-packages/Adifpy/differentiate/helpers.py: 100%

9 statements  

« prev     ^ index     » next       coverage.py v6.5.0, created at 2022-12-07 00:47 -0500

1import numpy as np 

2 

3 

4def isscalar(x): 

5 try: 

6 float(x) 

7 return True 

8 except (ValueError, TypeError): 

9 return False 

10 

11def isscalar_or_array(x): 

12 return isinstance(x, (np.ndarray, list)) or isscalar(x)