-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎨
optype 0.8
simplifications (#382)
- Loading branch information
Showing
25 changed files
with
414 additions
and
422 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,28 @@ | ||
from collections.abc import Sequence | ||
from typing import Any, TypeAlias, TypeVar, overload | ||
from typing import overload | ||
|
||
import numpy as np | ||
import optype.numpy as onp | ||
import optype.typing as opt | ||
import scipy._typing as spt | ||
from scipy._typing import ToRNG | ||
from scipy.sparse import csc_matrix | ||
|
||
__all__ = ["clarkson_woodruff_transform"] | ||
|
||
_ST = TypeVar("_ST", bound=np.generic) | ||
_VT = TypeVar("_VT") | ||
|
||
_ToJust2D: TypeAlias = onp.CanArrayND[_ST] | Sequence[onp.CanArrayND[_ST]] | Sequence[Sequence[opt.Just[_VT] | _ST]] | ||
|
||
### | ||
|
||
def cwt_matrix(n_rows: onp.ToInt, n_columns: onp.ToInt, rng: spt.ToRNG = None) -> csc_matrix: ... | ||
def cwt_matrix(n_rows: onp.ToInt, n_columns: onp.ToInt, rng: ToRNG = None) -> csc_matrix: ... | ||
|
||
# | ||
@overload | ||
def clarkson_woodruff_transform( | ||
input_matrix: onp.ToInt2D, | ||
sketch_size: onp.ToInt, | ||
rng: spt.ToRNG = None, | ||
) -> onp.Array2D[np.int_]: ... | ||
def clarkson_woodruff_transform(input_matrix: onp.ToInt2D, sketch_size: onp.ToInt, rng: ToRNG = None) -> onp.Array2D[np.int_]: ... | ||
@overload | ||
def clarkson_woodruff_transform( | ||
input_matrix: _ToJust2D[np.floating[Any], float], | ||
input_matrix: onp.ToJustFloat2D, | ||
sketch_size: onp.ToInt, | ||
rng: spt.ToRNG = None, | ||
rng: ToRNG = None, | ||
) -> onp.Array2D[np.float64 | np.longdouble]: ... | ||
@overload | ||
def clarkson_woodruff_transform( | ||
input_matrix: _ToJust2D[np.complexfloating[Any, Any], complex], | ||
input_matrix: onp.ToJustComplex2D, | ||
sketch_size: onp.ToInt, | ||
rng: spt.ToRNG = None, | ||
rng: ToRNG = None, | ||
) -> onp.Array2D[np.complex64 | np.clongdouble]: ... |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.