Skip to content

Commit

Permalink
👽️ sparse: SPEC 7 support
Browse files Browse the repository at this point in the history
  • Loading branch information
jorenham committed Dec 17, 2024
1 parent cf4926c commit 1668da1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 30 deletions.
1 change: 0 additions & 1 deletion .mypyignore-todo
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
scipy\.sparse\._coo\._coo_base\.tensordot
scipy\.sparse\.(_?construct\.)?rand(om(_array)?)?

scipy\.spatial\.distance\.directed_hausdorff
scipy\.spatial\.transform\.(_?rotation\.)?Rotation\.random
Expand Down
40 changes: 20 additions & 20 deletions scipy-stubs/sparse/_construct.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,7 @@ def random_array(
density: float | Float = 0.01,
format: SPFormat = "coo",
dtype: ToDTypeFloat | None = None,
random_state: ToRNG = None,
rng: ToRNG = None,
data_sampler: _DataSampler | None = None,
) -> _SpArray1D[np.float64]: ...
@overload # shape: 1d, dtype: <known>
Expand All @@ -907,7 +907,7 @@ def random_array(
density: float | Float = 0.01,
format: SPFormat = "coo",
dtype: ToDType[_SCT],
random_state: ToRNG = None,
rng: ToRNG = None,
data_sampler: _DataSampler | None = None,
) -> _SpArray1D[_SCT]: ...
@overload # shape: 1d, dtype: complex
Expand All @@ -917,7 +917,7 @@ def random_array(
density: float | Float = 0.01,
format: SPFormat = "coo",
dtype: ToDTypeComplex,
random_state: ToRNG = None,
rng: ToRNG = None,
data_sampler: _DataSampler | None = None,
) -> _SpArray1D[np.complex128]: ...
@overload # shape: 1d, dtype: <unknown>
Expand All @@ -927,7 +927,7 @@ def random_array(
density: float | Float = 0.01,
format: SPFormat = "coo",
dtype: npt.DTypeLike,
random_state: ToRNG = None,
rng: ToRNG = None,
data_sampler: _DataSampler | None = None,
) -> _SpArray1D: ...
@overload # shape: 2d, dtype: <default>
Expand All @@ -937,7 +937,7 @@ def random_array(
density: float | Float = 0.01,
format: SPFormat = "coo",
dtype: ToDTypeFloat | None = None,
random_state: ToRNG = None,
rng: ToRNG = None,
data_sampler: _DataSampler | None = None,
) -> _SpArray2D[np.float64]: ...
@overload # shape: 2d, dtype: <known>
Expand All @@ -947,7 +947,7 @@ def random_array(
density: float | Float = 0.01,
format: SPFormat = "coo",
dtype: ToDType[_SCT],
random_state: ToRNG = None,
rng: ToRNG = None,
data_sampler: _DataSampler | None = None,
) -> _SpArray2D[_SCT]: ...
@overload # shape: 2d, dtype: complex
Expand All @@ -957,7 +957,7 @@ def random_array(
density: float | Float = 0.01,
format: SPFormat = "coo",
dtype: ToDTypeComplex,
random_state: ToRNG = None,
rng: ToRNG = None,
data_sampler: _DataSampler | None = None,
) -> _SpArray2D[np.complex128]: ...
@overload # shape: 2d, dtype: <unknown>
Expand All @@ -967,7 +967,7 @@ def random_array(
density: float | Float = 0.01,
format: SPFormat = "coo",
dtype: npt.DTypeLike,
random_state: ToRNG = None,
rng: ToRNG = None,
data_sampler: _DataSampler | None = None,
) -> _SpArray2D: ...

