Skip to content

Commit 0b76be2

Browse files
sichinagamtezzele
authored andcommitted
Use Number as svd_rank type
1 parent 8049ef3 commit 0b76be2

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

pydmd/preprocessing/randomized.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,19 @@
33
"""
44

55
from functools import partial
6-
from typing import Dict, Union
6+
from numbers import Number
7+
from typing import Dict
78

89
import numpy as np
910

1011
from pydmd.dmdbase import DMDBase
1112
from pydmd.preprocessing import PrePostProcessingDMD
1213
from pydmd.utils import compute_rqb
1314

14-
svd_rank_type = Union[int, float]
15-
1615

1716
def randomized_preprocessing(
1817
dmd: DMDBase,
19-
svd_rank: svd_rank_type,
18+
svd_rank: Number,
2019
oversampling: int = 10,
2120
power_iters: int = 2,
2221
test_matrix: np.ndarray = None,
@@ -49,7 +48,7 @@ def randomized_preprocessing(
4948
def _pre(
5049
state: Dict,
5150
X: np.ndarray,
52-
svd_rank: svd_rank_type,
51+
svd_rank: Number,
5352
oversampling: int,
5453
power_iters: int,
5554
test_matrix: np.ndarray,

0 commit comments

Comments
 (0)