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
eab6883c
Commit
eab6883c
authored
4 years ago
by
Bert Palm
🎇
Browse files
Options
Downloads
Patches
Plain Diff
fixed pattern.py
parent
4af3c0bb
No related branches found
No related tags found
4 merge requests
!271
Static expansion of regular expressions
,
!260
Follow-Up Translations
,
!237
Flagger Translations
,
!232
WIP: Fuzzy testing
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
saqc/funcs/pattern.py
+3
-9
3 additions, 9 deletions
saqc/funcs/pattern.py
with
3 additions
and
9 deletions
saqc/funcs/pattern.py
+
3
−
9
View file @
eab6883c
#! /usr/bin/env python
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
from
saqc.core.modules
import
base
from
typing
import
Sequence
,
Union
,
Tuple
,
Optional
from
typing
import
Sequence
,
Union
,
Tuple
,
Optional
from
typing_extensions
import
Literal
import
numpy
as
np
import
numpy
as
np
import
dtw
import
dtw
import
pywt
import
pywt
from
mlxtend.evaluate
import
permutation_test
from
mlxtend.evaluate
import
permutation_test
from
dios.dios
import
DictOfSeries
from
dios.dios
import
DictOfSeries
from
saqc.core.register
import
register
from
saqc.core.register
import
register
...
@@ -100,7 +94,7 @@ def flagPatternByDTW(
...
@@ -100,7 +94,7 @@ def flagPatternByDTW(
sz
=
len
(
ref
)
sz
=
len
(
ref
)
mask
=
customRoller
(
dat
,
window
=
sz
,
min_periods
=
sz
).
apply
(
isPattern
,
raw
=
True
)
mask
=
customRoller
(
dat
,
window
=
sz
,
min_periods
=
sz
).
apply
(
isPattern
,
raw
=
True
)
flagger
=
flagger
.
setFlags
(
field
,
loc
=
mask
,
**
kwargs
)
flagger
[
mask
,
field
]
=
kwargs
[
'
flag
'
]
return
data
,
flagger
return
data
,
flagger
...
@@ -108,7 +102,7 @@ def flagPatternByDTW(
...
@@ -108,7 +102,7 @@ def flagPatternByDTW(
def
flagPatternByWavelet
(
def
flagPatternByWavelet
(
data
:
DictOfSeries
,
data
:
DictOfSeries
,
field
:
str
,
field
:
str
,
flagger
:
base
,
flagger
:
Flagger
,
ref_field
:
str
,
ref_field
:
str
,
max_distance
:
float
=
0.03
,
max_distance
:
float
=
0.03
,
normalize
:
bool
=
True
,
normalize
:
bool
=
True
,
...
@@ -172,5 +166,5 @@ def flagPatternByWavelet(
...
@@ -172,5 +166,5 @@ def flagPatternByWavelet(
sz
=
len
(
ref
)
sz
=
len
(
ref
)
mask
=
customRoller
(
dat
,
window
=
sz
,
min_periods
=
sz
).
apply
(
isPattern
,
raw
=
True
)
mask
=
customRoller
(
dat
,
window
=
sz
,
min_periods
=
sz
).
apply
(
isPattern
,
raw
=
True
)
flagger
=
flagger
.
setFlags
(
field
,
loc
=
mask
,
**
kwargs
)
flagger
[
mask
,
field
]
=
kwargs
[
'
flag
'
]
return
data
,
flagger
return
data
,
flagger
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