Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SaQC
Manage
Activity
Members
Labels
Plan
Issues
35
Issue boards
Milestones
Wiki
Code
Merge requests
7
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
3b90dabd
Commit
3b90dabd
authored
3 years ago
by
Peter Lünenschloß
Browse files
Options
Downloads
Patches
Plain Diff
test implemented/minor bfx
parent
48eeddf8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!256
Filter funcs
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
saqc/funcs/constants.py
+2
-2
2 additions, 2 deletions
saqc/funcs/constants.py
saqc/funcs/noise.py
+6
-3
6 additions, 3 deletions
saqc/funcs/noise.py
tests/funcs/test_functions.py
+15
-0
15 additions, 0 deletions
tests/funcs/test_functions.py
with
23 additions
and
5 deletions
saqc/funcs/constants.py
+
2
−
2
View file @
3b90dabd
...
...
@@ -148,8 +148,8 @@ def flagByVariance(
lambda
x
:
varQC
(
x
,
max_missing
,
max_consec_missing
),
window
,
thresh
,
min_periods
=
min_periods
,
comparator
=
operator
.
lt
,
operator
.
lt
,
min_periods
=
min_periods
)
flags
[
to_set
[
to_set
].
index
,
field
]
=
flag
...
...
This diff is collapsed.
Click to expand it.
saqc/funcs/noise.py
+
6
−
3
View file @
3b90dabd
...
...
@@ -59,19 +59,22 @@ def flagByStatLowPass(
datcol
=
data
[
field
]
if
not
min_periods
:
min_periods
=
0
if
not
sub_thresh
:
sub_thresh
=
thresh
winsz
=
pd
.
Timedelta
(
winsz
)
if
sub_winsz
:
sub_winsz
=
pd
.
Timedelta
(
sub_winsz
)
to_set
=
statPass
(
datcol
,
stat
,
winsz
,
thresh
,
operator
.
gt
,
sub_winsz
,
sub_thresh
,
min_periods
,
comparator
=
operator
.
gt
,
min_periods
)
flags
[
to_set
[
to_set
].
index
,
field
]
=
flag
return
data
,
flags
This diff is collapsed.
Click to expand it.
tests/funcs/test_functions.py
+
15
−
0
View file @
3b90dabd
...
...
@@ -2,7 +2,10 @@
# -*- coding: utf-8 -*-
import
dios
import
pandas
as
pd
import
numpy
as
np
from
saqc.funcs.noise
import
flagByStatLowPass
from
saqc.constants
import
*
from
saqc.core
import
initFlagsLike
from
saqc.funcs.drift
import
(
...
...
@@ -30,6 +33,18 @@ def field(data):
return
data
.
columns
[
0
]
def
test_statPass
():
data
=
pd
.
Series
(
0
,
index
=
pd
.
date_range
(
'
2000
'
,
'
2001
'
,
freq
=
'
1D
'
),
name
=
'
data
'
)
noise
=
[
-
1
,
1
]
*
10
data
[
100
:
120
]
=
noise
data
[
200
:
210
]
=
noise
[:
10
]
data
=
dios
.
DictOfSeries
(
data
)
flags
=
initFlagsLike
(
data
)
data
,
flags
=
flagByStatLowPass
(
data
,
'
data
'
,
flags
,
np
.
std
,
'
20D
'
,
0.999
,
'
5D
'
,
0.999
,
0
,
flag
=
BAD
)
assert
(
flags
[
'
data
'
]
==
BAD
).
sum
()
==
21
assert
(
flags
[
'
data
'
][
200
:
210
]
<
BAD
).
all
()
def
test_flagRange
(
data
,
field
):
min
,
max
=
10
,
90
flags
=
initFlagsLike
(
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