Skip to content
Snippets Groups Projects
Commit 7d6b3084 authored by Bert Palm's avatar Bert Palm 🎇
Browse files

CompatFlagger now inherits from BaseFlagger

parent 94059777
No related branches found
No related tags found
1 merge request!218Flags
...@@ -13,27 +13,23 @@ import numpy as np ...@@ -13,27 +13,23 @@ import numpy as np
from saqc.common import * from saqc.common import *
from saqc.lib.tools import assertScalar, mergeDios, toSequence, customRoller from saqc.lib.tools import assertScalar, mergeDios, toSequence, customRoller
from saqc.flagger.flags import Flags, init_flags_like, History from saqc.flagger.flags import Flags, init_flags_like, History
from saqc.flagger.baseflagger import (
BaseFlagger,
COMPARATOR_MAP,
LocT,
FlagT,
PandasT,
FieldsT,
)
COMPARATOR_MAP = {
"!=": op.ne,
"==": op.eq,
">=": op.ge,
">": op.gt,
"<=": op.le,
"<": op.lt,
}
LocT = Union[pd.Series, pd.Index, slice] class CompatFlagger(BaseFlagger):
FlagT = Any
BaseFlaggerT = TypeVar("BaseFlaggerT", bound="BaseFlagger")
PandasT = Union[pd.Series, DictOfSeries]
FieldsT = Union[str, List[str], slice]
class CompatFlagger:
def __init__(self): def __init__(self):
self.dtype = float super().__init__(float)
# not supported anymore
delattr(self, 'extra_defaults')
# the arguments of setFlags supported from the configuration functions # the arguments of setFlags supported from the configuration functions
self.signature = ("flag", "force", "flag_after", "flag_before") self.signature = ("flag", "force", "flag_after", "flag_before")
...@@ -375,7 +371,7 @@ class CompatFlagger: ...@@ -375,7 +371,7 @@ class CompatFlagger:
return flagged return flagged
def copy(self) -> CompatFlagger: def copy(self, **kwargs) -> CompatFlagger:
copy = self._constructor() copy = self._constructor()
copy._flags = self._flags.copy(deep=True) copy._flags = self._flags.copy(deep=True)
return copy return copy
......
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