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
51634c6d
Commit
51634c6d
authored
4 years ago
by
David Schäfer
Browse files
Options
Downloads
Patches
Plain Diff
flagger: translation scheme positional->dmp
parent
983189e7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!193
Release 1.4
,
!188
Release 1.4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
saqc/flagger/dmpflagger.py
+4
-0
4 additions, 0 deletions
saqc/flagger/dmpflagger.py
saqc/flagger/positionalflagger.py
+19
-1
19 additions, 1 deletion
saqc/flagger/positionalflagger.py
with
23 additions
and
1 deletion
saqc/flagger/dmpflagger.py
+
4
−
0
View file @
51634c6d
...
...
@@ -245,3 +245,7 @@ class DmpFlagger(CategoricalFlagger):
new
.
_causes
=
causes
new
.
_comments
=
comments
return
new
@property
def
SUSPICIOUS
(
self
):
return
FLAGS
[
-
2
]
This diff is collapsed.
Click to expand it.
saqc/flagger/positionalflagger.py
+
19
−
1
View file @
51634c6d
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import
json
from
copy
import
deepcopy
import
pandas
as
pd
from
dios
import
DictOfSeries
from
saqc.flagger.baseflagger
import
BaseFlagger
,
COMPARATOR_MAP
from
saqc.lib.tools
import
assertScalar
,
toSequence
from
saqc.flagger.dmpflagger
import
DmpFlagger
from
saqc.lib.tools
import
toSequence
FLAGS
=
(
"
-1
"
,
"
0
"
,
"
1
"
,
"
2
"
)
...
...
@@ -105,6 +107,22 @@ class PositionalFlagger(BaseFlagger):
data
[
col_name
]
=
col
return
DictOfSeries
(
data
)
def
toDmpFlagger
(
self
):
self
=
PositionalFlagger
().
initFlags
(
flags
=
self
.
_flags
)
dmp_flagger
=
DmpFlagger
().
initFlags
(
data
=
self
.
_flags
)
flag_map
=
{
self
.
BAD
:
dmp_flagger
.
BAD
,
self
.
SUSPICIOUS
:
dmp_flagger
.
SUSPICIOUS
,
self
.
GOOD
:
dmp_flagger
.
GOOD
,
}
for
pos_flag
,
dmp_flag
in
flag_map
.
items
():
loc
=
self
.
isFlagged
(
flag
=
pos_flag
,
comparator
=
"
==
"
)
dmp_flagger
.
_flags
.
aloc
[
loc
]
=
dmp_flag
dmp_flagger
.
_comments
.
loc
[:]
=
self
.
_flags
.
to_df
().
applymap
(
lambda
v
:
json
.
dumps
({
"
flag
"
:
v
}))
dmp_flagger
.
_causes
.
loc
[:]
=
"
OTHER
"
return
dmp_flagger
@property
def
UNFLAGGED
(
self
):
return
FLAGS
[
0
]
...
...
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