Skip to content

Commit cc39f21

Browse files
committed
🎨 remove outdated # TODO's
1 parent 4ab7aed commit cc39f21

24 files changed

+83
-63
lines changed

‎scipy-stubs/cluster/vq.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ _InexactT = TypeVar("_InexactT", bound=_Inexact)
1919

2020
class ClusterError(Exception): ...
2121

22-
# TODO(jorenham): Array API support
22+
#
2323
@overload
2424
def whiten(obs: onp.ArrayND[np.bool_ | np.integer[Any]], check_finite: bool = True) -> onp.Array2D[np.float64]: ...
2525
@overload

‎scipy-stubs/differentiate/_differentiate.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def derivative(
139139
callback: Callable[[_DerivativeResultND[_FloatT, _ShapeT]], _Ignored] | None = None,
140140
) -> _DerivativeResultND[_FloatT, _ShapeT]: ...
141141

142-
# TODO(jorenham): shape overloads
142+
#
143143
def jacobian(
144144
f: Callable[[onp.Array[Any, _FloatT]], onp.ToFloat | onp.ToFloatND],
145145
x: onp.ToFloatND,
@@ -152,7 +152,7 @@ def jacobian(
152152
step_direction: onp.ToJustInt | onp.ToJustIntND = 0,
153153
) -> _JacobianResult[_FloatT, onp.AtLeast1D]: ...
154154

155-
# TODO(jorenham): shape overloads
155+
#
156156
def hessian(
157157
f: Callable[[onp.Array[Any, _FloatT]], onp.ToFloat | onp.ToFloatND],
158158
x: onp.ToFloatND,

‎scipy-stubs/fft/_helper.pyi

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ _SCT = TypeVar("_SCT", bound=np.inexact[Any])
1212
def next_fast_len(target: op.CanIndex, real: op.CanBool = False) -> int: ...
1313
def prev_fast_len(target: op.CanIndex, real: op.CanBool = False) -> int: ...
1414

15-
# TODO(jorenham): Array API support (for `xp`)
16-
# https://github.com/jorenham/scipy-stubs/issues/140
15+
#
1716
@overload # xp: None -> np.fft.fftfreq
1817
def fftfreq(
1918
n: int | np.integer[Any],
@@ -25,8 +24,7 @@ def fftfreq(
2524
@overload # xp: ModuleType -> xp.fft.fftfreq
2625
def fftfreq(n: int, d: float = 1.0, *, xp: ModuleType, device: object | None = None) -> Any: ... # noqa: ANN401
2726

28-
# TODO(jorenham): Array API support (for `xp`)
29-
# https://github.com/jorenham/scipy-stubs/issues/140
27+
#
3028
@overload # np.fft.rfftfreq
3129
def rfftfreq(
3230
n: int | np.integer[Any],
@@ -38,8 +36,7 @@ def rfftfreq(
3836
@overload # xp.fft.fftfreq
3937
def rfftfreq(n: int, d: float = 1.0, *, xp: ModuleType, device: object | None = None) -> Any: ... # noqa: ANN401
4038

41-
# TODO(jorenham): Array API support (for `x`)
42-
# https://github.com/jorenham/scipy-stubs/issues/140
39+
#
4340
@overload
4441
def fftshift(x: onp.ToIntND | onp.SequenceND[float], axes: AnyShape | None = None) -> onp.ArrayND[np.float64]: ...
4542
@overload
@@ -49,8 +46,7 @@ def fftshift(x: _ArrayLike[_SCT], axes: AnyShape | None = None) -> onp.ArrayND[_
4946
@overload
5047
def fftshift(x: onp.ToComplexND, axes: AnyShape | None = None) -> onp.ArrayND[np.inexact[Any]]: ...
5148

52-
# TODO(jorenham): Array API support (for `x`)
53-
# https://github.com/jorenham/scipy-stubs/issues/140
49+
#
5450
@overload
5551
def ifftshift(x: onp.ToIntND | onp.SequenceND[float], axes: AnyShape | None = None) -> onp.ArrayND[np.float64]: ...
5652
@overload

‎scipy-stubs/fft/_realtransforms.pyi

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ from scipy._typing import AnyShape, DCTType, NormalizationMode
88
__all__ = ["dct", "dctn", "dst", "dstn", "idct", "idctn", "idst", "idstn"]
99

1010
# this doesn't include `numpy.float16`
11-
_RealND: TypeAlias = onp.ArrayND[np.float32 | np.float64 | np.longdouble]
11+
_FloatND: TypeAlias = onp.ArrayND[np.float32 | np.float64 | np.longdouble]
1212

1313
###
1414

@@ -25,7 +25,9 @@ def dctn(
2525
workers: onp.ToInt | None = None,
2626
*,
2727
orthogonalize: op.CanBool | None = None,
28-
) -> _RealND: ...
28+
) -> _FloatND: ...
29+
30+
#
2931
def idctn(
3032
x: onp.ToComplexND,
3133
type: DCTType = 2,
@@ -35,7 +37,9 @@ def idctn(
3537
overwrite_x: op.CanBool = False,
3638
workers: onp.ToInt | None = None,
3739
orthogonalize: op.CanBool | None = None,
38-
) -> _RealND: ...
40+
) -> _FloatND: ...
41+
42+
#
3943
def dstn(
4044
x: onp.ToComplexND,
4145
type: DCTType = 2,
@@ -45,7 +49,9 @@ def dstn(
4549
overwrite_x: op.CanBool = False,
4650
workers: onp.ToInt | None = None,
4751
orthogonalize: op.CanBool | None = None,
48-
) -> _RealND: ...
52+
) -> _FloatND: ...
53+
54+
#
4955
def idstn(
5056
x: onp.ToComplexND,
5157
type: DCTType = 2,
@@ -55,7 +61,9 @@ def idstn(
5561
overwrite_x: op.CanBool = False,
5662
workers: onp.ToInt | None = None,
5763
orthogonalize: op.CanBool | None = None,
58-
) -> _RealND: ...
64+
) -> _FloatND: ...
65+
66+
#
5967
def dct(
6068
x: onp.ToComplexND,
6169
type: DCTType = 2,
@@ -65,7 +73,9 @@ def dct(
6573
overwrite_x: op.CanBool = False,
6674
workers: onp.ToInt | None = None,
6775
orthogonalize: op.CanBool | None = None,
68-
) -> _RealND: ...
76+
) -> _FloatND: ...
77+
78+
#
6979
def idct(
7080
x: onp.ToComplexND,
7181
type: DCTType = 2,
@@ -75,7 +85,9 @@ def idct(
7585
overwrite_x: op.CanBool = False,
7686
workers: onp.ToInt | None = None,
7787
orthogonalize: op.CanBool | None = None,
78-
) -> _RealND: ...
88+
) -> _FloatND: ...
89+
90+
#
7991
def dst(
8092
x: onp.ToComplexND,
8193
type: DCTType = 2,
@@ -85,7 +97,9 @@ def dst(
8597
overwrite_x: op.CanBool = False,
8698
workers: onp.ToInt | None = None,
8799
orthogonalize: op.CanBool | None = None,
88-
) -> _RealND: ...
100+
) -> _FloatND: ...
101+
102+
#
89103
def idst(
90104
x: onp.ToComplexND,
91105
type: DCTType = 2,
@@ -95,4 +109,4 @@ def idst(
95109
overwrite_x: op.CanBool = False,
96110
workers: onp.ToInt | None = None,
97111
orthogonalize: op.CanBool | None = None,
98-
) -> _RealND: ...
112+
) -> _FloatND: ...

‎scipy-stubs/integrate/_ivp/bdf.pyi

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ import optype.numpy as onp
77
from scipy.sparse import sparray, spmatrix
88
from .base import DenseOutput, OdeSolver
99

10+
###
11+
1012
_SCT_co = TypeVar("_SCT_co", covariant=True, bound=np.inexact[Any], default=np.float64 | np.complex128)
1113

12-
# TODO(jorenham): sparse
1314
_LU: TypeAlias = tuple[onp.ArrayND[np.inexact[Any]], onp.ArrayND[np.integer[Any]]]
1415
_FuncLU: TypeAlias = Callable[[onp.ArrayND[np.float64]], _LU] | Callable[[onp.ArrayND[np.complex128]], _LU]
1516
_FuncSolveLU: TypeAlias = Callable[[_LU, onp.ArrayND], onp.ArrayND[np.inexact[Any]]]
@@ -46,9 +47,9 @@ class BDF(OdeSolver, Generic[_SCT_co]):
4647
def __init__(
4748
self,
4849
/,
49-
fun: Callable[[float, onp.ArrayND[_SCT_co]], onp.ToComplex1D],
50+
fun: Callable[[float, onp.Array1D[_SCT_co]], onp.ToComplex1D],
5051
t0: onp.ToFloat,
51-
y0: onp.ArrayND[_SCT_co] | onp.ToComplexND,
52+
y0: onp.Array1D[_SCT_co] | onp.ToComplexND,
5253
t_bound: onp.ToFloat,
5354
max_step: onp.ToFloat = ...,
5455
rtol: onp.ToFloat = 0.001,

‎scipy-stubs/interpolate/_dfitpack.pyi

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,12 @@ fpcurfm1: _FortranFunction[L["function fpcurfm1"]] = ...
137137

138138
# (tx, ty, c, kx, ky, x, y) -> (z, ier)
139139
bispev: _FortranFunction[L["function bispev"], _Func_bispe_] = ...
140-
# TODO(jorenham)
141-
parder: _FortranFunction[L["function parder"]] = ...
142-
pardtc: _FortranFunction[L["function pardtc"]] = ...
143-
144140
# (tx, ty, c, kx, ky, x, y) -> (z, ier)
145141
bispeu: _FortranFunction[L["function bispeu"], _Func_bispe_] = ...
142+
146143
# TODO(jorenham)
144+
parder: _FortranFunction[L["function parder"]] = ...
145+
pardtc: _FortranFunction[L["function pardtc"]] = ...
147146
pardeu: _FortranFunction[L["function pardeu"]] = ...
148147
surfit_smth: _FortranFunction[L["function surfit_smth"]] = ...
149148
surfit_lsq: _FortranFunction[L["function surfit_lsq"]] = ...

‎scipy-stubs/linalg/_basic.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ def pinv(
348348
check_finite: onp.ToBool = True,
349349
) -> tuple[_Complex2D, int]: ...
350350

351-
# TODO(jorenham): pos-only `return_rank`
351+
#
352352
@overload # (float[:, :], return_rank=False) -> float[:, :]
353353
def pinvh(
354354
a: onp.ToFloat2D,

‎scipy-stubs/linalg/_special_matrices.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def fiedler_companion(a: _ToStrict2ND[_SCT]) -> _Array3ND[_SCT]: ...
204204
@overload
205205
def fiedler_companion(a: _ToND[_SCT]) -> _Array2ND[_SCT]: ...
206206

207-
# TODO(jorenham): batching
207+
#
208208
@overload
209209
def leslie(f: onp.ToJustIntStrict1D, s: onp.ToJustIntStrict1D) -> _Int2D: ...
210210
@overload

‎scipy-stubs/odr/_odrpack.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,8 @@ class ODR:
232232
delta0: onp.ToFloat1D | None = None,
233233
ifixb: onp.ToInt1D | None = None,
234234
ifixx: onp.ToIntND | None = None,
235-
job: int | None = None, # TODO: Use literal, see ODRPACK User's Guide p. 31
236-
iprint: int | None = None, # TODO: Use literal, seeODRPACK User's Guide p. 33-34
235+
job: int | None = None,
236+
iprint: int | None = None,
237237
errfile: str | None = None,
238238
rptfile: str | None = None,
239239
ndigit: int | None = None,

‎scipy-stubs/optimize/_differentiable_functions.pyi

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ _ToHessFun: TypeAlias = _HessFun[_XT_contra] | _FDMethod | HessianUpdateStrategy
3636

3737
FD_METHODS: Final = "2-point", "3-point", "cs"
3838

39-
# TODO(jorenham): Array API compatibility
40-
# https://github.com/jorenham/scipy-stubs/issues/140
41-
4239
class ScalarFunction(Generic[_XT_contra]):
4340
xp: Final[ModuleType]
4441

0 commit comments

Comments
 (0)