Skip to content
Snippets Groups Projects
Commit 6c5a9425 authored by Peter Lünenschloß's avatar Peter Lünenschloß
Browse files

test for grubbs test implemented

parent 206cefc9
No related branches found
No related tags found
3 merge requests!193Release 1.4,!188Release 1.4,!49Dataprocessing features
......@@ -4,18 +4,15 @@
import pytest
import numpy as np
import pandas as pd
from dios import dios
from test.common import TESTFLAGGER
import matplotlib.pyplot as plt
from saqc.funcs.data_modelling import (
modelling_polyFit
)
import numpy.polynomial.polynomial as poly
TF=TESTFLAGGER[:1]
TF = TESTFLAGGER[:1]
@pytest.mark.parametrize("flagger", TF)
@pytest.mark.parametrize("dat", [pytest.lazy_fixture("course_2")])
def test_modelling_polyFit_forRegular(dat, flagger):
......
......@@ -12,7 +12,8 @@ from saqc.funcs.spikes_detection import (
spikes_flagSlidingZscore,
spikes_flagBasic,
spikes_flagRaise,
spikes_flagMultivarScores
spikes_flagMultivarScores,
spikes_flagGrubbs
)
from test.common import TESTFLAGGER
......@@ -120,3 +121,11 @@ def test_flagMultivarScores(dat, flagger):
assert isflagged[characteristics['raise']].all()
assert not isflagged[characteristics['return']].any()
assert not isflagged[characteristics['drop']].any()
@pytest.mark.parametrize("flagger", TESTFLAGGER)
@pytest.mark.parametrize("dat", [pytest.lazy_fixture("course_3")])
def test_grubbs(dat, flagger):
data, char_dict = dat(freq='10min', periods=45, initial_level=0, final_level=0, crowd_size=1, crowd_spacing=3, out_val=-10)
flagger = flagger.initFlags(data)
data, result_flagger = spikes_flagGrubbs(data, 'data', flagger, winsz=20, min_periods=15)
assert result_flagger.isFlagged('data')[char_dict["drop"]].all()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment