Coverage for src/pqlattice/typing/_types.py: 82%

11 statements  

« prev     ^ index     » next       coverage.py v7.11.0, created at 2026-01-12 21:36 +0100

1from fractions import Fraction 

2from typing import Any 

3 

4from numpy.typing import NDArray 

5 

6type Array = NDArray[Any] 

7 

8type Vector = NDArray[Any] 

9type Matrix = NDArray[Any] 

10type SquareMatrix = NDArray[Any] 

11 

12 

13def is_rational(a: Array) -> bool: 

14 return isinstance(a.flat[0], Fraction) 

15 

16 

17def is_integer(a: Array) -> bool: 

18 return isinstance(a.flat[0], int)