From 1668da18a8cd4868ea7a947ca54ded33c10d89ae Mon Sep 17 00:00:00 2001 From: jorenham Date: Tue, 17 Dec 2024 20:40:47 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=BD=EF=B8=8F=20`sparse`:=20SPEC=207=20?= =?UTF-8?q?support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .mypyignore-todo | 1 - scipy-stubs/sparse/_construct.pyi | 40 +++++++++++++++---------------- scipy-stubs/sparse/construct.pyi | 11 ++------- 3 files changed, 22 insertions(+), 30 deletions(-) diff --git a/.mypyignore-todo b/.mypyignore-todo index 3ed73d73..404e2a7f 100644 --- a/.mypyignore-todo +++ b/.mypyignore-todo @@ -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 diff --git a/scipy-stubs/sparse/_construct.pyi b/scipy-stubs/sparse/_construct.pyi index b34301ac..f8ff6217 100644 --- a/scipy-stubs/sparse/_construct.pyi +++ b/scipy-stubs/sparse/_construct.pyi @@ -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: @@ -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 @@ -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: @@ -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: @@ -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: @@ -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 @@ -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: @@ -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: ... @@ -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: (positional) @@ -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: (keyword) @@ -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) @@ -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) @@ -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: @@ -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: ... @@ -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: (positional) def rand( @@ -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: (keyword) def rand( @@ -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( @@ -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( @@ -1081,7 +1081,7 @@ def rand( format: SPFormat = "coo", *, dtype: ToDTypeComplex, - random_state: ToRNG = None, + rng: ToRNG = None, ) -> _SpMatrix[np.complex128]: ... @overload # dtype: def rand( @@ -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: ... diff --git a/scipy-stubs/sparse/construct.pyi b/scipy-stubs/sparse/construct.pyi index f8917d1f..2bb60a14 100644 --- a/scipy-stubs/sparse/construct.pyi +++ b/scipy-stubs/sparse/construct.pyi @@ -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")