Skip to content

Commit 8e76f4e

Browse files
committed
Fix type for numpy random in tests
1 parent bc4fccd commit 8e76f4e

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

.pre-commit-config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ repos:
2323
rev: v1.5.0
2424
hooks:
2525
- id: mypy
26-
exclude: ^test/
2726
additional_dependencies: [ numpy >= 1.22]
2827
# local uses the user-installed pylint, this allows dependency checking
2928
- repo: local

cmdstanpy/cmdstan_args.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ def __init__(
643643
PathfinderArgs,
644644
],
645645
data: Union[Mapping[str, Any], str, None] = None,
646-
seed: Union[int, list[int], None] = None,
646+
seed: Union[int, np.integer, list[int], list[np.integer], None] = None,
647647
inits: Union[int, float, str, list[str], None] = None,
648648
output_dir: OptionalPath = None,
649649
sig_figs: Optional[int] = None,

test/test_cmdstan_args.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ def test_args_good() -> None:
345345

346346
# integer type
347347
rng = np.random.default_rng(42)
348-
seed = int(rng.integers(low=0, high=int(1e7)))
348+
seed: np.integer = rng.integers(low=0, high=int(1e7)) # type: ignore
349349
assert not isinstance(seed, int)
350350
assert isinstance(seed, np.integer)
351351

0 commit comments

Comments
 (0)