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
e5ae35d4
Commit
e5ae35d4
authored
5 years ago
by
Bert Palm
🎇
Browse files
Options
Downloads
Patches
Plain Diff
added runner checks
parent
07735bc7
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
saqc/core/core.py
+21
-1
21 additions, 1 deletion
saqc/core/core.py
saqc/flagger/__init__.py
+1
-0
1 addition, 0 deletions
saqc/flagger/__init__.py
with
22 additions
and
1 deletion
saqc/core/core.py
+
21
−
1
View file @
e5ae35d4
...
...
@@ -9,6 +9,7 @@ from .config import Fields
from
.evaluator
import
evalExpression
from
..lib.plotting
import
plot
from
..lib.tools
import
setup
from
..flagger
import
FlaggerTemplate
,
BaseFlagger
,
SimpleFlagger
,
DmpFlagger
def
collectVariables
(
meta
,
flagger
,
data
,
flags
):
...
...
@@ -28,9 +29,28 @@ def collectVariables(meta, flagger, data, flags):
return
flags
def
runner
(
metafname
,
flagger
,
data
,
flags
=
None
,
nodata
=
np
.
nan
):
def
_check_input
(
data
,
flags
,
flagger
):
if
not
isinstance
(
data
,
pd
.
DataFrame
):
raise
TypeError
(
'
data must be of type pd.DataFrame
'
)
if
not
isinstance
(
flagger
,
FlaggerTemplate
):
flaggerlist
=
[
BaseFlagger
,
SimpleFlagger
,
DmpFlagger
]
raise
TypeError
(
f
'
flagger must be of type
{
flaggerlist
}
or any inherit class from
{
FlaggerTemplate
}
'
)
if
flags
is
None
:
return
if
not
isinstance
(
flags
,
pd
.
DataFrame
):
raise
TypeError
(
'
flags must be of type pd.DataFrame
'
)
refflags
=
flagger
.
initFlags
(
data
)
if
refflags
.
shape
!=
flags
.
shape
:
raise
ValueError
(
'
flags has not the same dimensions as flagger.initFlags() would return
'
)
def
runner
(
metafname
,
flagger
,
data
,
flags
=
None
,
nodata
=
np
.
nan
):
setup
()
_check_input
(
data
,
flags
,
flagger
)
meta
=
prepareConfig
(
readConfig
(
metafname
),
data
)
# NOTE: split meta into the test and some 'meta' data
tests
=
meta
[
meta
.
columns
.
to_series
().
filter
(
regex
=
Fields
.
TESTS
)]
...
...
This diff is collapsed.
Click to expand it.
saqc/flagger/__init__.py
+
1
−
0
View file @
e5ae35d4
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from
.template
import
FlaggerTemplate
from
.simpleflagger
import
SimpleFlagger
from
.dmpflagger
import
DmpFlagger
from
.positionalflagger
import
PositionalFlagger
...
...
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