Skip to content
Snippets Groups Projects
Commit 6356e3dd authored by David Schäfer's avatar David Schäfer
Browse files

change the default limit value of the interpolation routines

parent 788cd7fb
No related branches found
No related tags found
1 merge request!598Change the default limit value of the interpolation routines
Pipeline #141889 failed with stages
in 5 minutes and 15 seconds
......@@ -14,6 +14,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
- Remove all flag value restrictions from the default flagging scheme `FloatTranslator`
- Renamed `TranslationScheme.forward` to `TranslationScheme.toInternal`
- Renamed `TranslationScheme.backward` to `TranslationScheme.toExternal`
- Changed Default value of the parameter `limit` for `SaQC.interpolateIndex` and `SaQC.interpolateInvalid` to ``None`
### Removed
### Fixed
......
......@@ -143,7 +143,7 @@ class InterpolationMixin:
field: str,
method: _SUPPORTED_METHODS,
order: int = 2,
limit: int = 2,
limit: int | None = None,
downgrade: bool = False,
flag: float = UNFLAGGED,
**kwargs,
......@@ -167,9 +167,8 @@ class InterpolationMixin:
If there your selected interpolation method can be performed at different 'orders' - here you pass the desired
order.
limit : int, default 2
Maximum number of consecutive 'nan' values allowed for a gap to be interpolated. This really restricts the
interpolation to chunks, containing not more than `limit` successive nan entries.
limit : int, optional
Maximum number of consecutive `nan` values to fill. Must be greater than 0.
flag : float or None, default UNFLAGGED
Flag that is set for interpolated values. If ``None``, no flags are set at all.
......@@ -210,7 +209,7 @@ class InterpolationMixin:
freq: str,
method: _SUPPORTED_METHODS,
order: int = 2,
limit: int = 2,
limit: int | None = None,
downgrade: bool = False,
**kwargs,
) -> "SaQC":
......@@ -237,9 +236,8 @@ class InterpolationMixin:
If there your selected interpolation method can be performed at different 'orders' - here you pass the desired
order.
limit : int, default 2
Maximum number of consecutive 'nan' values allowed for a gap to be interpolated. This really restricts the
interpolation to chunks, containing not more than `limit` successive nan entries.
limit : int, optional
Maximum number of missing index values (with respect to `freq`) to fill. Must be greater than 0.
downgrade : bool, default False
If `True` and the interpolation can not be performed at current order, retry with a lower order.
......
......@@ -301,7 +301,7 @@ def interpolateNANs(
:return:
"""
inter_limit = int(inter_limit)
inter_limit = int(inter_limit or len(data) + 1)
data = pd.Series(data, copy=True)
gap_mask = data.isna().rolling(inter_limit, min_periods=0).sum() != inter_limit
......
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