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

Merge branch 'develop' into multi-transfer

parents 72047b4c 418c14eb
No related branches found
No related tags found
1 merge request!801Make transferFlags a multivariate function
Pipeline #201612 passed with stages
in 4 minutes and 43 seconds
......@@ -54,16 +54,20 @@ class SaQC(FunctionsMixin):
def __init__(
self,
data: pd.Series
| pd.DataFrame
| DictOfSeries
| list[pd.Series | pd.DataFrame | DictOfSeries]
| None = None,
flags: pd.DataFrame
| DictOfSeries
| Flags
| list[pd.DataFrame | DictOfSeries | Flags]
| None = None,
data: (
pd.Series
| pd.DataFrame
| DictOfSeries
| list[pd.Series | pd.DataFrame | DictOfSeries]
| None
) = None,
flags: (
pd.DataFrame
| DictOfSeries
| Flags
| list[pd.DataFrame | DictOfSeries | Flags]
| None
) = None,
scheme: str | TranslationScheme = "float",
):
self.scheme: TranslationScheme = scheme
......@@ -193,12 +197,14 @@ class SaQC(FunctionsMixin):
def __setitem__(
self,
key: str | slice | Iterable[str],
value: SaQC
| pd.Series
| pd.DataFrame
| DictOfSeries
| dict[Any, pd.Series]
| Iterable[pd.Series],
value: (
SaQC
| pd.Series
| pd.DataFrame
| DictOfSeries
| dict[Any, pd.Series]
| Iterable[pd.Series]
),
):
keys = self._get_keys(key)
if isinstance(value, SaQC):
......
......@@ -323,12 +323,10 @@ class Flags:
# item access
@overload
def __getitem__(self, key: str) -> pd.Series:
...
def __getitem__(self, key: str) -> pd.Series: ...
@overload
def __getitem__(self, key: list | pd.Index) -> Flags:
...
def __getitem__(self, key: list | pd.Index) -> Flags: ...
def __getitem__(self, key: str | list | pd.Index) -> pd.Series | Flags:
if isinstance(key, str):
......
......@@ -217,7 +217,6 @@ class MappingScheme(TranslationScheme):
class FloatScheme(TranslationScheme):
"""
Acts as the default Translator, provides a changeable subset of the
internal float flags
......
......@@ -41,7 +41,6 @@ _QUALITY_LABELS = [
class DmpScheme(MappingScheme):
"""
Implements the translation from and to the flagging scheme implemented in
the UFZ - Datamanagementportal
......
......@@ -16,7 +16,6 @@ from saqc.core.translation.basescheme import BackwardMap, ForwardMap, MappingSch
class PositionalScheme(MappingScheme):
"""
Implements the translation from and to the flagging scheme implemented by CHS
"""
......
......@@ -10,7 +10,6 @@ from saqc.core.translation import MappingScheme
class SimpleScheme(MappingScheme):
"""
Acts as the default Translator, provides a changeable subset of the
internal float flags
......
......@@ -25,8 +25,9 @@ class GenericFunction(Protocol):
__name__: str
__globals__: dict[str, Any]
def __call__(self, *args: pd.Series) -> pd.Series | pd.DataFrame | DictOfSeries:
... # pragma: no cover
def __call__(
self, *args: pd.Series
) -> pd.Series | pd.DataFrame | DictOfSeries: ... # pragma: no cover
def _flagSelect(field: str, flags: Flags, label: str | None = None) -> pd.Series:
......
......@@ -36,8 +36,9 @@ class NoiseMixin:
field: str,
window: str | pd.Timedelta,
thresh: float,
func: Literal["std", "var", "mad"]
| Callable[[np.ndarray, pd.Series], float] = "std",
func: (
Literal["std", "var", "mad"] | Callable[[np.ndarray, pd.Series], float]
) = "std",
sub_window: str | pd.Timedelta | None = None,
sub_thresh: float | None = None,
min_periods: int | None = None,
......@@ -102,8 +103,9 @@ class NoiseMixin:
field: str,
window: str | pd.Timedelta,
thresh: float,
func: Literal["std", "var", "mad"]
| Callable[[np.ndarray, pd.Series], float] = "std",
func: (
Literal["std", "var", "mad"] | Callable[[np.ndarray, pd.Series], float]
) = "std",
sub_window: str | pd.Timedelta | None = None,
sub_thresh: float | None = None,
min_periods: int | None = None,
......
......@@ -30,8 +30,9 @@ ExternalFlag = Union[str, float, int]
# needed for deeper type hinting magic
class CurveFitter(Protocol):
def __call__(self, data: np.ndarray, *params: float) -> np.ndarray:
... # pragma: no cover
def __call__(
self, data: np.ndarray, *params: float
) -> np.ndarray: ... # pragma: no cover
class Comparable(Protocol):
......
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