def test_check_imfs5(self): t = np.linspace(0, 1, 50) S = t + np.cos(np.cos(4. * t**2)) emd = EMD() emd.emd(S, t) imfs, res = emd.get_imfs_and_residue() vis = Visualisation(emd) imfs2, res2 = vis._check_imfs(imfs, res, False) assert (imfs == imfs2).all() assert (res == res2).all()
def test_check_imfs4(self): vis = Visualisation() imfs = np.arange(50).reshape(2, 25) with self.assertRaises(AttributeError): vis._check_imfs(imfs, None, True)
def test_check_imfs2(self): vis = Visualisation() with self.assertRaises(AttributeError): vis._check_imfs(None, None, False)
def test_check_imfs3(self): vis = Visualisation() imfs = np.arange(50).reshape(2, 25) vis._check_imfs(imfs, None, False)
def test_check_imfs(self): vis = Visualisation() imfs = np.arange(50).reshape(2, 25) res = np.arange(25) imfs, res = vis._check_imfs(imfs, res, False) assert len(imfs) == 2