From 2e92a52bc523cf9eec245c01fdea01ce12dfbf9f Mon Sep 17 00:00:00 2001 From: Kevin Sheppard Date: Sat, 20 Feb 2021 01:05:33 +0000 Subject: ENH: Add tests for RandomState --- numpy/random/mtrand.pyi | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'numpy/random') diff --git a/numpy/random/mtrand.pyi b/numpy/random/mtrand.pyi index 91c8d84a4..f088a3929 100644 --- a/numpy/random/mtrand.pyi +++ b/numpy/random/mtrand.pyi @@ -1,3 +1,4 @@ +from numpy.random.bit_generator import BitGenerator import sys from typing import Any, Callable, Dict, Literal, Optional, Sequence, Tuple, Type, Union, overload @@ -69,7 +70,7 @@ _DTypeLikeFloat64 = Union[ class RandomState: _bit_generator: BitGenerator - def __init__(self, seed: Union[None, _ArrayLikeInt_co, SeedSequence] = ...) -> None: ... + def __init__(self, seed: Union[None, _ArrayLikeInt_co, BitGenerator] = ...) -> None: ... def __repr__(self) -> str: ... def __str__(self) -> str: ... def __getstate__(self) -> Dict[str, Any]: ... @@ -113,6 +114,7 @@ class RandomState: def tomaxint(self, size: None = ...) -> int: ... # type: ignore[misc] @overload def tomaxint(self, size: _ShapeLike = ...) -> ndarray[Any, dtype[int_]]: ... + @overload def randint( # type: ignore[misc] self, low: int, @@ -149,7 +151,7 @@ class RandomState: low: _ArrayLikeInt_co, high: Optional[_ArrayLikeInt_co] = ..., size: Optional[_ShapeLike] = ..., - ) -> ndarray[Any, dtype[int64]]: ... + ) -> ndarray[Any, dtype[int_]]: ... @overload def randint( # type: ignore[misc] self, @@ -293,11 +295,11 @@ class RandomState: @overload def rand(self, *args: None) -> float: ... @overload - def rand(self, *args: Sequence[int]) -> ndarray[Any, dtype[float64]]: ... + def rand(self, *args: int) -> ndarray[Any, dtype[float64]]: ... @overload def randn(self, *args: None) -> float: ... @overload - def randn(self, *args: Sequence[int]) -> ndarray[Any, dtype[float64]]: ... + def randn(self, *args: int) -> ndarray[Any, dtype[float64]]: ... @overload def random_integers(self, low: int, high: Optional[int] = ..., size: None = ...) -> int: ... # type: ignore[misc] @overload -- cgit v1.2.1