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
7
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
e8f9fce8
Commit
e8f9fce8
authored
3 years ago
by
David Schäfer
Committed by
Bert Palm
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
reader: fixed the loss of function names through the config interface
parent
78f6dcdd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!231
new Flagger and Stuff
Pipeline
#20631
passed with stages
in 2 minutes and 34 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
saqc/core/core.py
+1
-3
1 addition, 3 deletions
saqc/core/core.py
saqc/core/reader.py
+4
-4
4 additions, 4 deletions
saqc/core/reader.py
with
5 additions
and
7 deletions
saqc/core/core.py
+
1
−
3
View file @
e8f9fce8
...
...
@@ -141,7 +141,7 @@ class SaQC(FuncModules):
def
readConfig
(
self
,
fname
):
from
saqc.core.reader
import
readConfig
out
=
stdcopy
.
deepcopy
(
self
)
out
.
_to_call
.
extend
(
readConfig
(
fname
,
self
.
_flags
))
out
.
_to_call
.
extend
(
readConfig
(
fname
,
self
.
_flags
,
self
.
_nodata
))
return
out
def
_expandFields
(
self
,
selector
:
ColumnSelector
,
func
:
SaQCFunction
,
variables
:
pd
.
Index
)
->
Sequence
[
Tuple
[
ColumnSelector
,
SaQCFunction
]]:
...
...
@@ -178,12 +178,10 @@ class SaQC(FuncModules):
data_result
,
flags_result
=
_saqcCallFunc
(
sel
,
control
,
func
,
data
,
flags
)
except
Exception
as
e
:
t1
=
timeit
.
default_timer
()
logger
.
debug
(
f
"
{
func
.
name
}
failed after
{
t1
-
t0
}
sec
"
)
_handleErrors
(
e
,
sel
.
field
,
control
,
func
,
self
.
_error_policy
)
continue
else
:
t1
=
timeit
.
default_timer
()
logger
.
debug
(
f
"
{
func
.
name
}
finished after
{
t1
-
t0
}
sec
"
)
if
control
.
plot
:
plotHook
(
...
...
This diff is collapsed.
Click to expand it.
saqc/core/reader.py
+
4
−
4
View file @
e8f9fce8
...
...
@@ -56,7 +56,7 @@ def _injectOptionalColumns(df):
return
df
def
_parseConfig
(
df
,
flags
):
def
_parseConfig
(
df
,
flags
,
nodata
):
funcs
=
[]
for
lineno
,
(
_
,
target
,
expr
,
plot
)
in
enumerate
(
df
.
itertuples
()):
if
target
==
"
None
"
or
pd
.
isnull
(
target
)
or
pd
.
isnull
(
expr
):
...
...
@@ -83,13 +83,13 @@ def _parseConfig(df, flags):
expression
=
expr
)
f
=
func
.
bind
(
**
kwargs
)
f
=
func
.
bind
(
**
{
"
nodata
"
:
nodata
,
**
kwargs
}
)
funcs
.
append
((
selector
,
control
,
f
))
return
funcs
def
readConfig
(
fname
,
flags
):
def
readConfig
(
fname
,
flags
,
nodata
):
df
=
pd
.
read_csv
(
fname
,
sep
=
r
"
\s*;\s*
"
,
...
...
@@ -108,4 +108,4 @@ def readConfig(fname, flags):
df
[
F
.
TEST
]
=
df
[
F
.
TEST
].
replace
(
r
"
^\s*$
"
,
np
.
nan
,
regex
=
True
)
df
[
F
.
PLOT
]
=
df
[
F
.
PLOT
].
replace
({
"
False
"
:
""
,
EMPTY
:
""
,
np
.
nan
:
""
})
df
=
df
.
astype
({
F
.
PLOT
:
bool
})
return
_parseConfig
(
df
,
flags
)
return
_parseConfig
(
df
,
flags
,
nodata
)
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