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
06328dca
Commit
06328dca
authored
11 months ago
by
Peter Lünenschloß
Browse files
Options
Downloads
Patches
Plain Diff
modified/verbosified andGroup and orGroup docstring
parent
955e26c7
No related branches found
Branches containing commit
No related tags found
1 merge request
!856
modified/verbosified andGroup and orGroup docstring
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
docs/funcs/flagTools.rst
+2
-0
2 additions, 0 deletions
docs/funcs/flagTools.rst
docs/funcs/genericWrapper.rst
+3
-3
3 additions, 3 deletions
docs/funcs/genericWrapper.rst
docs/funcs/tools.rst
+1
-0
1 addition, 0 deletions
docs/funcs/tools.rst
saqc/funcs/flagtools.py
+96
-2
96 additions, 2 deletions
saqc/funcs/flagtools.py
with
102 additions
and
5 deletions
docs/funcs/flagTools.rst
+
2
−
0
View file @
06328dca
...
...
@@ -15,3 +15,5 @@ Flagtools
~SaQC.flagManual
~SaQC.flagDummy
~SaQC.transferFlags
~SaQC.andGroup
~SaQC.orGroup
This diff is collapsed.
Click to expand it.
docs/funcs/genericWrapper.rst
+
3
−
3
View file @
06328dca
...
...
@@ -13,6 +13,6 @@ Generic Functions
~SaQC.processGeneric
~SaQC.flagGeneric
~SaQC.
rolling
~SaQC.
transform
~SaQC.resample
~SaQC.
andGroup
~SaQC.
orGroup
This diff is collapsed.
Click to expand it.
docs/funcs/tools.rst
+
1
−
0
View file @
06328dca
...
...
@@ -15,3 +15,4 @@ Tools
~SaQC.renameField
~SaQC.selectTime
~SaQC.plot
This diff is collapsed.
Click to expand it.
saqc/funcs/flagtools.py
+
96
−
2
View file @
06328dca
...
...
@@ -631,7 +631,12 @@ class FlagtoolsMixin:
**
kwargs
,
)
->
"
SaQC
"
:
"""
Flag all values, if all the given ``field`` values are already flagged.
Logical AND operation for Flags.
Flag the variable(s) `field` at every period, at wich `field` in all of the saqc objects in
`group` is flagged.
See Examples section for examples.
Parameters
----------
...
...
@@ -639,6 +644,64 @@ class FlagtoolsMixin:
A collection of ``SaQC`` objects. Flag checks are performed on all ``SaQC`` objects
based on the variables specified in ``field``. Whenever all monitored variables
are flagged, the associated timestamps will receive a flag.
Examples
--------
Flag data, if the values are above a certain threshold (determined by :py:meth:`~saqc.SaQC.flagRange`) AND if the values are
constant for 3 periods (determined by :py:meth:`~saqc.SaQC.flagConstants`)
.. doctest:: andGroupExample
>>>
dat
=
pd
.
Series
([
1
,
0
,
0
,
0
,
1
,
2
,
3
,
4
,
5
,
5
,
5
,
4
],
name
=
'
data
'
,
index
=
pd
.
date_range
(
'
2000
'
,
freq
=
'
10min
'
,
periods
=
12
))
>>>
qc
=
saqc
.
SaQC
(
dat
)
>>>
qc
=
qc
.
andGroup
(
'
data
'
,
group
=
[
qc
.
flagRange
(
'
data
'
,
max
=
4
),
qc
.
flagConstants
(
'
data
'
,
thresh
=
0
,
window
=
3
)])
>>>
qc
.
flags
[
'
data
'
]
2000
-
01
-
01
00
:
00
:
00
-
inf
2000
-
01
-
01
00
:
10
:
00
-
inf
2000
-
01
-
01
00
:
20
:
00
-
inf
2000
-
01
-
01
00
:
30
:
00
-
inf
2000
-
01
-
01
00
:
40
:
00
-
inf
2000
-
01
-
01
00
:
50
:
00
-
inf
2000
-
01
-
01
01
:
00
:
00
-
inf
2000
-
01
-
01
01
:
10
:
00
-
inf
2000
-
01
-
01
01
:
20
:
00
255.0
2000
-
01
-
01
01
:
30
:
00
255.0
2000
-
01
-
01
01
:
40
:
00
255.0
2000
-
01
-
01
01
:
50
:
00
-
inf
Freq
:
10
min
,
dtype
:
float64
Masking data, so that a test result only gets assigned during daytime (between 6 and 18 o clock for example).
The daytime condition is generated via :py:meth:`~saqc.SaQC.flagGeneric`:
.. doctest:: andGroupExample
>>>
from
saqc.lib.tools
import
periodicMask
>>>
mask_func
=
lambda
x
:
~
periodicMask
(
x
.
index
,
'
06:00:00
'
,
'
18:00:00
'
,
True
)
>>>
dat
=
pd
.
Series
(
range
(
100
),
name
=
'
data
'
,
index
=
pd
.
date_range
(
'
2000
'
,
freq
=
'
4h
'
,
periods
=
100
))
>>>
qc
=
saqc
.
SaQC
(
dat
)
>>>
qc
=
qc
.
andGroup
(
'
data
'
,
group
=
[
qc
.
flagRange
(
'
data
'
,
max
=
5
),
qc
.
flagGeneric
(
'
data
'
,
func
=
mask_func
)])
>>>
qc
.
flags
[
'
data
'
].
head
(
20
)
2000
-
01
-
01
00
:
00
:
00
-
inf
2000
-
01
-
01
04
:
00
:
00
-
inf
2000
-
01
-
01
08
:
00
:
00
-
inf
2000
-
01
-
01
12
:
00
:
00
-
inf
2000
-
01
-
01
16
:
00
:
00
-
inf
2000
-
01
-
01
20
:
00
:
00
-
inf
2000
-
01
-
02
00
:
00
:
00
-
inf
2000
-
01
-
02
04
:
00
:
00
-
inf
2000
-
01
-
02
08
:
00
:
00
255.0
2000
-
01
-
02
12
:
00
:
00
255.0
2000
-
01
-
02
16
:
00
:
00
255.0
2000
-
01
-
02
20
:
00
:
00
-
inf
2000
-
01
-
03
00
:
00
:
00
-
inf
2000
-
01
-
03
04
:
00
:
00
-
inf
2000
-
01
-
03
08
:
00
:
00
255.0
2000
-
01
-
03
12
:
00
:
00
255.0
2000
-
01
-
03
16
:
00
:
00
255.0
2000
-
01
-
03
20
:
00
:
00
-
inf
2000
-
01
-
04
00
:
00
:
00
-
inf
2000
-
01
-
04
04
:
00
:
00
-
inf
Freq
:
4
h
,
dtype
:
float64
"""
return
_groupOperation
(
saqc
=
self
,
...
...
@@ -666,7 +729,12 @@ class FlagtoolsMixin:
**
kwargs
,
)
->
"
SaQC
"
:
"""
Flag all values, if at least one of the given ``field`` values is already flagged.
Logical OR operation for Flags.
Flag the variable(s) `field` at every period, at wich `field` is flagged in at least one of the saqc objects
in `group`.
See Examples section for examples.
Parameters
----------
...
...
@@ -674,6 +742,32 @@ class FlagtoolsMixin:
A collection of ``SaQC`` objects. Flag checks are performed on all ``SaQC`` objects
based on the variables specified in :py:attr:`field`. Whenever any of monitored variables
is flagged, the associated timestamps will receive a flag.
Examples
--------
Flag data, if the values are above a certain threshold (determined by :py:meth:`~saqc.SaQC.flagRange`) OR if the values are
constant for 3 periods (determined by :py:meth:`~saqc.SaQC.flagConstants`)
.. doctest:: orGroupExample
>>>
dat
=
pd
.
Series
([
1
,
0
,
0
,
0
,
0
,
2
,
3
,
4
,
5
,
5
,
7
,
8
],
name
=
'
data
'
,
index
=
pd
.
date_range
(
'
2000
'
,
freq
=
'
10min
'
,
periods
=
12
))
>>>
qc
=
saqc
.
SaQC
(
dat
)
>>>
qc
=
qc
.
orGroup
(
'
data
'
,
group
=
[
qc
.
flagRange
(
'
data
'
,
max
=
5
),
qc
.
flagConstants
(
'
data
'
,
thresh
=
0
,
window
=
3
)])
>>>
qc
.
flags
[
'
data
'
]
2000
-
01
-
01
00
:
00
:
00
-
inf
2000
-
01
-
01
00
:
10
:
00
255.0
2000
-
01
-
01
00
:
20
:
00
255.0
2000
-
01
-
01
00
:
30
:
00
255.0
2000
-
01
-
01
00
:
40
:
00
255.0
2000
-
01
-
01
00
:
50
:
00
-
inf
2000
-
01
-
01
01
:
00
:
00
-
inf
2000
-
01
-
01
01
:
10
:
00
-
inf
2000
-
01
-
01
01
:
20
:
00
-
inf
2000
-
01
-
01
01
:
30
:
00
-
inf
2000
-
01
-
01
01
:
40
:
00
255.0
2000
-
01
-
01
01
:
50
:
00
255.0
Freq
:
10
min
,
dtype
:
float64
"""
return
_groupOperation
(
saqc
=
self
,
...
...
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