Initial configuration commit

This commit is contained in:
Alex Selimov 2023-10-24 22:54:55 -04:00
commit 31c8abea59
266 changed files with 780274 additions and 0 deletions

View file

@ -0,0 +1,16 @@
"""
This type stub file was generated by pyright.
"""
from numpy._pytesttester import PytestTester
from numpy.random._generator import Generator as Generator, default_rng as default_rng
from numpy.random._mt19937 import MT19937 as MT19937
from numpy.random._pcg64 import PCG64 as PCG64, PCG64DXSM as PCG64DXSM
from numpy.random._philox import Philox as Philox
from numpy.random._sfc64 import SFC64 as SFC64
from numpy.random.bit_generator import BitGenerator as BitGenerator, SeedSequence as SeedSequence
from numpy.random.mtrand import RandomState as RandomState, beta as beta, binomial as binomial, bytes as bytes, chisquare as chisquare, choice as choice, dirichlet as dirichlet, exponential as exponential, f as f, gamma as gamma, geometric as geometric, get_bit_generator as get_bit_generator, get_state as get_state, gumbel as gumbel, hypergeometric as hypergeometric, laplace as laplace, logistic as logistic, lognormal as lognormal, logseries as logseries, multinomial as multinomial, multivariate_normal as multivariate_normal, negative_binomial as negative_binomial, noncentral_chisquare as noncentral_chisquare, noncentral_f as noncentral_f, normal as normal, pareto as pareto, permutation as permutation, poisson as poisson, power as power, rand as rand, randint as randint, randn as randn, random as random, random_integers as random_integers, random_sample as random_sample, ranf as ranf, rayleigh as rayleigh, sample as sample, seed as seed, set_bit_generator as set_bit_generator, set_state as set_state, shuffle as shuffle, standard_cauchy as standard_cauchy, standard_exponential as standard_exponential, standard_gamma as standard_gamma, standard_normal as standard_normal, standard_t as standard_t, triangular as triangular, uniform as uniform, vonmises as vonmises, wald as wald, weibull as weibull, zipf as zipf
__all__: list[str]
__path__: list[str]
test: PytestTester

View file

