|
1 | 1 | from collections.abc import Sequence
|
2 |
| -from typing import Literal, TypeAlias, overload |
| 2 | +from typing import Any, Literal, TypeAlias, overload |
3 | 3 | from typing_extensions import Unpack
|
4 | 4 |
|
5 | 5 | import numpy as np
|
@@ -37,6 +37,12 @@ __all__ = [
|
37 | 37 |
|
38 | 38 | _Array_f8_1d: TypeAlias = np.ndarray[tuple[int], np.dtype[np.float64]]
|
39 | 39 | _Array_f8_2d: TypeAlias = np.ndarray[tuple[int, int], np.dtype[np.float64]]
|
| 40 | +_Weights: TypeAlias = ( |
| 41 | + Sequence[AnyReal] |
| 42 | + | np.ndarray[tuple[int], np.dtype[np.floating[Any]]] |
| 43 | + | np.ndarray[tuple[int], np.dtype[np.integer[Any]]] |
| 44 | + | np.ndarray[tuple[int], np.dtype[np.bool_]] |
| 45 | +) |
40 | 46 |
|
41 | 47 | _Norm: TypeAlias = Literal[2, "approximate", "subsample"]
|
42 | 48 | _WindowLength: TypeAlias = int | np.int16 | np.int32 | np.int64
|
@@ -111,7 +117,7 @@ _WindowNeedsParams: TypeAlias = Literal[
|
111 | 117 | "kbd",
|
112 | 118 | ]
|
113 | 119 |
|
114 |
| -def general_cosine(M: _WindowLength, a: Sequence[AnyReal], sym: op.CanBool = True) -> _Array_f8_1d: ... |
| 120 | +def general_cosine(M: _WindowLength, a: _Weights, sym: op.CanBool = True) -> _Array_f8_1d: ... |
115 | 121 | def boxcar(M: _WindowLength, sym: op.CanBool = True) -> _Array_f8_1d: ...
|
116 | 122 | def triang(M: _WindowLength, sym: op.CanBool = True) -> _Array_f8_1d: ...
|
117 | 123 | def parzen(M: _WindowLength, sym: op.CanBool = True) -> _Array_f8_1d: ...
|
|
0 commit comments