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
8306bf3d
Commit
8306bf3d
authored
3 years ago
by
David Schäfer
Browse files
Options
Downloads
Patches
Plain Diff
[FIX] PositionalTranslator flags and masking
parent
50af938d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
saqc/core/translator/positionaltranslator.py
+11
-6
11 additions, 6 deletions
saqc/core/translator/positionaltranslator.py
with
11 additions
and
6 deletions
saqc/core/translator/positionaltranslator.py
+
11
−
6
View file @
8306bf3d
...
...
@@ -26,9 +26,16 @@ class PositionalTranslator(Translator):
Implements the translation from and to the flagging scheme implemented by CHS
"""
TO_MASK
=
DOUBTFUL
_FORWARD
:
ForwardMap
=
{
0
:
UNFLAGGED
,
1
:
DOUBTFUL
,
2
:
BAD
}
TO_MASK
=
DOUBTFUL
+
1
_FORWARD
:
ForwardMap
=
{
-
6
:
UNFLAGGED
,
-
5
:
UNFLAGGED
,
-
2
:
UNFLAGGED
,
0
:
UNFLAGGED
,
1
:
DOUBTFUL
,
2
:
BAD
,
}
_BACKWARD
:
BackwardMap
=
{
UNTOUCHED
:
0
,
UNFLAGGED
:
0
,
...
...
@@ -88,9 +95,7 @@ class PositionalTranslator(Translator):
out
=
{}
for
field
in
flags
.
columns
:
thist
=
flags
.
history
[
field
].
hist
.
replace
(
self
.
_BACKWARD
).
astype
(
int
)
# Concatenate the single flag values. There are faster and more
# complicated approaches (see former `PositionalFlagger`), but
# this method shouldn't be called that often
# concatenate the single flag values
ncols
=
thist
.
shape
[
-
1
]
init
=
9
*
10
**
ncols
bases
=
10
**
np
.
arange
(
ncols
-
1
,
-
1
,
-
1
)
...
...
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