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
e94027fd
Commit
e94027fd
authored
4 years ago
by
Peter Lünenschloß
Browse files
Options
Downloads
Patches
Plain Diff
CPD inner loop runs runs with parallel=True, refactored to match saqc formatting contributions
parent
2d8d8c1e
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
,
!138
WIP: Detect and reset offset
Pipeline
#8383
passed with stage
in 6 minutes and 17 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
saqc/funcs/functions.py
+19
-17
19 additions, 17 deletions
saqc/funcs/functions.py
with
19 additions
and
17 deletions
saqc/funcs/functions.py
+
19
−
17
View file @
e94027fd
...
...
@@ -1048,14 +1048,16 @@ def flagDriftFromReference(data, field, flagger, fields, segment_freq, thresh,
return
data
,
flagger
@numba.jit
(
nopython
=
True
)
def
_slidingWindowSearch
(
data_arr
,
bwd_start
,
fwd_end
,
stat_func
,
thresh_func
,
result_arr
):
for
win_i
in
range
(
1
,
len
(
data_arr
)):
@numba.jit
(
nopython
=
True
,
parallel
=
True
)
def
_slidingWindowSearch
(
data_arr
,
bwd_start
,
fwd_end
,
stat_func
,
thresh_func
,
num_val
):
stat_arr
=
np
.
zeros
(
num_val
)
thresh_arr
=
np
.
zeros
(
num_val
)
for
win_i
in
numba
.
prange
(
1
,
len
(
data_arr
)):
x
=
data_arr
[
bwd_start
[
win_i
-
1
]:
win_i
]
y
=
data_arr
[
win_i
:
fwd_end
[
win_i
-
1
]]
resul
t_arr
[
win_i
-
1
]
=
stat_func
(
x
,
y
)
>
thresh_func
(
x
,
y
)
return
result
_arr
sta
t_arr
[
win_i
-
1
]
=
stat_func
(
x
,
y
)
thresh_arr
[
win_i
-
1
]
=
thresh_func
(
x
,
y
)
return
stat_arr
,
thresh
_arr
@register
(
masking
=
'
field
'
)
...
...
@@ -1098,20 +1100,20 @@ def flagChangePoints(data, field, flagger, stat_func, thresh_func, bwd_window, m
stat_func
=
numba
.
jit
(
stat_func
)
thresh_func
=
numba
.
jit
(
thresh_func
)
FI
=
FreqIndexer
()
FI
.
index_array
=
data_ser
.
index
.
to_numpy
(
int
)
FI
.
win_points
=
np
.
array
([
True
]
*
var_len
)
FI
.
window_size
=
int
(
pd
.
Timedelta
(
bwd_window
).
total_seconds
()
*
10
**
9
)
FI
.
forward
=
False
bwd_start
,
bwd_end
=
FI
.
get_window_bounds
(
var_len
,
min_periods_bwd
,
center
,
closed
)
indexer
=
FreqIndexer
()
indexer
.
index_array
=
data_ser
.
index
.
to_numpy
(
int
)
indexer
.
win_points
=
np
.
array
([
True
]
*
var_len
)
indexer
.
window_size
=
int
(
pd
.
Timedelta
(
bwd_window
).
total_seconds
()
*
10
**
9
)
indexer
.
forward
=
False
bwd_start
,
bwd_end
=
indexer
.
get_window_bounds
(
var_len
,
min_periods_bwd
,
center
,
closed
)
FI
.
window_size
=
int
(
pd
.
Timedelta
(
fwd_window
).
total_seconds
()
*
10
**
9
)
FI
.
forward
=
True
fwd_start
,
fwd_end
=
FI
.
get_window_bounds
(
var_len
,
min_periods_fwd
,
center
,
closed
)
indexer
.
window_size
=
int
(
pd
.
Timedelta
(
fwd_window
).
total_seconds
()
*
10
**
9
)
indexer
.
forward
=
True
fwd_start
,
fwd_end
=
indexer
.
get_window_bounds
(
var_len
,
min_periods_fwd
,
center
,
closed
)
fwd_start
,
fwd_end
=
np
.
roll
(
fwd_start
,
-
1
),
np
.
roll
(
fwd_end
,
-
1
)
data_arr
=
data_ser
.
values
result_arr
=
np
.
array
([
False
]
*
var_l
en
,
dtype
=
bool
)
result_arr
=
_slidingWindowSearch
(
data_arr
,
bwd_start
,
fwd_end
,
stat_func
,
thresh_func
,
result_arr
)
stat_arr
,
thresh_arr
=
_slidingWindowSearch
(
data_arr
,
bwd_start
,
fwd_
en
d
,
stat_func
,
thresh_func
,
var_len
)
flagger
=
flagger
.
setFlags
(
field
,
loc
=
result_arr
)
return
data
,
flagger
\ No newline at end of file
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