11from enum import IntEnum
2- from typing import Any , Literal , Optional , TypeVar
2+ from typing import Any , Literal , Optional , TypeAlias , TypeVar
33
44import numpy as np
55
@@ -20,17 +20,13 @@ _WaveletFamily = Literal[
2020 "cmor" ,
2121]
2222
23- DataT = TypeVar ("DataT" , np .float32 , np .float64 )
23+ DataT = TypeVar ("DataT" , bound = np .float32 | np .float64 )
2424
2525CDataT = TypeVar (
26- "CDataT" ,
27- np .float32 ,
28- np .float64 ,
29- np .complex64 ,
30- np .complex128 ,
26+ "CDataT" , bound = np .float32 | np .float64 | np .complex64 | np .complex128
3127)
3228
33- _Kind = Literal ["all" , "continuous" , "discrete" ]
29+ _Kind : TypeAlias = Literal ["all" , "continuous" , "discrete" ]
3430
3531_Symmetry = Literal [
3632 "asymmetric" ,
@@ -53,6 +49,8 @@ class MODE(IntEnum):
5349 MODE_ANTIREFLECT = 8
5450 MODE_MAX = 9
5551
52+ ModeInt = MODE | Literal [- 1 , 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ]
53+
5654ModeName = Literal [
5755 "zero" ,
5856 "constant" ,
@@ -84,11 +82,11 @@ class _Modes:
8482
8583Modes = _Modes ()
8684
87- def wavelist (family : _WaveletFamily | None = ... , kind : _Kind = ... ) -> list [str ]: ...
88- def families (short : bool = ... ) -> list [str ]: ...
85+ def wavelist (family : _WaveletFamily | None = None , kind : _Kind = "all" ) -> list [str ]: ...
86+ def families (short : bool = True ) -> list [str ]: ...
8987
9088class Wavelet :
91- def __init__ (self , name : str = ... , filter_bank : Any = ... ) -> None : ...
89+ def __init__ (self , name : str = "" , filter_bank : Any = None ) -> None : ...
9290 def __len__ (self ) -> int : ...
9391 @property
9492 def name (self ) -> str : ...
@@ -140,7 +138,7 @@ class Wavelet:
140138 ) -> tuple [list [float ], list [float ], list [float ], list [float ]]: ...
141139
142140class ContinuousWavelet :
143- def __init__ (self , name : str = ... , dtype : DataT = ... ) -> None : ...
141+ def __init__ (self , name : str = "" , dtype : DataT = np . float64 ) -> None : ...
144142 @property
145143 def family_number (self ) -> int : ...
146144 @property
@@ -182,4 +180,6 @@ class ContinuousWavelet:
182180 @property
183181 def symmetry (self ) -> _Symmetry : ...
184182
185- def DiscreteContinuousWavelet (name : str = ..., filter_bank : Any = ...) -> Wavelet | ContinuousWavelet : ...
183+ def DiscreteContinuousWavelet (
184+ name : str = "" , filter_bank : Any = None
185+ ) -> Wavelet | ContinuousWavelet : ...
0 commit comments