Ejemplo n.º 1
0
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:])
Ejemplo n.º 2
0
def test_stationarizer_errors():
    operation = 'not_defined'
    stationarizer = Stationarizer(operation=operation)
    with pytest.raises(ValueError):
        stationarizer.fit(signal)
Ejemplo n.º 3
0
def test_stationarizer_transform(operation, expected):
    stationarizer = Stationarizer(operation=operation)

    assert_almost_equal(stationarizer.fit_transform(signal), expected)
Ejemplo n.º 4
0
def test_stationarizer_not_fitted():
    stationarizer = Stationarizer()
    with pytest.raises(NotFittedError):
        stationarizer.transform(signal)