diff --git a/klamath/records.py b/klamath/records.py index d5ac938..b05bb04 100644 --- a/klamath/records.py +++ b/klamath/records.py @@ -173,6 +173,8 @@ class GENERATIONS(Int2Record): @classmethod def check_data(cls: type[Self], data: NDArray[numpy.integer] | Sequence[int] | int) -> None: + if isinstance(data, (int, numpy.integer)): + return if not isinstance(data, Sized) or len(data) != 1: raise KlamathError(f'Expected exactly one integer, got {data}') @@ -270,6 +272,8 @@ class FORMAT(Int2Record): @classmethod def check_data(cls: type[Self], data: NDArray[numpy.integer] | Sequence[int] | int) -> None: + if isinstance(data, (int, numpy.integer)): + return if not isinstance(data, Sized) or len(data) != 1: raise KlamathError(f'Expected exactly one integer, got {data}')