def test_detrend_mean(self): S = np.random.random(100) * 2 - 1 S_nomean = KurslMethod.detrend(S, remove_type="mean") self.assertEqual(np.round(np.mean(S_nomean), 7), 0, "Removing mean should return mean 0")
def test_detrend_cubic(self): t = np.arange(0, 1, 0.005) S = t**3 + 2 * (t - 0.5)**2 + 5 S_nocubic = KurslMethod.detrend(S, remove_type="cubic") self.assertEqual(np.round(np.mean(S_nocubic), 7), 0, "Removing mean should return mean 0")
def test_detrend_default(self): "Default detrend is mean" S = np.random.random(100) * 2 + 1 S_default = KurslMethod.detrend(S) self.assertEqual(np.round(np.mean(S_default), 7), 0, "Default detrend is mean removing")