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

added missing-data fixture to conftest

parent 52b88746
No related branches found
No related tags found
4 merge requests!193Release 1.4,!188Release 1.4,!49Dataprocessing features,!44Dataprocessing features
......@@ -10,7 +10,8 @@ def char_dict():
return {"raise": pd.DatetimeIndex([]),
"drop": pd.DatetimeIndex([]),
"peak": pd.DatetimeIndex([]),
"return": pd.DatetimeIndex([])}
"return": pd.DatetimeIndex([]),
"missing": pd.DatetimeIndex([])}
@pytest.fixture
......@@ -124,3 +125,25 @@ def course_4(char_dict):
return data, char_dict
return fix_funk
@pytest.fixture
def course_5(char_dict):
# NAN_holes values , that remain on value level "base_level" and than begin exposing an outlierish or
# spikey value of magnitude "out_val" every second timestep, starting at periods/2, with the first spike. number
# periods better be even!
# periods better be greater 5
def fix_funk(freq='10min', periods=100, nan_slice=slice(0, None, 5), initial_level=0, final_level=10,
initial_index=pd.Timestamp(2000, 1, 1, 0, 0, 0), char_dict=char_dict):
t_index = pd.date_range(initial_index, freq=freq, periods=periods)
values = np.linspace(initial_level, final_level, periods)
s = pd.Series(values, index=t_index)
s[nan_slice] = np.nan
char_dict['missing'] = s[nan_slice].index
data = DictOfSeries(data=s, columns=['data'])
return data, char_dict
return fix_funk
return fix_funk
\ No newline at end of file
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import pytest
import numpy as np
import pandas as pd
import dios
from saqc.funcs.proc_functions import (
proc_interpolateMissing,
proc_resample,
proc_transform
)
from test.common import TESTFLAGGER
@pytest.mark.parametrize("flagger", TESTFLAGGER)
def test_interpolateMissing(course_1, flagger):
data, *_ = course_1(periods=100)
data[1] = np.nan
data[]
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