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
b6111449
Commit
b6111449
authored
6 years ago
by
Bert Palm
🎇
Browse files
Options
Downloads
Patches
Plain Diff
make DmpFlagger run
parent
cdc3ee49
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dsl/evaluator.py
+0
-4
0 additions, 4 deletions
dsl/evaluator.py
flagger/dmpflagger.py
+3
-4
3 additions, 4 deletions
flagger/dmpflagger.py
funcs/functions.py
+4
-1
4 additions, 1 deletion
funcs/functions.py
with
7 additions
and
9 deletions
dsl/evaluator.py
+
0
−
4
View file @
b6111449
...
...
@@ -119,10 +119,6 @@ def evalExpression(expr: str, flagger: BaseFlagger,
else
:
raise
TypeError
(
node
)
if
not
(
data
.
columns
==
flags
.
columns
).
all
():
raise
TypeError
(
"
arguments
'
data
'
and
'
flags
'
need the same column names
"
)
FUNCTIONS
=
initFunctionNamespace
(
nodata
,
flagger
)
namespace
=
{
**
namespace
,
**
{
"
data
"
:
data
,
"
flags
"
:
flags
,
"
this
"
:
field
}}
...
...
This diff is collapsed.
Click to expand it.
flagger/dmpflagger.py
+
3
−
4
View file @
b6111449
...
...
@@ -26,18 +26,17 @@ class DmpFlagger(BaseFlagger):
def
emptyFlags
(
self
,
data
,
value
=
"
NIL
"
,
**
kwargs
):
columns
=
data
.
columns
if
isinstance
(
data
,
pd
.
DataFrame
)
else
[
data
.
name
]
columns
=
pd
.
MultiIndex
.
from_product
([
columns
,
self
.
flag_fields
])
return
pd
.
DataFrame
(
data
=
value
,
columns
=
columns
,
index
=
data
.
index
)
return
pd
.
DataFrame
(
data
=
value
,
columns
=
columns
,
index
=
data
.
index
)
def
setFlag
(
self
,
flags
,
flag
=
Flags
.
BAD
,
cause
=
"
NIL
"
,
comment
=
"
NIL
"
,
**
kwargs
):
self
.
_isFlag
(
flag
)
for
field
,
f
in
zip
(
self
.
flag_fields
,
[
flag
,
cause
,
comment
]):
flags
.
loc
[:,
(
slice
(
None
),
field
)
]
=
f
flags
.
loc
[:,
field
]
=
f
return
flags
def
isFlagged
(
self
,
flags
,
flag
=
None
):
self
.
_isFlag
(
flag
)
flagcol
=
flags
.
loc
[:,
(
slice
(
None
),
FlagFields
.
FLAG
)
].
squeeze
()
flagcol
=
flags
.
loc
[:,
FlagFields
.
FLAG
].
squeeze
()
return
super
().
isFlagged
(
flagcol
,
flag
)
def
_isFlag
(
self
,
flag
):
...
...
This diff is collapsed.
Click to expand it.
funcs/functions.py
+
4
−
1
View file @
b6111449
...
...
@@ -38,7 +38,10 @@ def flagGeneric(data, flags, field, flagger, nodata=np.nan, **flag_params):
to_flag
=
result
.
filled
(
True
)
fchunk
=
flagger
.
setFlag
(
flags
=
flags
.
loc
[
to_flag
,
field
],
**
flag_params
)
flags
.
loc
[
to_flag
,
field
]
=
fchunk
# .values transform the data to NumPy array, so the assignment
# can work for single- and multi- indexed data.
flags
.
loc
[
to_flag
,
field
]
=
fchunk
.
values
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