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
4a190f44
Commit
4a190f44
authored
3 years ago
by
David Schäfer
Browse files
Options
Downloads
Patches
Plain Diff
[FIX] flagMissing needs to be masking="none" as we otherwise
likely flag the masked values
parent
a34908ca
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
saqc/funcs/breaks.py
+11
-2
11 additions, 2 deletions
saqc/funcs/breaks.py
saqc/funcs/flagtools.py
+1
-0
1 addition, 0 deletions
saqc/funcs/flagtools.py
with
12 additions
and
2 deletions
saqc/funcs/breaks.py
+
11
−
2
View file @
4a190f44
...
...
@@ -20,16 +20,22 @@ from saqc.constants import *
from
saqc.lib.tools
import
groupConsecutives
from
saqc.lib.types
import
FreqString
,
ColumnName
,
IntegerWindow
from
saqc.funcs.changepoints
import
assignChangePointCluster
from
saqc.core
import
flagging
,
Flags
from
saqc.core.flags
import
Flags
from
saqc.core.history
import
History
from
saqc.core.register
import
_isflagged
,
flagging
@flagging
(
masking
=
"
field
"
,
module
=
"
breaks
"
)
# NOTE:
# masking="none" as we otherwise might interprete
# the masked values as missing data
@flagging
(
masking
=
"
none
"
,
module
=
"
breaks
"
)
def
flagMissing
(
data
:
DictOfSeries
,
field
:
ColumnName
,
flags
:
Flags
,
nodata
:
float
=
np
.
nan
,
flag
:
float
=
BAD
,
to_mask
:
float
=
UNFLAGGED
,
**
kwargs
)
->
Tuple
[
DictOfSeries
,
Flags
]:
"""
...
...
@@ -55,11 +61,14 @@ def flagMissing(
flags : saqc.Flags
The quality flags of data
"""
datacol
=
data
[
field
]
if
np
.
isnan
(
nodata
):
mask
=
datacol
.
isna
()
else
:
mask
=
datacol
==
nodata
mask
=
~
_isflagged
(
flags
[
field
],
to_mask
)
&
mask
flags
[
mask
,
field
]
=
flag
return
data
,
flags
...
...
This diff is collapsed.
Click to expand it.
saqc/funcs/flagtools.py
+
1
−
0
View file @
4a190f44
...
...
@@ -82,6 +82,7 @@ def clearFlags(
forceFlags : set whole column to a flag value
flagUnflagged : set flag value at all unflagged positions
"""
# NOTE: do we really need this?
if
"
flag
"
in
kwargs
:
kwargs
=
{
**
kwargs
}
# copy
flag
=
kwargs
.
pop
(
"
flag
"
)
...
...
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