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
f362825f
Commit
f362825f
authored
4 years ago
by
Peter Lünenschloß
Browse files
Options
Downloads
Patches
Plain Diff
changed validation trafo to boolean type in:boolean->out:boolean
parent
14483ddc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
4 merge requests
!193
Release 1.4
,
!188
Release 1.4
,
!49
Dataprocessing features
,
!44
Dataprocessing features
Pipeline
#4103
failed with stage
in 7 minutes and 15 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
saqc/lib/ts_operators.py
+21
-6
21 additions, 6 deletions
saqc/lib/ts_operators.py
with
21 additions
and
6 deletions
saqc/lib/ts_operators.py
+
21
−
6
View file @
f362825f
...
@@ -111,18 +111,20 @@ def validationTrafo(data, max_nan_total, max_nan_consec):
...
@@ -111,18 +111,20 @@ def validationTrafo(data, max_nan_total, max_nan_consec):
if
(
max_nan_total
is
np
.
inf
)
&
(
max_nan_consec
is
np
.
inf
):
if
(
max_nan_total
is
np
.
inf
)
&
(
max_nan_consec
is
np
.
inf
):
return
data
return
data
nan_mask
=
np
.
isnan
(
data
)
#
nan_mask = np.isnan(data)
if
nan_mask
.
sum
()
<=
max_nan_total
:
if
data
.
sum
()
<=
max_nan_total
:
if
max_nan_consec
is
np
.
inf
:
if
max_nan_consec
is
np
.
inf
:
data
[:]
=
False
return
data
return
data
elif
_max_consecutive_nan
(
np
.
asarray
(
nan_mask
),
max_nan_consec
):
elif
_max_consecutive_nan
(
np
.
asarray
(
data
),
max_nan_consec
):
data
[:]
=
False
return
data
return
data
else
:
else
:
data
[:]
=
np
.
nan
data
[:]
=
True
return
data
return
data
else
:
else
:
data
[:]
=
np
.
nan
data
[:]
=
True
return
data
return
data
...
@@ -227,7 +229,20 @@ def interpolateNANs(data, method, order=2, inter_limit=2, downgrade_interpolatio
...
@@ -227,7 +229,20 @@ def interpolateNANs(data, method, order=2, inter_limit=2, downgrade_interpolatio
return
data
return
data
def
aggregate2Freq
(
data
,
method
,
agg_func
,
freq
,
fill_value
=
np
.
nan
):
def
aggregate2Freq
(
data
,
method
,
agg_func
,
freq
,
fill_value
=
np
.
nan
,
max_invalid_total
=
None
,
max_invalid_consec
=
None
):
# filter data for invalid patterns
if
(
max_invalid_total
is
not
None
)
|
(
max_invalid_consec
is
not
None
):
if
not
max_invalid_total
:
max_invalid_total
=
np
.
inf
if
not
max_invalid_consec
:
max_invalid_consec
=
np
.
inf
temp_mask
=
(
data
==
fill_value
)
temp_mask
.
groupby
(
pd
.
Grouper
(
freq
=
freq
)).
transform
(
validationTrafo
,
max_nan_total
=
max_invalid_total
,
max_nan_consec
=
max_invalid_consec
)
data
[
temp_mask
]
=
fill_value
if
method
==
"
nagg
"
:
if
method
==
"
nagg
"
:
# all values within a grid points range (+/- freq/2, closed to the left) get aggregated with 'agg method'
# all values within a grid points range (+/- freq/2, closed to the left) get aggregated with 'agg method'
# some timestamp acrobatics to feed the base keyword properly
# some timestamp acrobatics to feed the base keyword properly
...
...
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