def test_select_modes(self): def stable_modes(dmd_object): toll = 1e-3 return np.abs(np.abs(dmd_object.eigs) - 1) < toll dmd = DMD(svd_rank=10) dmd.fit(sample_data) exp = dmd.reconstructed_data dmd.select_modes(stable_modes) np.testing.assert_array_almost_equal(exp, dmd.reconstructed_data)
def test_integral_contribution_reconstruction(self): dmd = DMD(svd_rank=10) dmd.fit(sample_data) exp = dmd.reconstructed_data dmd.select_modes(DMDBase.ModesSelectors.integral_contribution(2)) np.testing.assert_array_almost_equal(exp, dmd.reconstructed_data)