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
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
8f6e996e
Commit
8f6e996e
authored
5 years ago
by
Peter Lünenschloß
Browse files
Options
Downloads
Patches
Plain Diff
setflag methods now take series' of flags as arguments to set
parent
99ec8f78
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/flagger/baseflagger.py
+15
-6
15 additions, 6 deletions
saqc/flagger/baseflagger.py
with
15 additions
and
6 deletions
saqc/flagger/baseflagger.py
+
15
−
6
View file @
8f6e996e
...
...
@@ -61,8 +61,11 @@ class BaseFlagger:
# have to stack it first
# (try flags.stack[flags<flag] = flag and than unstack.)
flags
=
flags
.
values
flags
[
flags
<
flag
]
=
flag
if
not
isinstance
(
flags
,
pd
.
Series
):
flags
[
flags
<
flag
]
=
flag
else
:
mask
=
flags
<
flag
flags
[
mask
]
=
flag
[
mask
]
return
np
.
squeeze
(
flags
)
@property
...
...
@@ -103,10 +106,16 @@ class BaseFlagger:
return
flags
def
_checkFlag
(
self
,
flag
):
if
flag
not
in
self
.
flags
:
raise
ValueError
(
f
"
Invalid flag
'
{
flag
}
'
.
"
f
"
Possible choices are
{
list
(
self
.
flags
.
categories
)[
1
:
]
}
"
)
if
isinstance
(
flag
,
pd
.
Series
):
if
flag
.
dtype
!=
self
.
flags
:
raise
TypeError
(
f
"
Passed flags series is of invalid
'
{
flag
.
dtype
}
'
dtype.
"
f
"
Expected
{
self
.
flags
}
type with ordered categories
{
list
(
self
.
flags
.
categories
)
}
"
)
else
:
if
flag
not
in
self
.
flags
:
raise
ValueError
(
f
"
Invalid flag
'
{
flag
}
'
.
"
f
"
Possible choices are
{
list
(
self
.
flags
.
categories
)[
1
:
]
}
"
)
return
flag
def
nextTest
(
self
):
...
...
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