Expand All @@ -979,7 +979,7 @@ def random(
density: float | Float = 0.01,
format: SPFormat = "coo",
dtype: ToDTypeFloat | None = None,
random_state: ToRNG = None,
rng: ToRNG = None,
data_rvs: _DataRVS | None = None,
) -> _SpMatrix[np.float64]: ...
@overload # dtype: <known> (positional)
Expand All @@ -989,7 +989,7 @@ def random(
density: float | Float,
format: SPFormat,
dtype: ToDType[_SCT],
random_state: ToRNG = None,
rng: ToRNG = None,
data_rvs: _DataRVS | None = None,
) -> _SpMatrix[_SCT]: ...
@overload # dtype: <known> (keyword)
Expand All @@ -1000,7 +1000,7 @@ def random(
format: SPFormat = "coo",
*,
dtype: ToDType[_SCT],
random_state: ToRNG = None,
rng: ToRNG = None,
data_rvs: _DataRVS | None = None,
) -> _SpMatrix[_SCT]: ...
@overload # dtype: complex (positional)
Expand All @@ -1010,7 +1010,7 @@ def random(
density: float | Float,
format: SPFormat,
dtype: ToDTypeComplex,
random_state: ToRNG = None,
rng: ToRNG = None,
data_rvs: _DataRVS | None = None,
) -> _SpMatrix[np.complex128]: ...
@overload # dtype: complex (keyword)
Expand All @@ -1021,7 +1021,7 @@ def random(
format: SPFormat = "coo",
*,
dtype: ToDTypeComplex,
random_state: ToRNG = None,
rng: ToRNG = None,
data_rvs: _DataRVS | None = None,
) -> _SpMatrix[np.complex128]: ...
@overload # dtype: <unknown>
Expand All @@ -1031,7 +1031,7 @@ def random(
density: float | Float = 0.01,
format: SPFormat = "coo",
dtype: npt.DTypeLike | None = None,
random_state: ToRNG = None,
rng: ToRNG = None,
data_rvs: _DataRVS | None = None,
) -> _SpMatrix: ...

Expand All @@ -1043,7 +1043,7 @@ def rand(
density: float | Float = 0.01,
format: SPFormat = "coo",
dtype: ToDTypeFloat | None = None,
random_state: ToRNG = None,
rng: ToRNG = None,
) -> _SpMatrix[np.float64]: ...
@overload # dtype: <known> (positional)
def rand(
Expand All @@ -1052,7 +1052,7 @@ def rand(
density: float | Float,
format: SPFormat,
dtype: ToDType[_SCT],
random_state: ToRNG = None,
rng: ToRNG = None,
) -> _SpMatrix[_SCT]: ...
@overload # dtype: <known> (keyword)
def rand(
Expand All @@ -1062,7 +1062,7 @@ def rand(
format: SPFormat = "coo",
*,
dtype: ToDType[_SCT],
random_state: ToRNG = None,
rng: ToRNG = None,
) -> _SpMatrix[_SCT]: ...
@overload # dtype: complex (positional)
def rand(
Expand All @@ -1071,7 +1071,7 @@ def rand(
density: float | Float,
format: SPFormat,
dtype: ToDTypeComplex,
random_state: ToRNG = None,
rng: ToRNG = None,
) -> _SpMatrix[np.complex128]: ...
@overload # dtype: complex (keyword)
def rand(
Expand All @@ -1081,7 +1081,7 @@ def rand(
format: SPFormat = "coo",
*,
dtype: ToDTypeComplex,
random_state: ToRNG = None,
rng: ToRNG = None,
) -> _SpMatrix[np.complex128]: ...
@overload # dtype: <unknown>
def rand(
Expand All @@ -1090,5 +1090,5 @@ def rand(
density: float | Float = 0.01,
format: SPFormat = "coo",
dtype: npt.DTypeLike | None = None,
random_state: ToRNG = None,
rng: ToRNG = None,
) -> _SpMatrix: ...
11 changes: 2 additions & 9 deletions scipy-stubs/sparse/construct.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,11 @@ def random(
density: object = ...,
format: object = ...,
dtype: object = ...,
random_state: object = ...,
rng: object = ...,
data_rvs: object = ...,
) -> object: ...
@deprecated("will be removed in SciPy v2.0.0")
def rand(
m: object,
n: object,
density: object = ...,
format: object = ...,
dtype: object = ...,
random_state: object = ...,
) -> object: ...
def rand(m: object, n: object, density: object = ..., format: object = ..., dtype: object = ..., rng: object = ...) -> object: ...
@deprecated("will be removed in SciPy v2.0.0")
def kron(A: object, B: object, format: object = ...) -> object: ...
@deprecated("will be removed in SciPy v2.0.0")
Expand Down

0 comments on commit 1668da1

Please sign in to comment.