def test_reconstructed_data(self): dmd = FbDMD(exact=True, svd_rank=-1) dmd.fit(X=sample_data) dmd_data = dmd.reconstructed_data dmd_data_correct = np.load('tests/test_datasets/fbdmd_data.npy') assert np.allclose(dmd_data, dmd_data_correct)
def test_plot_eigs_2(self): dmd = FbDMD(svd_rank=-1) dmd.fit(X=sample_data) dmd.plot_eigs(show_axes=False, show_unit_circle=False) plt.close()
def test_eigs_modulus_2(self): dmd = FbDMD(svd_rank=-1, exact=True) dmd.fit(X=sample_data) np.testing.assert_almost_equal(np.linalg.norm(dmd.eigs[1]), 1., decimal=6)
def test_eigs_2(self): dmd = FbDMD(svd_rank=1) dmd.fit(X=sample_data) assert len(dmd.eigs) == 1
def test_dynamics(self): dmd = FbDMD(svd_rank=-1) dmd.fit(X=sample_data) assert dmd.dynamics.shape == (2, 100)
def test_truncation_shape(self): dmd = FbDMD(svd_rank=1) dmd.fit(X=sample_data) assert dmd.modes.shape[1] == 1
def test_modes_shape(self): dmd = FbDMD(svd_rank=-1) dmd.fit(X=sample_data) assert dmd.modes.shape[1] == 2