Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SaQC
Manage
Activity
Members
Labels
Plan
Issues
36
Issue boards
Milestones
Wiki
Code
Merge requests
8
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
rdm-software
SaQC
Commits
be7208a1
Commit
be7208a1
authored
4 years ago
by
Peter Lünenschloß
Browse files
Options
Downloads
Patches
Plain Diff
added missing-data fixture to conftest
parent
52b88746
No related branches found
Branches containing commit
No related tags found
Tags containing commit
4 merge requests
!193
Release 1.4
,
!188
Release 1.4
,
!49
Dataprocessing features
,
!44
Dataprocessing features
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/funcs/conftest.py
+24
-1
24 additions, 1 deletion
test/funcs/conftest.py
test/funcs/test_proc_functions.py
+21
-0
21 additions, 0 deletions
test/funcs/test_proc_functions.py
with
45 additions
and
1 deletion
test/funcs/conftest.py
+
24
−
1
View file @
be7208a1
...
...
@@ -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
This diff is collapsed.
Click to expand it.
test/funcs/test_proc_functions.py
0 → 100644
+
21
−
0
View file @
be7208a1
#! /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
[]
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment