Skip to content

Commit 0bc0fe3

Browse files
committed
allow s to be passed as array_like
1 parent 6051cb0 commit 0bc0fe3

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

pydmd/bopdmd.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1486,14 +1486,15 @@ def fit_econ(self, s, V, t):
14861486
basis when initializing the BOPDMD object.
14871487
14881488
:param s: the singular values.
1489-
:type s: numpy.ndarray
1489+
:type s: array_like
14901490
:param V: the right singular vectors.
14911491
:type V: numpy.ndarray
14921492
:param t: the input time vector.
14931493
:type t: numpy.ndarray
14941494
"""
14951495
self._reset()
14961496
self._time = np.asarray(t).squeeze()
1497+
s = np.asarray(s).squeeze()
14971498

14981499
if self._proj_basis is None or not self._use_proj:
14991500
msg = """
@@ -1516,11 +1517,7 @@ def fit_econ(self, s, V, t):
15161517
msg = "Input time vector t must be one-dimensional."
15171518
raise ValueError(msg)
15181519

1519-
if (
1520-
not isinstance(s, np.ndarray)
1521-
or s.ndim != 1
1522-
or len(s) != self._svd_rank
1523-
):
1520+
if (s.ndim != 1 or len(s) != self._svd_rank):
15241521
msg = """
15251522
s must be a 1D numpy.ndarray of length {}.
15261523
"""

0 commit comments

Comments
 (0)