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
368663be
Commit
368663be
authored
4 years ago
by
Peter Lünenschloß
Browse files
Options
Downloads
Patches
Plain Diff
removed calls to from/to_merged
parent
f8110c09
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!193
Release 1.4
,
!188
Release 1.4
,
!24
Dios integration
Pipeline
#3284
failed with stage
Stage: test
in 4 minutes and 53 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
saqc/funcs/harm_functions.py
+8
-32
8 additions, 32 deletions
saqc/funcs/harm_functions.py
test/funcs/test_harm_funcs.py
+1
-1
1 addition, 1 deletion
test/funcs/test_harm_funcs.py
with
9 additions
and
33 deletions
saqc/funcs/harm_functions.py
+
8
−
32
View file @
368663be
...
...
@@ -68,12 +68,9 @@ def harmWrapper(heap={}):
if
flagger
.
BAD
not
in
drop_flags
:
drop_flags
.
append
(
flagger
.
BAD
)
# before sending the current flags and data frame to the future (for backtracking reasons), we clear it
# from merge-nans that just resulted from harmonization of other variables!
# fixme: this is no longer needed, is it?
dat_col
,
flagger_merged
=
_fromMerged
(
data
,
flagger
,
field
)
# replace it by
# dat_col, flagger_merged = flagger.getFlagger(field=field)
# get data of variable
flagger_merged
=
flagger
.
getFlagger
(
field
=
field
)
dat_col
=
data
[
field
]
# now we send the flags frame in its current shape to the future:
heap
[
field
]
=
{
...
...
@@ -84,14 +81,6 @@ def harmWrapper(heap={}):
Heap
.
DROP
:
drop_flags
,
}
# fixme with harmo-rework: now that every series have its
# own index, we dont have to store a global index, as
# we have the index from Heap.DATA
# furthermore we need to memorize the initial timestamps
# to ensure output format will equal input format.
# if Heap.INDEX not in heap.keys():
# heap.update({Heap.INDEX: dat_col.index})
# now we can manipulate it without loosing information gathered before harmonization
dat_col
,
flagger_merged_clean
=
_outsortCrap
(
dat_col
,
field
,
flagger_merged
,
drop_flags
=
drop_flags
,)
...
...
@@ -119,12 +108,8 @@ def harmWrapper(heap={}):
**
kwargs
,
)
# finally we happily blow up the data and flags frame again,
# to release them on their ongoing journey through saqc.
# fixme: no need with dios
# data, flagger_out = _toMerged(data, flagger, field,
# data_to_insert=dat_col,
# flagger_to_insert=flagger_merged_clean_reshaped, **kwargs)
# TODO: ask BERT: why so verbose?
# TODO: ask BERT: why so assert?
flags_col
=
flagger_merged_clean_reshaped
.
getFlags
(
field
)
flags
=
flagger
.
getFlags
()
flags
[
field
]
=
flags_col
...
...
@@ -133,6 +118,7 @@ def harmWrapper(heap={}):
assert
(
data
[
field
].
index
==
flagger_out
.
getFlags
(
field
).
index
).
all
()
return
data
,
flagger_out
def
deharmonize
(
data
,
field
,
flagger
,
co_flagging
=
False
,
**
kwargs
):
# Check if there is backtracking information available for actual harmonization resolving
...
...
@@ -148,7 +134,8 @@ def harmWrapper(heap={}):
resolve_method
=
HARM_2_DEHARM
[
harm_info
[
Heap
.
METHOD
]]
# retrieve data and flags from the merged saqc-conform data frame (and by that get rid of blow-up entries).
dat_col
,
flagger_merged
=
_fromMerged
(
data
,
flagger
,
field
)
flagger_merged
=
flagger
.
getFlagger
(
field
=
field
)
dat_col
=
data
[
field
]
# reconstruct the drops that were performed before harmonization
drops
,
flagger_original_clean
=
_outsortCrap
(
...
...
@@ -176,17 +163,6 @@ def harmWrapper(heap={}):
dat_col
=
harm_info
[
Heap
.
DATA
].
reindex
(
flags_col
.
index
,
fill_value
=
np
.
nan
)
dat_col
.
name
=
field
# fixme not needed anymore with dios
# transform the result into the form, data travels through saqc:
# data, flagger_out = _toMerged(
# data, flagger, field, dat_col, flagger_back_full, target_index=harm_info[Heap.DATA].index, **kwargs
# )
# fixme: INDEX is now series specific
# clear heap if nessecary:
# if len(heap) == 1 and Heap.INDEX in heap:
# del heap[Heap.INDEX]
# bye bye data
flags
=
flagger
.
getFlags
()
flags
[
field
]
=
flags_col
...
...
This diff is collapsed.
Click to expand it.
test/funcs/test_harm_funcs.py
+
1
−
1
View file @
368663be
...
...
@@ -6,7 +6,7 @@ import pytest
import
numpy
as
np
import
pandas
as
pd
import
dios
import
from
dios
import
dios
from
test.common
import
TESTFLAGGER
from
saqc.funcs.harm_functions
import
(
...
...
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