Skip to content
Snippets Groups Projects

Numba riddance

Merged Peter Lünenschloß requested to merge numbaRiddance into develop
2 files
+ 25
6
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -8,7 +8,7 @@
from __future__ import annotations
import typing
from typing import TYPE_CHECKING, Callable, Tuple
from typing import TYPE_CHECKING, Callable, Tuple, Literal
import numpy as np
import pandas as pd
@@ -25,7 +25,7 @@ class ChangepointsMixin:
def flagChangePoints(
self: "SaQC",
field: str,
stat_func: Callable[[np.ndarray, np.ndarray], float],
stat_func: Callable[[np.ndarray, np.ndarray], float] | Literal['mean', 'median', 'std', 'var', 'sum'],
thresh_func: Callable[[np.ndarray, np.ndarray], float],
window: str | Tuple[str, str],
min_periods: int | Tuple[int, int],
@@ -43,9 +43,11 @@ class ChangepointsMixin:
Parameters
----------
stat_func :
A function that assigns a value to every twin window. The backward-facing
window content will be passed as the first array, the forward-facing window
content as the second.
* If callable: A function that assigns a scalar value to every twin window. The backward-facing
window content will be passed as the first array, the forward-facing window
content as the second.
* If string: The respective statistic will be calculated for both the windows and the absolute difference of
the results will be returned.
thresh_func :
A function that determines the value level, exceeding wich qualifies a
@@ -187,7 +189,7 @@ class ChangepointsMixin:
def _getChangePoints(
data: pd.Series,
stat_func: Callable[[np.ndarray, np.ndarray], float],
stat_func: Callable[[np.ndarray, np.ndarray], float] | Literal['mean', 'median', 'std', 'var', 'sum'],
thresh_func: Callable[[np.ndarray, np.ndarray], float],
window: str | Tuple[str, str],
min_periods: int | Tuple[int, int],
Loading