Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SaQC
Manage
Activity
Members
Labels
Plan
Issues
35
Issue boards
Milestones
Wiki
Code
Merge requests
7
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
de1b0872
Commit
de1b0872
authored
1 year ago
by
Peter Lünenschloß
Browse files
Options
Downloads
Plain Diff
Merge branch 'flagConstantsFix' into 'develop'
Flag constants fix See merge request
!804
parents
082d321f
f3d3ec35
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!804
Flag constants fix
Pipeline
#203889
passed with stages
in 5 minutes and 16 seconds
Changes
2
Pipelines
28
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
saqc/funcs/constants.py
+10
-9
10 additions, 9 deletions
saqc/funcs/constants.py
with
11 additions
and
9 deletions
CHANGELOG.md
+
1
−
0
View file @
de1b0872
...
...
@@ -20,6 +20,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
### Changed
### Removed
### Fixed
-
`flagConstants`
: fixed flagging of rolling ramps
-
`Flags`
: add meta entry to imported flags
-
group operations were overwriting existing flags
-
`SaQC._construct`
: was not working for inherit classes (used hardcoded
`SaQC`
to construct a new instance).
...
...
This diff is collapsed.
Click to expand it.
saqc/funcs/constants.py
+
10
−
9
View file @
de1b0872
...
...
@@ -51,18 +51,19 @@ class ConstantsMixin:
thresh :
Maximum total change allowed per window.
window :
Size of the moving window. This determines the number of observations used
for calculating the absolute change per window.
Each window will either contain a fixed number of periods (integer defined window),
or will have a fixed temporal extension (offset defined window).
min_periods :
Minimum number of observations in window required to generate
a flag. Must be an integer greater or equal `2`, because a
a flag. This can be used to exclude underpopulated *offset* defined windows from
flagging. (Integer defined windows will always contain exactly *window* samples).
Must be an integer greater or equal `2`, because a
single value would always be considered constant.
Defaults to `2`.
window :
Size of the moving window. This is the number of observations used
for calculating the statistic. Each window will be a fixed size.
If it is an offset then this will be the time period of each window.
Each window will be a variable sized based on the observations included
in the time-period.
"""
d
:
pd
.
Series
=
self
.
_data
[
field
]
validateWindow
(
window
,
index
=
d
.
index
)
...
...
@@ -73,7 +74,7 @@ class ConstantsMixin:
rolling
=
d
.
rolling
(
window
=
window
,
min_periods
=
min_periods
)
starting_points_mask
=
rolling
.
max
()
-
rolling
.
min
()
<=
thresh
removeRollingRamps
(
starting_points_mask
,
window
=
window
,
inplace
=
True
)
starting_points_mask
=
removeRollingRamps
(
starting_points_mask
,
window
=
window
)
# mimic forward rolling by roll over inverse [::-1]
rolling
=
starting_points_mask
[::
-
1
].
rolling
(
...
...
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