Skip to content
Snippets Groups Projects

Several fixes and refactorings to the interpolation methods

Closed David Schäfer requested to merge interpolation_fixes into develop
2 unresolved threads
Files
4
@@ -144,7 +144,6 @@ class InterpolationMixin:
method: _SUPPORTED_METHODS,
order: int = 2,
limit: int | None = None,
downgrade: bool = False,
flag: float = UNFLAGGED,
**kwargs,
) -> "SaQC":
@@ -173,11 +172,6 @@ class InterpolationMixin:
flag : float or None, default UNFLAGGED
Flag that is set for interpolated values. If ``None``, no flags are set at all.
downgrade : bool, default False
If `True` and the interpolation can not be performed at current order, retry with a lower order.
This can happen, because the chosen ``method`` does not support the passed ``order``, or
simply because not enough values are present in a interval.
Returns
-------
saqc.SaQC
@@ -186,8 +180,7 @@ class InterpolationMixin:
self._data[field],
method,
order=order,
inter_limit=limit,
downgrade_interpolation=downgrade,
limit=limit,
)
interpolated = self._data[field].isna() & inter_data.notna()
@@ -210,7 +203,6 @@ class InterpolationMixin:
method: _SUPPORTED_METHODS,
order: int = 2,
limit: int | None = None,
downgrade: bool = False,
**kwargs,
) -> "SaQC":
"""
@@ -239,12 +231,6 @@ class InterpolationMixin:
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.
This can happen, because the chosen ``method`` does not support the passed ``order``, or
simply because not enough values are present in a interval.
Returns
-------
saqc.SaQC
@@ -281,8 +267,7 @@ class InterpolationMixin:
data=datcol,
method=method,
order=order,
inter_limit=limit,
downgrade_interpolation=downgrade,
limit=limit,
)
# override falsely interpolated values:
@@ -305,7 +290,6 @@ class InterpolationMixin:
"method": method,
"order": order,
"limit": limit,
"downgrade": downgrade,
**kwargs,
},
}
Loading