Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

various fixes and improvements in scipy.stats._distn_infrastructure #41

Merged
merged 1 commit into from
Sep 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion scipy-stubs/_typing.pyi
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Helper types for internal use (type-check only).
from collections.abc import Callable
from collections.abc import Callable, Sequence
from typing import Any, Literal, Protocol, TypeAlias, type_check_only
from typing_extensions import LiteralString, TypeVar

import numpy as np
import optype as op
import optype.numpy as onpt

__all__ = [
Expand All @@ -14,6 +15,7 @@ __all__ = [
"AnyInt",
"AnyReal",
"AnyScalar",
"AnyShape",
"Array0D",
"CorrelateMode",
"NanPolicy",
Expand Down Expand Up @@ -46,6 +48,9 @@ AnyComplex: TypeAlias = int | float | complex | np.number[Any] | np.bool_
AnyChar: TypeAlias = str | bytes # `np.str_ <: builtins.str` and `np.bytes_ <: builtins.bytes`
AnyScalar: TypeAlias = int | float | complex | AnyChar | np.generic

# equivalent to `numpy._typing._shape._ShapeLike`
AnyShape: TypeAlias = op.CanIndex | Sequence[op.CanIndex]

# numpy literals
RNG: TypeAlias = np.random.Generator | np.random.RandomState
Seed: TypeAlias = int | RNG
Expand Down
Loading
Loading