def test_nonan_nomask(self): dmd = HODMD(d=3) dmd.fit(X=sample_data) for timeindex in range(sample_data.shape[1]): ds = dmd.reconstructions_of_timeindex(timeindex) for mx in ds: assert not np.ma.is_masked(mx) assert np.nan not in mx
def test_rec_method_weighted(self): dmd = HODMD(d=2, reconstruction_method=[10, 20]) dmd.fit(X=sample_data) assert (dmd.reconstructed_data.T[4] == np.average( dmd.reconstructions_of_timeindex(4), axis=0, weights=[10, 20]).T).all()
def test_rec_method_mean(self): dmd = HODMD(d=3, reconstruction_method='mean') dmd.fit(X=sample_data) assert (dmd.reconstructed_data.T[2] == np.mean( dmd.reconstructions_of_timeindex(2), axis=0).T).all()
def test_rec_method_first(self): dmd = HODMD(d=3, reconstruction_method='first') dmd.fit(X=sample_data) assert (dmd.reconstructed_data == dmd.reconstructions_of_timeindex() [:, 0].T).all()
def test_extract_versions_nonan(self): dmd = HODMD(d=3) dmd.fit(X=sample_data) for timeindex in range(sample_data.shape[1]): assert not np.nan in dmd.reconstructions_of_timeindex(timeindex)