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
02dd7f3c
Commit
02dd7f3c
authored
4 years ago
by
Peter Lünenschloß
Browse files
Options
Downloads
Patches
Plain Diff
tired
parent
66f9a340
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!271
Static expansion of regular expressions
,
!260
Follow-Up Translations
,
!237
Flagger Translations
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
saqc/funcs/interpolation.py
+5
-5
5 additions, 5 deletions
saqc/funcs/interpolation.py
test/funcs/test_harm_funcs.py
+4
-2
4 additions, 2 deletions
test/funcs/test_harm_funcs.py
with
9 additions
and
7 deletions
saqc/funcs/interpolation.py
+
5
−
5
View file @
02dd7f3c
...
...
@@ -151,8 +151,7 @@ def interpolateInvalid(
method
,
order
=
inter_order
,
inter_limit
=
inter_limit
,
downgrade_interpolation
=
downgrade_interpolation
,
return_chunk_bounds
=
False
,
downgrade_interpolation
=
downgrade_interpolation
)
interpolated
=
data
[
field
].
isna
()
&
inter_data
.
notna
()
...
...
@@ -168,12 +167,13 @@ def interpolateInvalid(
def
_overlap_rs
(
x
,
freq
=
'
1min
'
,
fill_value
=-
np
.
inf
):
end
=
x
.
index
[
-
1
].
ceil
(
freq
)
x
=
x
.
resample
(
freq
).
max
()
x
=
x
.
combine
(
x
.
shift
(
1
,
fill_value
=
fill_value
),
max
)
# we are appending last regular grid entry (if necessary), to conserve integrity of groups of regularized
# timestamps originating all from the same logger.
try
:
x
=
x
.
append
(
pd
.
Series
([
-
np
.
inf
],
index
=
[
x
.
index
[
-
1
].
ceil
(
freq
)
]),
verify_integrity
=
True
)
x
=
x
.
append
(
pd
.
Series
([
-
np
.
inf
],
index
=
[
end
]),
verify_integrity
=
True
)
except
ValueError
:
pass
return
x
...
...
@@ -293,8 +293,8 @@ def interpolateIndex(
flagger
=
applyFunctionOnHistory
(
flagger
,
field
,
hist_func
=
_overlap_rs
,
hist_kws
=
dict
(
fill_value
=
UNFLAGGED
),
mask_func
=
_overlap_rs
,
mask_kws
=
dict
(
fill_value
=
False
),
hist_func
=
_overlap_rs
,
hist_kws
=
dict
(
freq
=
freq
,
fill_value
=
UNFLAGGED
),
mask_func
=
_overlap_rs
,
mask_kws
=
dict
(
freq
=
freq
,
fill_value
=
False
),
last_column
=
flagscol
)
...
...
This diff is collapsed.
Click to expand it.
test/funcs/test_harm_funcs.py
+
4
−
2
View file @
02dd7f3c
...
...
@@ -10,6 +10,8 @@ import pandas as pd
import
dios
from
test.common
import
TESTFLAGGER
from
saqc.flagger
import
Flagger
,
initFlagsLike
from
saqc.common
import
BAD
from
saqc.funcs.resampling
import
(
linear
,
...
...
@@ -43,10 +45,10 @@ def data():
@pytest.mark.parametrize
(
"
flagger
"
,
TESTFLAGGER
)
@pytest.mark.parametrize
(
"
reshaper
"
,
RESHAPERS
)
def
test_harmSingleVarIntermediateFlagging
(
data
,
flagger
,
reshaper
):
flagger
=
flagger
.
initFlags
(
data
)
flagger
=
initFlags
Like
(
data
)
# make pre harm copies:
pre_data
=
data
.
copy
()
pre_flags
=
flagger
.
getFlags
()
pre_flags
=
flagger
[
'
data
'
]
freq
=
"
15min
"
assert
len
(
data
.
columns
)
==
1
field
=
data
.
columns
[
0
]
...
...
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