def test_stationarizer_resample(operation, expected): stationarizer = Stationarizer(operation=operation) signal_1d = signal.reshape(-1) stationarizer.fit(signal_1d) assert_almost_equal(stationarizer.resample(signal_1d), signal_1d[1:])
def test_stationarizer_errors(): operation = 'not_defined' stationarizer = Stationarizer(operation=operation) with pytest.raises(ValueError): stationarizer.fit(signal)
def test_stationarizer_transform(operation, expected): stationarizer = Stationarizer(operation=operation) assert_almost_equal(stationarizer.fit_transform(signal), expected)
def test_stationarizer_not_fitted(): stationarizer = Stationarizer() with pytest.raises(NotFittedError): stationarizer.transform(signal)