Skip to content
Snippets Groups Projects
Commit de1b0872 authored by Peter Lünenschloß's avatar Peter Lünenschloß
Browse files

Merge branch 'flagConstantsFix' into 'develop'

Flag constants fix

See merge request !804
parents 082d321f f3d3ec35
No related branches found
No related tags found
1 merge request!804Flag constants fix
Pipeline #203889 passed with stages
in 5 minutes and 16 seconds
......@@ -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).
......
......@@ -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(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment