Skip to content

Commit

Permalink
👽️ scipy==1.15.0rc2 (#376)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorenham authored Dec 24, 2024
2 parents cd4cdc7 + ee72cad commit e8e6bb0
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 85 deletions.
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "scipy-stubs"
version = "1.15.0.0.dev0"
version = "1.15.0.0.dev1"
description = "Precise type-hints for all of SciPy"
readme = "README.md"
authors = [
Expand Down Expand Up @@ -33,7 +33,7 @@ dependencies = [
]

[dependency-groups]
scipy = ["scipy==1.15.0rc1"]
scipy = ["scipy==1.15.0rc2"]
ci = ["packaging>=24.2"]
codegen = ["libcst>=1.5.1,<2"]
mdformat = [
Expand Down Expand Up @@ -63,7 +63,7 @@ dev = [
]

[project.optional-dependencies]
scipy = ["scipy>=1.15.0rc1,<1.16"]
scipy = ["scipy>=1.15.0rc2,<1.16"]

[project.urls]
Repository = "https://github.com/jorenham/scipy-stubs/"
Expand Down
2 changes: 0 additions & 2 deletions scipy-stubs/sparse/_index.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ _ToSlice2D: TypeAlias = (
INT_TYPES: tuple[type[int], type[np.integer[Any]]] = ...

class IndexMixin(Generic[_SCT, _ShapeT_co]):
# NOTE: >2-d indexing is bugged at the moment (scipy==1.15.0rc1), see https://github.com/scipy/scipy/issues/22112

@overload
def __getitem__(self: IndexMixin[Any, tuple[int]], ix: op.CanIndex, /) -> _SCT: ...
@overload
Expand Down
34 changes: 3 additions & 31 deletions scipy-stubs/stats/_distribution_infrastructure.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ from typing import Any, ClassVar, Final, Generic, Literal as L, Protocol, TypeAl
from typing_extensions import LiteralString, Never, Self, TypeIs, TypeVar, Unpack, override

import numpy as np
import optype as op
import optype.numpy as onp
import optype.typing as opt
from scipy._typing import AnyShape, ToRNG
from scipy._typing import ToRNG
from ._distn_infrastructure import rv_continuous
from ._probability_distribution import _BaseDistribution

Expand Down Expand Up @@ -53,10 +52,6 @@ _2D: TypeAlias = tuple[_NT, _NT] # noqa: PYI042
_3D: TypeAlias = tuple[_NT, _NT, _NT] # noqa: PYI042
_ND: TypeAlias = tuple[_NT, ...]

_To1D: TypeAlias = op.CanIndex | _1D[op.CanIndex]
_To2D: TypeAlias = _2D[op.CanIndex]
_To3D: TypeAlias = _3D[op.CanIndex]

_ToFloatMax1D: TypeAlias = onp.ToFloatStrict1D | onp.ToFloat
_ToFloatMax2D: TypeAlias = onp.ToFloatStrict2D | _ToFloatMax1D
_ToFloatMax3D: TypeAlias = onp.ToFloatStrict3D | _ToFloatMax2D
Expand Down Expand Up @@ -348,31 +343,6 @@ class ContinuousDistribution(_BaseDistribution[_FloatT_co, _ShapeT_co], Generic[
ax: _AxesT | None = None,
) -> _AxesT: ...

#
# NOTE: This will be removed in 1.15.0rc2, see https://github.com/scipy/scipy/pull/22149
@overload
def llf(self, sample: _ToFloatMaxND, /, *, axis: None) -> _OutFloat: ...
@overload
def llf(self: _CDist0, sample: _ToFloatMax1D, /, *, axis: AnyShape | None = -1) -> _OutFloat: ...
@overload
def llf(self: _CDist[_ShapeT1], sample: _ToFloatMax1D, /, *, axis: AnyShape = -1) -> onp.ArrayND[_OutFloat, _ShapeT1]: ...
@overload
def llf(self: _CDist0, sample: onp.ToFloatStrict2D, /, *, axis: _To1D = -1) -> onp.Array1D[_OutFloat]: ...
@overload
def llf(self: _CDist0, sample: onp.ToFloatStrict2D, /, *, axis: _To2D) -> _OutFloat: ...
@overload
def llf(self: _CDist0, sample: onp.ToFloatStrict3D, /, *, axis: _To1D = -1) -> onp.Array2D[_OutFloat]: ...
@overload
def llf(self: _CDist0, sample: onp.ToFloatStrict3D, /, *, axis: _To2D) -> onp.Array1D[_OutFloat]: ...
@overload
def llf(self: _CDist0, sample: onp.ToFloatStrict3D, /, *, axis: _To3D) -> _OutFloat: ...
@overload
def llf(
self: _CDist[_ShapeT1], sample: _ToFloatMaxND, /, *, axis: AnyShape = -1
) -> onp.Array[_ShapeT1, _OutFloat] | onp.ArrayND[_OutFloat]: ... # the first union type is needed on numpy <2.1
@overload
def llf(self, sample: _ToFloatMaxND, /, *, axis: AnyShape | None = -1) -> _OutFloat | onp.ArrayND[_OutFloat]: ...

# 7 years of asking and >400 upvotes, but still no higher-kinded typing support: https://github.com/python/typing/issues/548
class TransformedDistribution(ContinuousDistribution[_FloatT_co, _ShapeT_co], Generic[_DistT_co, _FloatT_co, _ShapeT_co]):
_dist: _DistT_co # readonly
Expand Down Expand Up @@ -535,6 +505,7 @@ class MonotonicTransformedDistribution(_TransDist[_DistT_co, _Float, _ShapeT_co]
_logdh: Final[_Elementwise]
_increasing: Final[bool]
_repr_pattern: Final[str]
_str_pattern: Final[str]

def __init__(
self: MonotonicTransformedDistribution[_CDist[_ShapeT], _ShapeT],
Expand All @@ -547,6 +518,7 @@ class MonotonicTransformedDistribution(_TransDist[_DistT_co, _Float, _ShapeT_co]
logdh: _Elementwise | None = None,
increasing: bool = True,
repr_pattern: str | None = None,
str_pattern: str | None = None,
**kwargs: Unpack[_DistOpts],
) -> None: ...

Expand Down
2 changes: 1 addition & 1 deletion scipy-stubs/version.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ from typing_extensions import LiteralString as _LiteralString

version: _Final[_LiteralString] = ...
full_version: _Final[_LiteralString] = ...
short_version: _Final[_Literal["1.15.0rc1", "1.15.0rc2", "1.15.0"]] = ...
short_version: _Final[_Literal["1.15.0rc2", "1.15.0", "1.15.1"]] = ...
git_revision: _Final[_LiteralString] = ...
release: _Final[bool] = ...
Loading

0 comments on commit e8e6bb0

Please sign in to comment.