@ -0,0 +1,469 @@
"""
This type stub file was generated by pyright.
"""
from collections.abc import Callable
from typing import Any, Literal, TypeVar, Union, overload
from numpy import bool_, dtype, float32, float64, int16, int32, int64, int8, int_, ndarray, uint, uint16, uint32, uint64, uint8
from numpy.random import BitGenerator, SeedSequence
from numpy._typing import ArrayLike, _ArrayLikeFloat_co, _ArrayLikeInt_co, _DTypeLikeBool, _DTypeLikeInt, _DTypeLikeUInt, _DoubleCodes, _Float32Codes, _Float64Codes, _FloatLike_co, _Int16Codes, _Int32Codes, _Int64Codes, _Int8Codes, _IntCodes, _ShapeLike, _SingleCodes, _SupportsDType, _UInt16Codes, _UInt32Codes, _UInt64Codes, _UInt8Codes, _UIntCodes
_ArrayType = TypeVar("_ArrayType", bound=ndarray[Any, Any])
_DTypeLikeFloat32 = Union[dtype[float32], _SupportsDType[dtype[float32]], type[float32], _Float32Codes, _SingleCodes,]
_DTypeLikeFloat64 = Union[dtype[float64], _SupportsDType[dtype[float64]], type[float], type[float64], _Float64Codes, _DoubleCodes,]
class Generator:
def __init__(self, bit_generator: BitGenerator) -> None:
...
def __repr__(self) -> str:
...
def __str__(self) -> str:
...
def __getstate__(self) -> dict[str, Any]:
...
def __setstate__(self, state: dict[str, Any]) -> None:
...
def __reduce__(self) -> tuple[Callable[[str], Generator], tuple[str], dict[str, Any]]:
...
@property
def bit_generator(self) -> BitGenerator:
...
def spawn(self, n_children: int) -> list[Generator]:
...
def bytes(self, length: int) -> bytes:
...
@overload
def standard_normal(self, size: None = ..., dtype: _DTypeLikeFloat32 | _DTypeLikeFloat64 = ..., out: None = ...) -> float:
...
@overload
def standard_normal(self, size: _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def standard_normal(self, *, out: ndarray[Any, dtype[float64]] = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def standard_normal(self, size: _ShapeLike = ..., dtype: _DTypeLikeFloat32 = ..., out: None | ndarray[Any, dtype[float32]] = ...) -> ndarray[Any, dtype[float32]]:
...
@overload
def standard_normal(self, size: _ShapeLike = ..., dtype: _DTypeLikeFloat64 = ..., out: None | ndarray[Any, dtype[float64]] = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def permutation(self, x: int, axis: int = ...) -> ndarray[Any, dtype[int64]]:
...
@overload
def permutation(self, x: ArrayLike, axis: int = ...) -> ndarray[Any, Any]:
...
@overload
def standard_exponential(self, size: None = ..., dtype: _DTypeLikeFloat32 | _DTypeLikeFloat64 = ..., method: Literal["zig", "inv"] = ..., out: None = ...) -> float:
...
@overload
def standard_exponential(self, size: _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def standard_exponential(self, *, out: ndarray[Any, dtype[float64]] = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def standard_exponential(self, size: _ShapeLike = ..., *, method: Literal["zig", "inv"] = ..., out: None | ndarray[Any, dtype[float64]] = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def standard_exponential(self, size: _ShapeLike = ..., dtype: _DTypeLikeFloat32 = ..., method: Literal["zig", "inv"] = ..., out: None | ndarray[Any, dtype[float32]] = ...) -> ndarray[Any, dtype[float32]]:
...
@overload
def standard_exponential(self, size: _ShapeLike = ..., dtype: _DTypeLikeFloat64 = ..., method: Literal["zig", "inv"] = ..., out: None | ndarray[Any, dtype[float64]] = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def random(self, size: None = ..., dtype: _DTypeLikeFloat32 | _DTypeLikeFloat64 = ..., out: None = ...) -> float:
...
@overload
def random(self, *, out: ndarray[Any, dtype[float64]] = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def random(self, size: _ShapeLike = ..., *, out: None | ndarray[Any, dtype[float64]] = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def random(self, size: _ShapeLike = ..., dtype: _DTypeLikeFloat32 = ..., out: None | ndarray[Any, dtype[float32]] = ...) -> ndarray[Any, dtype[float32]]:
...
@overload
def random(self, size: _ShapeLike = ..., dtype: _DTypeLikeFloat64 = ..., out: None | ndarray[Any, dtype[float64]] = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def beta(self, a: _FloatLike_co, b: _FloatLike_co, size: None = ...) -> float:
...
@overload
def beta(self, a: _ArrayLikeFloat_co, b: _ArrayLikeFloat_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def exponential(self, scale: _FloatLike_co = ..., size: None = ...) -> float:
...
@overload
def exponential(self, scale: _ArrayLikeFloat_co = ..., size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def integers(self, low: int, high: None | int = ...) -> int:
...
@overload
def integers(self, low: int, high: None | int = ..., size: None = ..., dtype: _DTypeLikeBool = ..., endpoint: bool = ...) -> bool:
...
@overload
def integers(self, low: int, high: None | int = ..., size: None = ..., dtype: _DTypeLikeInt | _DTypeLikeUInt = ..., endpoint: bool = ...) -> int:
...
@overload
def integers(self, low: _ArrayLikeInt_co, high: None | _ArrayLikeInt_co = ..., size: None | _ShapeLike = ...) -> ndarray[Any, dtype[int64]]:
...
@overload
def integers(self, low: _ArrayLikeInt_co, high: None | _ArrayLikeInt_co = ..., size: None | _ShapeLike = ..., dtype: _DTypeLikeBool = ..., endpoint: bool = ...) -> ndarray[Any, dtype[bool_]]:
...
@overload
def integers(self, low: _ArrayLikeInt_co, high: None | _ArrayLikeInt_co = ..., size: None | _ShapeLike = ..., dtype: dtype[int8] | type[int8] | _Int8Codes | _SupportsDType[dtype[int8]] = ..., endpoint: bool = ...) -> ndarray[Any, dtype[int8]]:
...
@overload
def integers(self, low: _ArrayLikeInt_co, high: None | _ArrayLikeInt_co = ..., size: None | _ShapeLike = ..., dtype: dtype[int16] | type[int16] | _Int16Codes | _SupportsDType[dtype[int16]] = ..., endpoint: bool = ...) -> ndarray[Any, dtype[int16]]:
...
@overload
def integers(self, low: _ArrayLikeInt_co, high: None | _ArrayLikeInt_co = ..., size: None | _ShapeLike = ..., dtype: dtype[int32] | type[int32] | _Int32Codes | _SupportsDType[dtype[int32]] = ..., endpoint: bool = ...) -> ndarray[Any, dtype[int32]]:
...
@overload
def integers(self, low: _ArrayLikeInt_co, high: None | _ArrayLikeInt_co = ..., size: None | _ShapeLike = ..., dtype: None | dtype[int64] | type[int64] | _Int64Codes | _SupportsDType[dtype[int64]] = ..., endpoint: bool = ...) -> ndarray[Any, dtype[int64]]:
...
@overload
def integers(self, low: _ArrayLikeInt_co, high: None | _ArrayLikeInt_co = ..., size: None | _ShapeLike = ..., dtype: dtype[uint8] | type[uint8] | _UInt8Codes | _SupportsDType[dtype[uint8]] = ..., endpoint: bool = ...) -> ndarray[Any, dtype[uint8]]:
...
@overload
def integers(self, low: _ArrayLikeInt_co, high: None | _ArrayLikeInt_co = ..., size: None | _ShapeLike = ..., dtype: dtype[uint16] | type[uint16] | _UInt16Codes | _SupportsDType[dtype[uint16]] = ..., endpoint: bool = ...) -> ndarray[Any, dtype[uint16]]:
...
@overload
def integers(self, low: _ArrayLikeInt_co, high: None | _ArrayLikeInt_co = ..., size: None | _ShapeLike = ..., dtype: dtype[uint32] | type[uint32] | _UInt32Codes | _SupportsDType[dtype[uint32]] = ..., endpoint: bool = ...) -> ndarray[Any, dtype[uint32]]:
...
@overload
def integers(self, low: _ArrayLikeInt_co, high: None | _ArrayLikeInt_co = ..., size: None | _ShapeLike = ..., dtype: dtype[uint64] | type[uint64] | _UInt64Codes | _SupportsDType[dtype[uint64]] = ..., endpoint: bool = ...) -> ndarray[Any, dtype[uint64]]:
...
@overload
def integers(self, low: _ArrayLikeInt_co, high: None | _ArrayLikeInt_co = ..., size: None | _ShapeLike = ..., dtype: dtype[int_] | type[int] | type[int_] | _IntCodes | _SupportsDType[dtype[int_]] = ..., endpoint: bool = ...) -> ndarray[Any, dtype[int_]]:
...
@overload
def integers(self, low: _ArrayLikeInt_co, high: None | _ArrayLikeInt_co = ..., size: None | _ShapeLike = ..., dtype: dtype[uint] | type[uint] | _UIntCodes | _SupportsDType[dtype[uint]] = ..., endpoint: bool = ...) -> ndarray[Any, dtype[uint]]:
...
@overload
def choice(self, a: int, size: None = ..., replace: bool = ..., p: None | _ArrayLikeFloat_co = ..., axis: int = ..., shuffle: bool = ...) -> int:
...
@overload
def choice(self, a: int, size: _ShapeLike = ..., replace: bool = ..., p: None | _ArrayLikeFloat_co = ..., axis: int = ..., shuffle: bool = ...) -> ndarray[Any, dtype[int64]]:
...
@overload
def choice(self, a: ArrayLike, size: None = ..., replace: bool = ..., p: None | _ArrayLikeFloat_co = ..., axis: int = ..., shuffle: bool = ...) -> Any:
...
@overload
def choice(self, a: ArrayLike, size: _ShapeLike = ..., replace: bool = ..., p: None | _ArrayLikeFloat_co = ..., axis: int = ..., shuffle: bool = ...) -> ndarray[Any, Any]:
...
@overload
def uniform(self, low: _FloatLike_co = ..., high: _FloatLike_co = ..., size: None = ...) -> float:
...
@overload
def uniform(self, low: _ArrayLikeFloat_co = ..., high: _ArrayLikeFloat_co = ..., size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def normal(self, loc: _FloatLike_co = ..., scale: _FloatLike_co = ..., size: None = ...) -> float:
...
@overload
def normal(self, loc: _ArrayLikeFloat_co = ..., scale: _ArrayLikeFloat_co = ..., size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def standard_gamma(self, shape: _FloatLike_co, size: None = ..., dtype: _DTypeLikeFloat32 | _DTypeLikeFloat64 = ..., out: None = ...) -> float:
...
@overload
def standard_gamma(self, shape: _ArrayLikeFloat_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def standard_gamma(self, shape: _ArrayLikeFloat_co, *, out: ndarray[Any, dtype[float64]] = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def standard_gamma(self, shape: _ArrayLikeFloat_co, size: None | _ShapeLike = ..., dtype: _DTypeLikeFloat32 = ..., out: None | ndarray[Any, dtype[float32]] = ...) -> ndarray[Any, dtype[float32]]:
...
@overload
def standard_gamma(self, shape: _ArrayLikeFloat_co, size: None | _ShapeLike = ..., dtype: _DTypeLikeFloat64 = ..., out: None | ndarray[Any, dtype[float64]] = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def gamma(self, shape: _FloatLike_co, scale: _FloatLike_co = ..., size: None = ...) -> float:
...
@overload
def gamma(self, shape: _ArrayLikeFloat_co, scale: _ArrayLikeFloat_co = ..., size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def f(self, dfnum: _FloatLike_co, dfden: _FloatLike_co, size: None = ...) -> float:
...
@overload
def f(self, dfnum: _ArrayLikeFloat_co, dfden: _ArrayLikeFloat_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def noncentral_f(self, dfnum: _FloatLike_co, dfden: _FloatLike_co, nonc: _FloatLike_co, size: None = ...) -> float:
...
@overload
def noncentral_f(self, dfnum: _ArrayLikeFloat_co, dfden: _ArrayLikeFloat_co, nonc: _ArrayLikeFloat_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def chisquare(self, df: _FloatLike_co, size: None = ...) -> float:
...
@overload
def chisquare(self, df: _ArrayLikeFloat_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def noncentral_chisquare(self, df: _FloatLike_co, nonc: _FloatLike_co, size: None = ...) -> float:
...
@overload
def noncentral_chisquare(self, df: _ArrayLikeFloat_co, nonc: _ArrayLikeFloat_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def standard_t(self, df: _FloatLike_co, size: None = ...) -> float:
...
@overload
def standard_t(self, df: _ArrayLikeFloat_co, size: None = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def standard_t(self, df: _ArrayLikeFloat_co, size: _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def vonmises(self, mu: _FloatLike_co, kappa: _FloatLike_co, size: None = ...) -> float:
...
@overload
def vonmises(self, mu: _ArrayLikeFloat_co, kappa: _ArrayLikeFloat_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def pareto(self, a: _FloatLike_co, size: None = ...) -> float:
...
@overload
def pareto(self, a: _ArrayLikeFloat_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def weibull(self, a: _FloatLike_co, size: None = ...) -> float:
...
@overload
def weibull(self, a: _ArrayLikeFloat_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def power(self, a: _FloatLike_co, size: None = ...) -> float:
...
@overload
def power(self, a: _ArrayLikeFloat_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def standard_cauchy(self, size: None = ...) -> float:
...
@overload
def standard_cauchy(self, size: _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def laplace(self, loc: _FloatLike_co = ..., scale: _FloatLike_co = ..., size: None = ...) -> float:
...
@overload
def laplace(self, loc: _ArrayLikeFloat_co = ..., scale: _ArrayLikeFloat_co = ..., size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def gumbel(self, loc: _FloatLike_co = ..., scale: _FloatLike_co = ..., size: None = ...) -> float:
...
@overload
def gumbel(self, loc: _ArrayLikeFloat_co = ..., scale: _ArrayLikeFloat_co = ..., size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def logistic(self, loc: _FloatLike_co = ..., scale: _FloatLike_co = ..., size: None = ...) -> float:
...
@overload
def logistic(self, loc: _ArrayLikeFloat_co = ..., scale: _ArrayLikeFloat_co = ..., size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def lognormal(self, mean: _FloatLike_co = ..., sigma: _FloatLike_co = ..., size: None = ...) -> float:
...
@overload
def lognormal(self, mean: _ArrayLikeFloat_co = ..., sigma: _ArrayLikeFloat_co = ..., size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def rayleigh(self, scale: _FloatLike_co = ..., size: None = ...) -> float:
...
@overload
def rayleigh(self, scale: _ArrayLikeFloat_co = ..., size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def wald(self, mean: _FloatLike_co, scale: _FloatLike_co, size: None = ...) -> float:
...
@overload
def wald(self, mean: _ArrayLikeFloat_co, scale: _ArrayLikeFloat_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def triangular(self, left: _FloatLike_co, mode: _FloatLike_co, right: _FloatLike_co, size: None = ...) -> float:
...
@overload
def triangular(self, left: _ArrayLikeFloat_co, mode: _ArrayLikeFloat_co, right: _ArrayLikeFloat_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def binomial(self, n: int, p: _FloatLike_co, size: None = ...) -> int:
...
@overload
def binomial(self, n: _ArrayLikeInt_co, p: _ArrayLikeFloat_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[int64]]:
...
@overload
def negative_binomial(self, n: _FloatLike_co, p: _FloatLike_co, size: None = ...) -> int:
...
@overload
def negative_binomial(self, n: _ArrayLikeFloat_co, p: _ArrayLikeFloat_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[int64]]:
...
@overload
def poisson(self, lam: _FloatLike_co = ..., size: None = ...) -> int:
...
@overload
def poisson(self, lam: _ArrayLikeFloat_co = ..., size: None | _ShapeLike = ...) -> ndarray[Any, dtype[int64]]:
...
@overload
def zipf(self, a: _FloatLike_co, size: None = ...) -> int:
...
@overload
def zipf(self, a: _ArrayLikeFloat_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[int64]]:
...
@overload
def geometric(self, p: _FloatLike_co, size: None = ...) -> int:
...
@overload
def geometric(self, p: _ArrayLikeFloat_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[int64]]:
...
@overload
def hypergeometric(self, ngood: int, nbad: int, nsample: int, size: None = ...) -> int:
...
@overload
def hypergeometric(self, ngood: _ArrayLikeInt_co, nbad: _ArrayLikeInt_co, nsample: _ArrayLikeInt_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[int64]]:
...
@overload
def logseries(self, p: _FloatLike_co, size: None = ...) -> int:
...
@overload
def logseries(self, p: _ArrayLikeFloat_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[int64]]:
...
def multivariate_normal(self, mean: _ArrayLikeFloat_co, cov: _ArrayLikeFloat_co, size: None | _ShapeLike = ..., check_valid: Literal["warn", "raise", "ignore"] = ..., tol: float = ..., *, method: Literal["svd", "eigh", "cholesky"] = ...) -> ndarray[Any, dtype[float64]]:
...
def multinomial(self, n: _ArrayLikeInt_co, pvals: _ArrayLikeFloat_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[int64]]:
...
def multivariate_hypergeometric(self, colors: _ArrayLikeInt_co, nsample: int, size: None | _ShapeLike = ..., method: Literal["marginals", "count"] = ...) -> ndarray[Any, dtype[int64]]:
...
def dirichlet(self, alpha: _ArrayLikeFloat_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
def permuted(self, x: ArrayLike, *, axis: None | int = ..., out: None | ndarray[Any, Any] = ...) -> ndarray[Any, Any]:
...
def shuffle(self, x: ArrayLike, axis: int = ...) -> None:
...
def default_rng(seed: None | _ArrayLikeInt_co | SeedSequence | BitGenerator | Generator = ...) -> Generator:
...

View file

@ -0,0 +1,38 @@
"""
This type stub file was generated by pyright.
"""
from typing import Any, TypedDict
from numpy import dtype, ndarray, uint32
from numpy.random.bit_generator import BitGenerator, SeedSequence
from numpy._typing import _ArrayLikeInt_co
class _MT19937Internal(TypedDict):
key: ndarray[Any, dtype[uint32]]
pos: int
...
class _MT19937State(TypedDict):
bit_generator: str
state: _MT19937Internal
...
class MT19937(BitGenerator):
def __init__(self, seed: None | _ArrayLikeInt_co | SeedSequence = ...) -> None:
...
def jumped(self, jumps: int = ...) -> MT19937:
...
@property
def state(self) -> _MT19937State:
...
@state.setter
def state(self, value: _MT19937State) -> None:
...

View file

@ -0,0 +1,62 @@
"""
This type stub file was generated by pyright.
"""
from typing import TypedDict
from numpy.random.bit_generator import BitGenerator, SeedSequence
from numpy._typing import _ArrayLikeInt_co
class _PCG64Internal(TypedDict):
state: int
inc: int
...
class _PCG64State(TypedDict):
bit_generator: str
state: _PCG64Internal
has_uint32: int
uinteger: int
...
class PCG64(BitGenerator):
def __init__(self, seed: None | _ArrayLikeInt_co | SeedSequence = ...) -> None:
...
def jumped(self, jumps: int = ...) -> PCG64:
...
@property
def state(self) -> _PCG64State:
...
@state.setter
def state(self, value: _PCG64State) -> None:
...
def advance(self, delta: int) -> PCG64:
...
class PCG64DXSM(BitGenerator):
def __init__(self, seed: None | _ArrayLikeInt_co | SeedSequence = ...) -> None:
...
def jumped(self, jumps: int = ...) -> PCG64DXSM:
...
@property
def state(self) -> _PCG64State:
...
@state.setter
def state(self, value: _PCG64State) -> None:
...
def advance(self, delta: int) -> PCG64DXSM:
...

View file

@ -0,0 +1,45 @@
"""
This type stub file was generated by pyright.
"""
from typing import Any, TypedDict
from numpy import dtype, ndarray, uint64
from numpy.random.bit_generator import BitGenerator, SeedSequence
from numpy._typing import _ArrayLikeInt_co
class _PhiloxInternal(TypedDict):
counter: ndarray[Any, dtype[uint64]]
key: ndarray[Any, dtype[uint64]]
...
class _PhiloxState(TypedDict):
bit_generator: str
state: _PhiloxInternal
buffer: ndarray[Any, dtype[uint64]]
buffer_pos: int
has_uint32: int
uinteger: int
...
class Philox(BitGenerator):
def __init__(self, seed: None | _ArrayLikeInt_co | SeedSequence = ..., counter: None | _ArrayLikeInt_co = ..., key: None | _ArrayLikeInt_co = ...) -> None:
...
@property
def state(self) -> _PhiloxState:
...
@state.setter
def state(self, value: _PhiloxState) -> None:
...
def jumped(self, jumps: int = ...) -> Philox:
...
def advance(self, delta: int) -> Philox:
...

View file

@ -0,0 +1,36 @@
"""
This type stub file was generated by pyright.
"""
from typing import Any, TypedDict
from numpy import dtype as dtype, ndarray as ndarray, uint64
from numpy.random.bit_generator import BitGenerator, SeedSequence
from numpy._typing import _ArrayLikeInt_co
class _SFC64Internal(TypedDict):
state: ndarray[Any, dtype[uint64]]
...
class _SFC64State(TypedDict):
bit_generator: str
state: _SFC64Internal
has_uint32: int
uinteger: int
...
class SFC64(BitGenerator):
def __init__(self, seed: None | _ArrayLikeInt_co | SeedSequence = ...) -> None:
...
@property
def state(self) -> _SFC64State:
...
@state.setter
def state(self, value: _SFC64State) -> None:
...

View file

@ -0,0 +1,131 @@
"""
This type stub file was generated by pyright.
"""
import abc
from threading import Lock
from collections.abc import Callable, Mapping, Sequence
from typing import Any, Literal, NamedTuple, TypeVar, TypedDict, Union, overload
from numpy import dtype, ndarray, uint32, uint64
from numpy._typing import _ArrayLikeInt_co, _ShapeLike, _SupportsDType, _UInt32Codes, _UInt64Codes
_T = TypeVar("_T")
_DTypeLikeUint32 = Union[dtype[uint32], _SupportsDType[dtype[uint32]], type[uint32], _UInt32Codes,]
_DTypeLikeUint64 = Union[dtype[uint64], _SupportsDType[dtype[uint64]], type[uint64], _UInt64Codes,]
class _SeedSeqState(TypedDict):
entropy: None | int | Sequence[int]
spawn_key: tuple[int, ...]
pool_size: int
n_children_spawned: int
...
class _Interface(NamedTuple):
state_address: Any
state: Any
next_uint64: Any
next_uint32: Any
next_double: Any
bit_generator: Any
...
class ISeedSequence(abc.ABC):
@abc.abstractmethod
def generate_state(self, n_words: int, dtype: _DTypeLikeUint32 | _DTypeLikeUint64 = ...) -> ndarray[Any, dtype[uint32 | uint64]]:
...
class ISpawnableSeedSequence(ISeedSequence):
@abc.abstractmethod
def spawn(self: _T, n_children: int) -> list[_T]:
...
class SeedlessSeedSequence(ISpawnableSeedSequence):
def generate_state(self, n_words: int, dtype: _DTypeLikeUint32 | _DTypeLikeUint64 = ...) -> ndarray[Any, dtype[uint32 | uint64]]:
...
def spawn(self: _T, n_children: int) -> list[_T]:
...
class SeedSequence(ISpawnableSeedSequence):
entropy: None | int | Sequence[int]
spawn_key: tuple[int, ...]
pool_size: int
n_children_spawned: int
pool: ndarray[Any, dtype[uint32]]
def __init__(self, entropy: None | int | Sequence[int] | _ArrayLikeInt_co = ..., *, spawn_key: Sequence[int] = ..., pool_size: int = ..., n_children_spawned: int = ...) -> None:
...
def __repr__(self) -> str:
...
@property
def state(self) -> _SeedSeqState:
...
def generate_state(self, n_words: int, dtype: _DTypeLikeUint32 | _DTypeLikeUint64 = ...) -> ndarray[Any, dtype[uint32 | uint64]]:
...
def spawn(self, n_children: int) -> list[SeedSequence]:
...
class BitGenerator(abc.ABC):
lock: Lock
def __init__(self, seed: None | _ArrayLikeInt_co | SeedSequence = ...) -> None:
...
def __getstate__(self) -> dict[str, Any]:
...
def __setstate__(self, state: dict[str, Any]) -> None:
...
def __reduce__(self) -> tuple[Callable[[str], BitGenerator], tuple[str], tuple[dict[str, Any]]]:
...
@abc.abstractmethod
@property
def state(self) -> Mapping[str, Any]:
...
@state.setter
def state(self, value: Mapping[str, Any]) -> None:
...
@property
def seed_seq(self) -> ISeedSequence:
...
def spawn(self, n_children: int) -> list[BitGenerator]:
...
@overload
def random_raw(self, size: None = ..., output: Literal[True] = ...) -> int:
...
@overload
def random_raw(self, size: _ShapeLike = ..., output: Literal[True] = ...) -> ndarray[Any, dtype[uint64]]:
...
@overload
def random_raw(self, size: None | _ShapeLike = ..., output: Literal[False] = ...) -> None:
...
@property
def ctypes(self) -> _Interface:
...
@property
def cffi(self) -> _Interface:
...

View file

@ -0,0 +1,513 @@
"""
This type stub file was generated by pyright.
"""
import builtins
from collections.abc import Callable
from typing import Any, Literal, Union, overload
from numpy import bool_, dtype, float32, float64, int16, int32, int64, int8, int_, ndarray, uint, uint16, uint32, uint64, uint8
from numpy.random.bit_generator import BitGenerator
from numpy._typing import ArrayLike, _ArrayLikeFloat_co, _ArrayLikeInt_co, _DTypeLikeBool, _DTypeLikeInt, _DTypeLikeUInt, _DoubleCodes, _Float32Codes, _Float64Codes, _Int16Codes, _Int32Codes, _Int64Codes, _Int8Codes, _IntCodes, _ShapeLike, _SingleCodes, _SupportsDType, _UInt16Codes, _UInt32Codes, _UInt64Codes, _UInt8Codes, _UIntCodes
_DTypeLikeFloat32 = Union[dtype[float32], _SupportsDType[dtype[float32]], type[float32], _Float32Codes, _SingleCodes,]
_DTypeLikeFloat64 = Union[dtype[float64], _SupportsDType[dtype[float64]], type[float], type[float64], _Float64Codes, _DoubleCodes,]
class RandomState:
_bit_generator: BitGenerator
def __init__(self, seed: None | _ArrayLikeInt_co | BitGenerator = ...) -> None:
...
def __repr__(self) -> str:
...
def __str__(self) -> str:
...
def __getstate__(self) -> dict[str, Any]:
...
def __setstate__(self, state: dict[str, Any]) -> None:
...
def __reduce__(self) -> tuple[Callable[[str], RandomState], tuple[str], dict[str, Any]]:
...
def seed(self, seed: None | _ArrayLikeFloat_co = ...) -> None:
...
@overload
def get_state(self, legacy: Literal[False] = ...) -> dict[str, Any]:
...
@overload
def get_state(self, legacy: Literal[True] = ...) -> dict[str, Any] | tuple[str, ndarray[Any, dtype[uint32]], int, int, float]:
...
def set_state(self, state: dict[str, Any] | tuple[str, ndarray[Any, dtype[uint32]], int, int, float]) -> None:
...
@overload
def random_sample(self, size: None = ...) -> float:
...
@overload
def random_sample(self, size: _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def random(self, size: None = ...) -> float:
...
@overload
def random(self, size: _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def beta(self, a: float, b: float, size: None = ...) -> float:
...
@overload
def beta(self, a: _ArrayLikeFloat_co, b: _ArrayLikeFloat_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def exponential(self, scale: float = ..., size: None = ...) -> float:
...
@overload
def exponential(self, scale: _ArrayLikeFloat_co = ..., size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def standard_exponential(self, size: None = ...) -> float:
...
@overload
def standard_exponential(self, size: _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def tomaxint(self, size: None = ...) -> int:
...
@overload
def tomaxint(self, size: _ShapeLike = ...) -> ndarray[Any, dtype[int_]]:
...
@overload
def randint(self, low: int, high: None | int = ...) -> int:
...
@overload
def randint(self, low: int, high: None | int = ..., size: None = ..., dtype: _DTypeLikeBool = ...) -> bool:
...
@overload
def randint(self, low: int, high: None | int = ..., size: None = ..., dtype: _DTypeLikeInt | _DTypeLikeUInt = ...) -> int:
...
@overload
def randint(self, low: _ArrayLikeInt_co, high: None | _ArrayLikeInt_co = ..., size: None | _ShapeLike = ...) -> ndarray[Any, dtype[int_]]:
...
@overload
def randint(self, low: _ArrayLikeInt_co, high: None | _ArrayLikeInt_co = ..., size: None | _ShapeLike = ..., dtype: _DTypeLikeBool = ...) -> ndarray[Any, dtype[bool_]]:
...
@overload
def randint(self, low: _ArrayLikeInt_co, high: None | _ArrayLikeInt_co = ..., size: None | _ShapeLike = ..., dtype: dtype[int8] | type[int8] | _Int8Codes | _SupportsDType[dtype[int8]] = ...) -> ndarray[Any, dtype[int8]]:
...
@overload
def randint(self, low: _ArrayLikeInt_co, high: None | _ArrayLikeInt_co = ..., size: None | _ShapeLike = ..., dtype: dtype[int16] | type[int16] | _Int16Codes | _SupportsDType[dtype[int16]] = ...) -> ndarray[Any, dtype[int16]]:
...
@overload
def randint(self, low: _ArrayLikeInt_co, high: None | _ArrayLikeInt_co = ..., size: None | _ShapeLike = ..., dtype: dtype[int32] | type[int32] | _Int32Codes | _SupportsDType[dtype[int32]] = ...) -> ndarray[Any, dtype[int32]]:
...
@overload
def randint(self, low: _ArrayLikeInt_co, high: None | _ArrayLikeInt_co = ..., size: None | _ShapeLike = ..., dtype: None | dtype[int64] | type[int64] | _Int64Codes | _SupportsDType[dtype[int64]] = ...) -> ndarray[Any, dtype[int64]]:
...
@overload
def randint(self, low: _ArrayLikeInt_co, high: None | _ArrayLikeInt_co = ..., size: None | _ShapeLike = ..., dtype: dtype[uint8] | type[uint8] | _UInt8Codes | _SupportsDType[dtype[uint8]] = ...) -> ndarray[Any, dtype[uint8]]:
...
@overload
def randint(self, low: _ArrayLikeInt_co, high: None | _ArrayLikeInt_co = ..., size: None | _ShapeLike = ..., dtype: dtype[uint16] | type[uint16] | _UInt16Codes | _SupportsDType[dtype[uint16]] = ...) -> ndarray[Any, dtype[uint16]]:
...
@overload
def randint(self, low: _ArrayLikeInt_co, high: None | _ArrayLikeInt_co = ..., size: None | _ShapeLike = ..., dtype: dtype[uint32] | type[uint32] | _UInt32Codes | _SupportsDType[dtype[uint32]] = ...) -> ndarray[Any, dtype[uint32]]:
...
@overload
def randint(self, low: _ArrayLikeInt_co, high: None | _ArrayLikeInt_co = ..., size: None | _ShapeLike = ..., dtype: dtype[uint64] | type[uint64] | _UInt64Codes | _SupportsDType[dtype[uint64]] = ...) -> ndarray[Any, dtype[uint64]]:
...
@overload
def randint(self, low: _ArrayLikeInt_co, high: None | _ArrayLikeInt_co = ..., size: None | _ShapeLike = ..., dtype: dtype[int_] | type[int] | type[int_] | _IntCodes | _SupportsDType[dtype[int_]] = ...) -> ndarray[Any, dtype[int_]]:
...
@overload
def randint(self, low: _ArrayLikeInt_co, high: None | _ArrayLikeInt_co = ..., size: None | _ShapeLike = ..., dtype: dtype[uint] | type[uint] | _UIntCodes | _SupportsDType[dtype[uint]] = ...) -> ndarray[Any, dtype[uint]]:
...
def bytes(self, length: int) -> builtins.bytes:
...
@overload
def choice(self, a: int, size: None = ..., replace: bool = ..., p: None | _ArrayLikeFloat_co = ...) -> int:
...
@overload
def choice(self, a: int, size: _ShapeLike = ..., replace: bool = ..., p: None | _ArrayLikeFloat_co = ...) -> ndarray[Any, dtype[int_]]:
...
@overload
def choice(self, a: ArrayLike, size: None = ..., replace: bool = ..., p: None | _ArrayLikeFloat_co = ...) -> Any:
...
@overload
def choice(self, a: ArrayLike, size: _ShapeLike = ..., replace: bool = ..., p: None | _ArrayLikeFloat_co = ...) -> ndarray[Any, Any]:
...
@overload
def uniform(self, low: float = ..., high: float = ..., size: None = ...) -> float:
...
@overload
def uniform(self, low: _ArrayLikeFloat_co = ..., high: _ArrayLikeFloat_co = ..., size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def rand(self) -> float:
...
@overload
def rand(self, *args: int) -> ndarray[Any, dtype[float64]]:
...
@overload
def randn(self) -> float:
...
@overload
def randn(self, *args: int) -> ndarray[Any, dtype[float64]]:
...
@overload
def random_integers(self, low: int, high: None | int = ..., size: None = ...) -> int:
...
@overload
def random_integers(self, low: _ArrayLikeInt_co, high: None | _ArrayLikeInt_co = ..., size: None | _ShapeLike = ...) -> ndarray[Any, dtype[int_]]:
...
@overload
def standard_normal(self, size: None = ...) -> float:
...
@overload
def standard_normal(self, size: _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def normal(self, loc: float = ..., scale: float = ..., size: None = ...) -> float:
...
@overload
def normal(self, loc: _ArrayLikeFloat_co = ..., scale: _ArrayLikeFloat_co = ..., size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def standard_gamma(self, shape: float, size: None = ...) -> float:
...
@overload
def standard_gamma(self, shape: _ArrayLikeFloat_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def gamma(self, shape: float, scale: float = ..., size: None = ...) -> float:
...
@overload
def gamma(self, shape: _ArrayLikeFloat_co, scale: _ArrayLikeFloat_co = ..., size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def f(self, dfnum: float, dfden: float, size: None = ...) -> float:
...
@overload
def f(self, dfnum: _ArrayLikeFloat_co, dfden: _ArrayLikeFloat_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def noncentral_f(self, dfnum: float, dfden: float, nonc: float, size: None = ...) -> float:
...
@overload
def noncentral_f(self, dfnum: _ArrayLikeFloat_co, dfden: _ArrayLikeFloat_co, nonc: _ArrayLikeFloat_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def chisquare(self, df: float, size: None = ...) -> float:
...
@overload
def chisquare(self, df: _ArrayLikeFloat_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def noncentral_chisquare(self, df: float, nonc: float, size: None = ...) -> float:
...
@overload
def noncentral_chisquare(self, df: _ArrayLikeFloat_co, nonc: _ArrayLikeFloat_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def standard_t(self, df: float, size: None = ...) -> float:
...
@overload
def standard_t(self, df: _ArrayLikeFloat_co, size: None = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def standard_t(self, df: _ArrayLikeFloat_co, size: _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def vonmises(self, mu: float, kappa: float, size: None = ...) -> float:
...
@overload
def vonmises(self, mu: _ArrayLikeFloat_co, kappa: _ArrayLikeFloat_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def pareto(self, a: float, size: None = ...) -> float:
...
@overload
def pareto(self, a: _ArrayLikeFloat_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def weibull(self, a: float, size: None = ...) -> float:
...
@overload
def weibull(self, a: _ArrayLikeFloat_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def power(self, a: float, size: None = ...) -> float:
...
@overload
def power(self, a: _ArrayLikeFloat_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def standard_cauchy(self, size: None = ...) -> float:
...
@overload
def standard_cauchy(self, size: _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def laplace(self, loc: float = ..., scale: float = ..., size: None = ...) -> float:
...
@overload
def laplace(self, loc: _ArrayLikeFloat_co = ..., scale: _ArrayLikeFloat_co = ..., size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def gumbel(self, loc: float = ..., scale: float = ..., size: None = ...) -> float:
...
@overload
def gumbel(self, loc: _ArrayLikeFloat_co = ..., scale: _ArrayLikeFloat_co = ..., size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def logistic(self, loc: float = ..., scale: float = ..., size: None = ...) -> float:
...
@overload
def logistic(self, loc: _ArrayLikeFloat_co = ..., scale: _ArrayLikeFloat_co = ..., size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def lognormal(self, mean: float = ..., sigma: float = ..., size: None = ...) -> float:
...
@overload
def lognormal(self, mean: _ArrayLikeFloat_co = ..., sigma: _ArrayLikeFloat_co = ..., size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def rayleigh(self, scale: float = ..., size: None = ...) -> float:
...
@overload
def rayleigh(self, scale: _ArrayLikeFloat_co = ..., size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def wald(self, mean: float, scale: float, size: None = ...) -> float:
...
@overload
def wald(self, mean: _ArrayLikeFloat_co, scale: _ArrayLikeFloat_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def triangular(self, left: float, mode: float, right: float, size: None = ...) -> float:
...
@overload
def triangular(self, left: _ArrayLikeFloat_co, mode: _ArrayLikeFloat_co, right: _ArrayLikeFloat_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
@overload
def binomial(self, n: int, p: float, size: None = ...) -> int:
...
@overload
def binomial(self, n: _ArrayLikeInt_co, p: _ArrayLikeFloat_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[int_]]:
...
@overload
def negative_binomial(self, n: float, p: float, size: None = ...) -> int:
...
@overload
def negative_binomial(self, n: _ArrayLikeFloat_co, p: _ArrayLikeFloat_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[int_]]:
...
@overload
def poisson(self, lam: float = ..., size: None = ...) -> int:
...
@overload
def poisson(self, lam: _ArrayLikeFloat_co = ..., size: None | _ShapeLike = ...) -> ndarray[Any, dtype[int_]]:
...
@overload
def zipf(self, a: float, size: None = ...) -> int:
...
@overload
def zipf(self, a: _ArrayLikeFloat_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[int_]]:
...
@overload
def geometric(self, p: float, size: None = ...) -> int:
...
@overload
def geometric(self, p: _ArrayLikeFloat_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[int_]]:
...
@overload
def hypergeometric(self, ngood: int, nbad: int, nsample: int, size: None = ...) -> int:
...
@overload
def hypergeometric(self, ngood: _ArrayLikeInt_co, nbad: _ArrayLikeInt_co, nsample: _ArrayLikeInt_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[int_]]:
...
@overload
def logseries(self, p: float, size: None = ...) -> int:
...
@overload
def logseries(self, p: _ArrayLikeFloat_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[int_]]:
...
def multivariate_normal(self, mean: _ArrayLikeFloat_co, cov: _ArrayLikeFloat_co, size: None | _ShapeLike = ..., check_valid: Literal["warn", "raise", "ignore"] = ..., tol: float = ...) -> ndarray[Any, dtype[float64]]:
...
def multinomial(self, n: _ArrayLikeInt_co, pvals: _ArrayLikeFloat_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[int_]]:
...
def dirichlet(self, alpha: _ArrayLikeFloat_co, size: None | _ShapeLike = ...) -> ndarray[Any, dtype[float64]]:
...
def shuffle(self, x: ArrayLike) -> None:
...
@overload
def permutation(self, x: int) -> ndarray[Any, dtype[int_]]:
...
@overload
def permutation(self, x: ArrayLike) -> ndarray[Any, Any]:
...
_rand: RandomState
beta = ...
binomial = ...
bytes = ...
chisquare = ...
choice = ...
dirichlet = ...
exponential = ...
f = ...
gamma = ...
get_state = ...
geometric = ...
gumbel = ...
hypergeometric = ...
laplace = ...
logistic = ...
lognormal = ...
logseries = ...
multinomial = ...
multivariate_normal = ...
negative_binomial = ...
noncentral_chisquare = ...
noncentral_f = ...
normal = ...
pareto = ...
permutation = ...
poisson = ...
power = ...
rand = ...
randint = ...
randn = ...
random = ...
random_integers = ...
random_sample = ...
rayleigh = ...
seed = ...
set_state = ...
shuffle = ...
standard_cauchy = ...
standard_exponential = ...
standard_gamma = ...
standard_normal = ...
standard_t = ...
triangular = ...
uniform = ...
vonmises = ...
wald = ...
weibull = ...
zipf = ...
sample = ...
ranf = ...
def set_bit_generator(bitgen: BitGenerator) -> None:
...
def get_bit_generator() -> BitGenerator:
...