Skip to content

Commit

Permalink
fix some issues with test nndmd
Browse files Browse the repository at this point in the history
  • Loading branch information
pswpswpsw committed Nov 6, 2024
1 parent a079b69 commit e3b0102
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions test/test_koopman.py
Original file line number Diff line number Diff line change
Expand Up @@ -932,18 +932,9 @@ def test_accuracy_nndmd_linear_system():
X, Y = sys.collect_data(x, n_int, n_traj)

for regressor in list_nndmd_regressors:
count = 0
while count < 10:
# create a model then train
model = Koopman(regressor=regressor)
model.fit(X.T, Y.T)

# check eigenvalues
try:
eigenvalues = np.sort(np.real(np.diag(model.lamda)))
assert_allclose([0.7, 0.8], eigenvalues, rtol=1e-2, atol=1e-2)
break
except:
count += 1

assert count == 0
# create a model then train
model = Koopman(regressor=regressor)
model.fit(X.T, Y.T)

eigenvalues = np.sort(np.real(np.diag(model.lamda)))
assert_allclose([0.7, 0.8], eigenvalues, rtol=1e-2, atol=1e-2)

0 comments on commit e3b0102

Please sign in to comment.