Skip to content

Commit 4a33b59

Browse files
authored
Merge pull request #41 from jorenham/fix/scipy.stats._distn_infrastructure
various fixes and improvements in `scipy.stats._distn_infrastructure`
2 parents 257eb2a + bf473f3 commit 4a33b59

File tree

2 files changed

+376
-465
lines changed

2 files changed

+376
-465
lines changed

scipy-stubs/_typing.pyi

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# Helper types for internal use (type-check only).
2-
from collections.abc import Callable
2+
from collections.abc import Callable, Sequence
33
from typing import Any, Literal, Protocol, TypeAlias, type_check_only
44
from typing_extensions import LiteralString, TypeVar
55

66
import numpy as np
7+
import optype as op
78
import optype.numpy as onpt
89

910
__all__ = [
@@ -14,6 +15,7 @@ __all__ = [
1415
"AnyInt",
1516
"AnyReal",
1617
"AnyScalar",
18+
"AnyShape",
1719
"Array0D",
1820
"CorrelateMode",
1921
"NanPolicy",
@@ -46,6 +48,9 @@ AnyComplex: TypeAlias = int | float | complex | np.number[Any] | np.bool_
4648
AnyChar: TypeAlias = str | bytes # `np.str_ <: builtins.str` and `np.bytes_ <: builtins.bytes`
4749
AnyScalar: TypeAlias = int | float | complex | AnyChar | np.generic
4850

51+
# equivalent to `numpy._typing._shape._ShapeLike`
52+
AnyShape: TypeAlias = op.CanIndex | Sequence[op.CanIndex]
53+
4954
# numpy literals
5055
RNG: TypeAlias = np.random.Generator | np.random.RandomState
5156
Seed: TypeAlias = int | RNG

0 commit comments

Comments
 (0)