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
6143c92e
Commit
6143c92e
authored
3 years ago
by
David Schäfer
Browse files
Options
Downloads
Patches
Plain Diff
[FIX] excess history column for new variables through generic.flag
parent
5c97a4de
No related branches found
No related tags found
2 merge requests
!271
Static expansion of regular expressions
,
!260
Follow-Up Translations
Pipeline
#24687
passed with stage
in 1 minute and 57 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
saqc/funcs/generic.py
+6
-9
6 additions, 9 deletions
saqc/funcs/generic.py
with
6 additions
and
9 deletions
saqc/funcs/generic.py
+
6
−
9
View file @
6143c92e
...
...
@@ -3,7 +3,7 @@
from
functools
import
partial
from
inspect
import
signature
from
typing
import
Tuple
,
Any
,
Union
,
Callable
from
typing
import
Tuple
,
Union
,
Callable
import
numpy
as
np
import
pandas
as
pd
...
...
@@ -144,8 +144,8 @@ def process(
>>>
lambda
temperature
,
uncertainty
:
np
.
round
(
temperature
)
*
np
.
sqrt
(
uncertainty
)
"""
# we get the data unmaske
s
in order to also receive flags,
# so let's
ge
to the masking manually
# we get the data unmaske
d
in order to also receive flags,
# so let's
do
to the masking manually
data_masked
,
_
=
_maskData
(
data
,
flags
,
data
.
columns
,
to_mask
)
data
[
field
]
=
_execGeneric
(
flags
,
data_masked
,
func
,
field
,
nodata
).
squeeze
()
...
...
@@ -245,8 +245,8 @@ def flag(
>>>
lambda
level
:
np
.
sqrt
(
level
)
>
7
"""
# we get the data unmaske
s
in order to also receive flags,
# so let's
ge
to the masking manually
# we get the data unmaske
d,
in order to also receive flags,
# so let's
do
to the masking manually
data_masked
,
_
=
_maskData
(
data
,
flags
,
data
.
columns
,
to_mask
)
mask
=
_execGeneric
(
flags
,
data_masked
,
func
,
field
,
nodata
).
squeeze
()
...
...
@@ -255,9 +255,6 @@ def flag(
if
not
np
.
issubdtype
(
mask
.
dtype
,
np
.
bool_
):
raise
TypeError
(
f
"
generic expression does not return a boolean array
"
)
if
field
not
in
flags
.
columns
:
flags
[
field
]
=
pd
.
Series
(
UNFLAGGED
,
index
=
mask
.
index
,
name
=
field
)
flags
[
mask
,
field
]
=
flag
flags
[
field
]
=
mask
.
replace
({
False
:
UNFLAGGED
,
True
:
BAD
})
return
data
,
flags
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