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

Merge branch 'demodule' into 'develop'

Undo Modularization

See merge request !319
parents 4040e0f4 6e0dc16e
No related branches found
No related tags found
1 merge request!319Undo Modularization
Pipeline #47034 failed with stage
in 1 minute and 7 seconds
Showing
with 98 additions and 133 deletions
varname ; test varname ; test
#----------;--------------------------------------- #----------;---------------------------------------
SM2 ; resampling.shift(freq="15Min") SM2 ; shift(freq="15Min")
SM2 ; breaks.flagMissing() SM2 ; flagMissing()
'SM(1|2)+' ; outliers.flagRange(min=10, max=60) 'SM(1|2)+' ; flagRange(min=10, max=60)
SM2 ; outliers.flagMAD(window="30d", z=3.5) SM2 ; flagMAD(window="30d", z=3.5)
varname ; test varname ; test
#-------; ----------------------------------------------------- #-------; -----------------------------------------------------
SM2 ; resampling.shift(freq="15Min") SM2 ; shift(freq="15Min")
'.*' ; outliers.flagRange(min=10, max=60) '.*' ; flagRange(min=10, max=60)
SM2 ; breaks.flagMissing() SM2 ; flagMissing()
SM2 ; outliers.flagRange(min=10, max=60) SM2 ; flagRange(min=10, max=60)
SM2 ; outliers.flagMAD(window="30d", z=3.5) SM2 ; flagMAD(window="30d", z=3.5)
Dummy ; generic.flag(func=(isflagged(SM1) | isflagged(SM2))) Dummy ; genericFlag(func=(isflagged(SM1) | isflagged(SM2)))
...@@ -14,7 +14,7 @@ from dios import DictOfSeries, to_dios ...@@ -14,7 +14,7 @@ from dios import DictOfSeries, to_dios
from saqc.core.flags import initFlagsLike, Flags from saqc.core.flags import initFlagsLike, Flags
from saqc.core.register import FUNC_MAP from saqc.core.register import FUNC_MAP
from saqc.core.modules import FuncModules from saqc.core.modules import FunctionsMixin
from saqc.core.translator.basetranslator import Translator, FloatTranslator from saqc.core.translator.basetranslator import Translator, FloatTranslator
from saqc.lib.tools import toSequence from saqc.lib.tools import toSequence
from saqc.lib.types import ( from saqc.lib.types import (
...@@ -106,14 +106,13 @@ class Accessor: ...@@ -106,14 +106,13 @@ class Accessor:
return self._obj.__repr__() return self._obj.__repr__()
class SaQC(FuncModules): class SaQC(FunctionsMixin):
def __init__( def __init__(
self, self,
data, data,
flags=None, flags=None,
scheme: Translator = None, scheme: Translator = None,
): ):
super().__init__(self)
data, flags = _prepInput(data, flags) data, flags = _prepInput(data, flags)
self._data = data self._data = data
self._flags = self._initFlags(data, flags) self._flags = self._initFlags(data, flags)
...@@ -235,7 +234,7 @@ class SaQC(FuncModules): ...@@ -235,7 +234,7 @@ class SaQC(FuncModules):
for field, target in zip(fields, targets): for field, target in zip(fields, targets):
if field != target: if field != target:
out = out._callFunction( out = out._callFunction(
FUNC_MAP["tools.copy"], FUNC_MAP["copyField"],
data=out._data, data=out._data,
flags=out._flags, flags=out._flags,
field=field, field=field,
......
#! /usr/bin/env python #! /usr/bin/env python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from saqc.core.modules.breaks import Breaks from saqc.core.modules.breaks import Breaks
from saqc.core.modules.noise import Noise from saqc.core.modules.noise import Noise
from saqc.core.modules.changepoints import ChangePoints from saqc.core.modules.changepoints import ChangePoints
...@@ -18,25 +17,29 @@ from saqc.core.modules.rolling import Rolling ...@@ -18,25 +17,29 @@ from saqc.core.modules.rolling import Rolling
from saqc.core.modules.scores import Scores from saqc.core.modules.scores import Scores
from saqc.core.modules.tools import Tools from saqc.core.modules.tools import Tools
from saqc.core.modules.transformation import Transformation from saqc.core.modules.transformation import Transformation
from saqc.core.register import FUNC_MAP
class FuncModules: class FunctionsMixin(
def __init__(self, obj): Breaks,
# our testing modules Noise,
self.breaks = Breaks(obj) ChangePoints,
self.changepoints = ChangePoints(obj) Constants,
self.constants = Constants(obj) Curvefit,
self.curvefit = Curvefit(obj) Drift,
self.drift = Drift(obj) FlagTools,
self.flagtools = FlagTools(obj) Generic,
self.generic = Generic(obj) Interpolation,
self.interpolation = Interpolation(obj) Outliers,
self.noise = Noise(obj) Pattern,
self.outliers = Outliers(obj) Resampling,
self.pattern = Pattern(obj) Residues,
self.resampling = Resampling(obj) Rolling,
self.residues = Residues(obj) Scores,
self.rolling = Rolling(obj) Tools,
self.scores = Scores(obj) Transformation,
self.tools = Tools(obj) ):
self.transformation = Transformation(obj) def _defer(self, fname, flocals):
flocals.pop("self", None)
fkwargs = flocals.pop("kwargs", {})
return self._wrap(FUNC_MAP[fname])(**flocals, **fkwargs)
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from saqc.core.register import FUNC_MAP
class ModuleBase:
def __init__(self, obj):
self.obj = obj
def __str__(self):
return self.__class__.__name__.lower()
def __getattr__(self, key):
raise AttributeError(f"'SaQC.{self}' object has no attribute '{key}'")
def defer(self, fname, flocals):
flocals.pop("self", None)
fkwargs = flocals.pop("kwargs", {})
return self.obj._wrap(FUNC_MAP[f"{self}.{fname}"])(**flocals, **fkwargs)
...@@ -3,16 +3,15 @@ ...@@ -3,16 +3,15 @@
from __future__ import annotations from __future__ import annotations
from saqc.constants import BAD, UNFLAGGED from saqc.constants import BAD, UNFLAGGED
from saqc.core.modules.base import ModuleBase
import saqc import saqc
from saqc.lib.types import FreqString from saqc.lib.types import FreqString
class Breaks(ModuleBase): class Breaks:
def flagMissing( def flagMissing(
self, field: str, flag: float = BAD, to_mask: float = UNFLAGGED, **kwargs self, field: str, flag: float = BAD, to_mask: float = UNFLAGGED, **kwargs
) -> saqc.SaQC: ) -> saqc.SaQC:
return self.defer("flagMissing", locals()) return self._defer("flagMissing", locals())
def flagIsolated( def flagIsolated(
self, self,
...@@ -22,7 +21,7 @@ class Breaks(ModuleBase): ...@@ -22,7 +21,7 @@ class Breaks(ModuleBase):
flag: float = BAD, flag: float = BAD,
**kwargs **kwargs
) -> saqc.SaQC: ) -> saqc.SaQC:
return self.defer("flagIsolated", locals()) return self._defer("flagIsolated", locals())
def flagJumps( def flagJumps(
self, self,
...@@ -33,4 +32,4 @@ class Breaks(ModuleBase): ...@@ -33,4 +32,4 @@ class Breaks(ModuleBase):
flag: float = BAD, flag: float = BAD,
**kwargs **kwargs
) -> saqc.SaQC: ) -> saqc.SaQC:
return self.defer("flagJumps", locals()) return self._defer("flagJumps", locals())
...@@ -8,12 +8,11 @@ import numpy as np ...@@ -8,12 +8,11 @@ import numpy as np
from typing_extensions import Literal from typing_extensions import Literal
from saqc.constants import BAD from saqc.constants import BAD
from saqc.core.modules.base import ModuleBase
import saqc import saqc
from saqc.lib.types import FreqString from saqc.lib.types import FreqString
class ChangePoints(ModuleBase): class ChangePoints:
def flagChangePoints( def flagChangePoints(
self, self,
field: str, field: str,
...@@ -27,7 +26,7 @@ class ChangePoints(ModuleBase): ...@@ -27,7 +26,7 @@ class ChangePoints(ModuleBase):
flag: float = BAD, flag: float = BAD,
**kwargs, **kwargs,
) -> saqc.SaQC: ) -> saqc.SaQC:
return self.defer("flagChangePoints", locals()) return self._defer("flagChangePoints", locals())
def assignChangePointCluster( def assignChangePointCluster(
self, self,
...@@ -47,4 +46,4 @@ class ChangePoints(ModuleBase): ...@@ -47,4 +46,4 @@ class ChangePoints(ModuleBase):
flag: float = BAD, flag: float = BAD,
**kwargs, **kwargs,
) -> saqc.SaQC: ) -> saqc.SaQC:
return self.defer("assignChangePointCluster", locals()) return self._defer("assignChangePointCluster", locals())
...@@ -3,12 +3,11 @@ ...@@ -3,12 +3,11 @@
from __future__ import annotations from __future__ import annotations
from saqc.constants import BAD from saqc.constants import BAD
from saqc.core.modules.base import ModuleBase
import saqc import saqc
from saqc.lib.types import FreqString from saqc.lib.types import FreqString
class Constants(ModuleBase): class Constants:
def flagByVariance( def flagByVariance(
self, self,
field: str, field: str,
...@@ -19,9 +18,9 @@ class Constants(ModuleBase): ...@@ -19,9 +18,9 @@ class Constants(ModuleBase):
flag: float = BAD, flag: float = BAD,
**kwargs **kwargs
) -> saqc.SaQC: ) -> saqc.SaQC:
return self.defer("flagByVariance", locals()) return self._defer("flagByVariance", locals())
def flagConstants( def flagConstants(
self, field: str, thresh: float, window: FreqString, flag: float = BAD, **kwargs self, field: str, thresh: float, window: FreqString, flag: float = BAD, **kwargs
) -> saqc.SaQC: ) -> saqc.SaQC:
return self.defer("flagConstants", locals()) return self._defer("flagConstants", locals())
...@@ -7,11 +7,10 @@ from dios import DictOfSeries ...@@ -7,11 +7,10 @@ from dios import DictOfSeries
from typing_extensions import Literal from typing_extensions import Literal
from saqc.constants import BAD from saqc.constants import BAD
from saqc.core.modules.base import ModuleBase
import saqc import saqc
class Curvefit(ModuleBase): class Curvefit:
def fitPolynomial( def fitPolynomial(
self, self,
field: str, field: str,
...@@ -23,4 +22,4 @@ class Curvefit(ModuleBase): ...@@ -23,4 +22,4 @@ class Curvefit(ModuleBase):
flag: float = BAD, flag: float = BAD,
**kwargs **kwargs
) -> saqc.SaQC: ) -> saqc.SaQC:
return self.defer("fitPolynomial", locals()) return self._defer("fitPolynomial", locals())
...@@ -8,13 +8,12 @@ import numpy as np ...@@ -8,13 +8,12 @@ import numpy as np
from scipy.spatial.distance import pdist from scipy.spatial.distance import pdist
from saqc.constants import BAD from saqc.constants import BAD
from saqc.core.modules.base import ModuleBase
import saqc import saqc
from saqc.funcs import LinkageString from saqc.funcs import LinkageString
from saqc.lib.types import FreqString, CurveFitter from saqc.lib.types import FreqString, CurveFitter
class Drift(ModuleBase): class Drift:
def flagDriftFromNorm( def flagDriftFromNorm(
self, self,
field: str, field: str,
...@@ -30,7 +29,7 @@ class Drift(ModuleBase): ...@@ -30,7 +29,7 @@ class Drift(ModuleBase):
flag: float = BAD, flag: float = BAD,
**kwargs **kwargs
) -> saqc.SaQC: ) -> saqc.SaQC:
return self.defer("flagDriftFromNorm", locals()) return self._defer("flagDriftFromNorm", locals())
def flagDriftFromReference( def flagDriftFromReference(
self, self,
...@@ -45,7 +44,7 @@ class Drift(ModuleBase): ...@@ -45,7 +44,7 @@ class Drift(ModuleBase):
flag: float = BAD, flag: float = BAD,
**kwargs **kwargs
) -> saqc.SaQC: ) -> saqc.SaQC:
return self.defer("flagDriftFromReference", locals()) return self._defer("flagDriftFromReference", locals())
def flagDriftFromScaledNorm( def flagDriftFromScaledNorm(
self, self,
...@@ -63,7 +62,7 @@ class Drift(ModuleBase): ...@@ -63,7 +62,7 @@ class Drift(ModuleBase):
flag: float = BAD, flag: float = BAD,
**kwargs **kwargs
) -> saqc.SaQC: ) -> saqc.SaQC:
return self.defer("flagDriftFromScaledNorm", locals()) return self._defer("flagDriftFromScaledNorm", locals())
def correctDrift( def correctDrift(
self, self,
...@@ -74,7 +73,7 @@ class Drift(ModuleBase): ...@@ -74,7 +73,7 @@ class Drift(ModuleBase):
flag: float = BAD, flag: float = BAD,
**kwargs **kwargs
) -> saqc.SaQC: ) -> saqc.SaQC:
return self.defer("correctDrift", locals()) return self._defer("correctDrift", locals())
def correctRegimeAnomaly( def correctRegimeAnomaly(
self, self,
...@@ -85,7 +84,7 @@ class Drift(ModuleBase): ...@@ -85,7 +84,7 @@ class Drift(ModuleBase):
epoch: bool = False, epoch: bool = False,
**kwargs **kwargs
) -> saqc.SaQC: ) -> saqc.SaQC:
return self.defer("correctRegimeAnomaly", locals()) return self._defer("correctRegimeAnomaly", locals())
def correctOffset( def correctOffset(
self, self,
...@@ -97,4 +96,4 @@ class Drift(ModuleBase): ...@@ -97,4 +96,4 @@ class Drift(ModuleBase):
tolerance: Optional[FreqString] = None, tolerance: Optional[FreqString] = None,
**kwargs **kwargs
) -> saqc.SaQC: ) -> saqc.SaQC:
return self.defer("correctOffset", locals()) return self._defer("correctOffset", locals())
...@@ -9,22 +9,21 @@ from dios import DictOfSeries ...@@ -9,22 +9,21 @@ from dios import DictOfSeries
from typing_extensions import Literal from typing_extensions import Literal
from saqc.constants import BAD from saqc.constants import BAD
from saqc.core.modules.base import ModuleBase
import saqc import saqc
class FlagTools(ModuleBase): class FlagTools:
def clearFlags(self, field: str, **kwargs) -> saqc.SaQC: def clearFlags(self, field: str, **kwargs) -> saqc.SaQC:
return self.defer("clearFlags", locals()) return self._defer("clearFlags", locals())
def forceFlags(self, field: str, flag: float = BAD, **kwargs) -> saqc.SaQC: def forceFlags(self, field: str, flag: float = BAD, **kwargs) -> saqc.SaQC:
return self.defer("forceFlags", locals()) return self._defer("forceFlags", locals())
def flagDummy(self, field: str, **kwargs) -> saqc.SaQC: def flagDummy(self, field: str, **kwargs) -> saqc.SaQC:
return self.defer("flagDummy", locals()) return self._defer("flagDummy", locals())
def flagUnflagged(self, field: str, flag: float = BAD, **kwargs) -> saqc.SaQC: def flagUnflagged(self, field: str, flag: float = BAD, **kwargs) -> saqc.SaQC:
return self.defer("flagUnflagged", locals()) return self._defer("flagUnflagged", locals())
def flagManual( def flagManual(
self, self,
...@@ -35,4 +34,4 @@ class FlagTools(ModuleBase): ...@@ -35,4 +34,4 @@ class FlagTools(ModuleBase):
flag: float = BAD, flag: float = BAD,
**kwargs, **kwargs,
) -> saqc.SaQC: ) -> saqc.SaQC:
return self.defer("flagManual", locals()) return self._defer("flagManual", locals())
...@@ -8,21 +8,20 @@ import numpy as np ...@@ -8,21 +8,20 @@ import numpy as np
import pandas as pd import pandas as pd
from saqc.constants import UNFLAGGED, BAD from saqc.constants import UNFLAGGED, BAD
from saqc.core.modules.base import ModuleBase
import saqc import saqc
class Generic(ModuleBase): class Generic:
def process( def genericProcess(
self, self,
field: str, field: str,
func: Callable[[pd.Series], pd.Series], func: Callable[[pd.Series], pd.Series],
to_mask: float = UNFLAGGED, to_mask: float = UNFLAGGED,
**kwargs, **kwargs,
) -> saqc.SaQC: ) -> saqc.SaQC:
return self.defer("process", locals()) return self._defer("genericProcess", locals())
def flag( def genericFlag(
self, self,
field: str, field: str,
func: Callable[[pd.Series], pd.Series], func: Callable[[pd.Series], pd.Series],
...@@ -30,4 +29,4 @@ class Generic(ModuleBase): ...@@ -30,4 +29,4 @@ class Generic(ModuleBase):
to_mask: float = UNFLAGGED, to_mask: float = UNFLAGGED,
**kwargs, **kwargs,
) -> saqc.SaQC: ) -> saqc.SaQC:
return self.defer("flag", locals()) return self._defer("genericFlag", locals())
...@@ -8,12 +8,11 @@ import numpy as np ...@@ -8,12 +8,11 @@ import numpy as np
import pandas as pd import pandas as pd
from saqc.constants import UNFLAGGED from saqc.constants import UNFLAGGED
from saqc.core.modules.base import ModuleBase
import saqc import saqc
from saqc.funcs.interpolation import _SUPPORTED_METHODS from saqc.funcs.interpolation import _SUPPORTED_METHODS
class Interpolation(ModuleBase): class Interpolation:
def interpolateByRolling( def interpolateByRolling(
self, self,
field: str, field: str,
...@@ -24,7 +23,7 @@ class Interpolation(ModuleBase): ...@@ -24,7 +23,7 @@ class Interpolation(ModuleBase):
flag: float = UNFLAGGED, flag: float = UNFLAGGED,
**kwargs **kwargs
) -> saqc.SaQC: ) -> saqc.SaQC:
return self.defer("interpolateByRolling", locals()) return self._defer("interpolateByRolling", locals())
def interpolateInvalid( def interpolateInvalid(
self, self,
...@@ -36,7 +35,7 @@ class Interpolation(ModuleBase): ...@@ -36,7 +35,7 @@ class Interpolation(ModuleBase):
flag: float = UNFLAGGED, flag: float = UNFLAGGED,
**kwargs **kwargs
) -> saqc.SaQC: ) -> saqc.SaQC:
return self.defer("interpolateInvalid", locals()) return self._defer("interpolateInvalid", locals())
def interpolateIndex( def interpolateIndex(
self, self,
...@@ -48,4 +47,4 @@ class Interpolation(ModuleBase): ...@@ -48,4 +47,4 @@ class Interpolation(ModuleBase):
downgrade: bool = False, downgrade: bool = False,
**kwargs **kwargs
) -> saqc.SaQC: ) -> saqc.SaQC:
return self.defer("interpolateIndex", locals()) return self._defer("interpolateIndex", locals())
...@@ -7,12 +7,11 @@ import pandas as pd ...@@ -7,12 +7,11 @@ import pandas as pd
from typing import Callable from typing import Callable
from saqc.constants import BAD from saqc.constants import BAD
from saqc.core.modules.base import ModuleBase
import saqc import saqc
from saqc.lib.types import FreqString from saqc.lib.types import FreqString
class Noise(ModuleBase): class Noise:
def flagByStatLowPass( def flagByStatLowPass(
self, self,
field: str, field: str,
...@@ -25,4 +24,4 @@ class Noise(ModuleBase): ...@@ -25,4 +24,4 @@ class Noise(ModuleBase):
flag: float = BAD, flag: float = BAD,
**kwargs **kwargs
) -> saqc.SaQC: ) -> saqc.SaQC:
return self.defer("flagByStatLowPass", locals()) return self._defer("flagByStatLowPass", locals())
...@@ -9,12 +9,11 @@ import pandas as pd ...@@ -9,12 +9,11 @@ import pandas as pd
from typing_extensions import Literal from typing_extensions import Literal
from saqc.constants import BAD from saqc.constants import BAD
from saqc.core.modules.base import ModuleBase
import saqc import saqc
from saqc.lib.types import FreqString from saqc.lib.types import FreqString
class Outliers(ModuleBase): class Outliers:
def flagByStray( def flagByStray(
self, self,
field: str, field: str,
...@@ -25,7 +24,7 @@ class Outliers(ModuleBase): ...@@ -25,7 +24,7 @@ class Outliers(ModuleBase):
flag: float = BAD, flag: float = BAD,
**kwargs, **kwargs,
) -> saqc.SaQC: ) -> saqc.SaQC:
return self.defer("flagByStray", locals()) return self._defer("flagByStray", locals())
def flagMVScores( def flagMVScores(
self, self,
...@@ -45,7 +44,7 @@ class Outliers(ModuleBase): ...@@ -45,7 +44,7 @@ class Outliers(ModuleBase):
flag: float = BAD, flag: float = BAD,
**kwargs, **kwargs,
) -> saqc.SaQC: ) -> saqc.SaQC:
return self.defer("flagMVScores", locals()) return self._defer("flagMVScores", locals())
def flagRaise( def flagRaise(
self, self,
...@@ -60,7 +59,7 @@ class Outliers(ModuleBase): ...@@ -60,7 +59,7 @@ class Outliers(ModuleBase):
flag: float = BAD, flag: float = BAD,
**kwargs, **kwargs,
) -> saqc.SaQC: ) -> saqc.SaQC:
return self.defer("flagRaise", locals()) return self._defer("flagRaise", locals())
def flagMAD( def flagMAD(
self, self,
...@@ -70,7 +69,7 @@ class Outliers(ModuleBase): ...@@ -70,7 +69,7 @@ class Outliers(ModuleBase):
flag: float = BAD, flag: float = BAD,
**kwargs, **kwargs,
) -> saqc.SaQC: ) -> saqc.SaQC:
return self.defer("flagMAD", locals()) return self._defer("flagMAD", locals())
def flagOffset( def flagOffset(
self, self,
...@@ -82,7 +81,7 @@ class Outliers(ModuleBase): ...@@ -82,7 +81,7 @@ class Outliers(ModuleBase):
flag: float = BAD, flag: float = BAD,
**kwargs, **kwargs,
) -> saqc.SaQC: ) -> saqc.SaQC:
return self.defer("flagOffset", locals()) return self._defer("flagOffset", locals())
def flagByGrubbs( def flagByGrubbs(
self, self,
...@@ -94,7 +93,7 @@ class Outliers(ModuleBase): ...@@ -94,7 +93,7 @@ class Outliers(ModuleBase):
flag: float = BAD, flag: float = BAD,
**kwargs, **kwargs,
) -> saqc.SaQC: ) -> saqc.SaQC:
return self.defer("flagByGrubbs", locals()) return self._defer("flagByGrubbs", locals())
def flagRange( def flagRange(
self, self,
...@@ -104,7 +103,7 @@ class Outliers(ModuleBase): ...@@ -104,7 +103,7 @@ class Outliers(ModuleBase):
flag: float = BAD, flag: float = BAD,
**kwargs, **kwargs,
) -> saqc.SaQC: ) -> saqc.SaQC:
return self.defer("flagRange", locals()) return self._defer("flagRange", locals())
def flagCrossStatistic( def flagCrossStatistic(
self, self,
...@@ -115,4 +114,4 @@ class Outliers(ModuleBase): ...@@ -115,4 +114,4 @@ class Outliers(ModuleBase):
flag: float = BAD, flag: float = BAD,
**kwargs, **kwargs,
) -> saqc.SaQC: ) -> saqc.SaQC:
return self.defer("flagCrossStatistic", locals()) return self._defer("flagCrossStatistic", locals())
...@@ -5,11 +5,10 @@ from __future__ import annotations ...@@ -5,11 +5,10 @@ from __future__ import annotations
from typing import Sequence from typing import Sequence
from saqc.constants import BAD from saqc.constants import BAD
from saqc.core.modules.base import ModuleBase
import saqc import saqc
class Pattern(ModuleBase): class Pattern:
def flagPatternByDTW( def flagPatternByDTW(
self, self,
field, field,
...@@ -20,9 +19,9 @@ class Pattern(ModuleBase): ...@@ -20,9 +19,9 @@ class Pattern(ModuleBase):
flag=BAD, flag=BAD,
**kwargs **kwargs
) -> saqc.SaQC: ) -> saqc.SaQC:
return self.defer("flagPatternByDTW", locals()) return self._defer("flagPatternByDTW", locals())
def flagPatternByWavelet( def flagPatternByWavelet(
self, field, reference, widths=(1, 2, 4, 8), waveform="mexh", flag=BAD, **kwargs self, field, reference, widths=(1, 2, 4, 8), waveform="mexh", flag=BAD, **kwargs
) -> saqc.SaQC: ) -> saqc.SaQC:
return self.defer("flagPatternByWavelet", locals()) return self._defer("flagPatternByWavelet", locals())
...@@ -9,14 +9,13 @@ import pandas as pd ...@@ -9,14 +9,13 @@ import pandas as pd
from typing_extensions import Literal from typing_extensions import Literal
from saqc.constants import BAD from saqc.constants import BAD
from saqc.core.modules.base import ModuleBase
import saqc import saqc
from saqc.funcs.interpolation import _SUPPORTED_METHODS from saqc.funcs.interpolation import _SUPPORTED_METHODS
class Resampling(ModuleBase): class Resampling:
def linear(self, field: str, freq: str, **kwargs) -> saqc.SaQC: def linear(self, field: str, freq: str, **kwargs) -> saqc.SaQC:
return self.defer("linear", locals()) return self._defer("linear", locals())
def interpolate( def interpolate(
self, self,
...@@ -26,7 +25,7 @@ class Resampling(ModuleBase): ...@@ -26,7 +25,7 @@ class Resampling(ModuleBase):
order: int = 1, order: int = 1,
**kwargs, **kwargs,
) -> saqc.SaQC: ) -> saqc.SaQC:
return self.defer("interpolate", locals()) return self._defer("interpolate", locals())
def shift( def shift(
self, self,
...@@ -36,7 +35,7 @@ class Resampling(ModuleBase): ...@@ -36,7 +35,7 @@ class Resampling(ModuleBase):
freq_check: Optional[Literal["check", "auto"]] = None, freq_check: Optional[Literal["check", "auto"]] = None,
**kwargs, **kwargs,
) -> saqc.SaQC: ) -> saqc.SaQC:
return self.defer("shift", locals()) return self._defer("shift", locals())
def resample( def resample(
self, self,
...@@ -52,7 +51,7 @@ class Resampling(ModuleBase): ...@@ -52,7 +51,7 @@ class Resampling(ModuleBase):
freq_check: Optional[Literal["check", "auto"]] = None, freq_check: Optional[Literal["check", "auto"]] = None,
**kwargs, **kwargs,
) -> saqc.SaQC: ) -> saqc.SaQC:
return self.defer("resample", locals()) return self._defer("resample", locals())
def reindexFlags( def reindexFlags(
self, self,
...@@ -71,4 +70,4 @@ class Resampling(ModuleBase): ...@@ -71,4 +70,4 @@ class Resampling(ModuleBase):
drop: Optional[bool] = False, drop: Optional[bool] = False,
**kwargs, **kwargs,
) -> saqc.SaQC: ) -> saqc.SaQC:
return self.defer("reindexFlags", locals()) return self._defer("reindexFlags", locals())
...@@ -8,11 +8,10 @@ import numpy as np ...@@ -8,11 +8,10 @@ import numpy as np
from typing_extensions import Literal from typing_extensions import Literal
from saqc.constants import BAD from saqc.constants import BAD
from saqc.core.modules.base import ModuleBase
import saqc import saqc
class Residues(ModuleBase): class Residues:
def calculatePolynomialResidues( def calculatePolynomialResidues(
self, self,
field: str, field: str,
...@@ -23,7 +22,7 @@ class Residues(ModuleBase): ...@@ -23,7 +22,7 @@ class Residues(ModuleBase):
flag: float = BAD, flag: float = BAD,
**kwargs **kwargs
) -> saqc.SaQC: ) -> saqc.SaQC:
return self.defer("calculatePolynomialResidues", locals()) return self._defer("calculatePolynomialResidues", locals())
def calculateRollingResidues( def calculateRollingResidues(
self, self,
...@@ -36,4 +35,4 @@ class Residues(ModuleBase): ...@@ -36,4 +35,4 @@ class Residues(ModuleBase):
flag: float = BAD, flag: float = BAD,
**kwargs **kwargs
) -> saqc.SaQC: ) -> saqc.SaQC:
return self.defer("calculateRollingResidues", locals()) return self._defer("calculateRollingResidues", locals())
...@@ -7,11 +7,9 @@ import numpy as np ...@@ -7,11 +7,9 @@ import numpy as np
import pandas as pd import pandas as pd
from saqc.constants import BAD from saqc.constants import BAD
from saqc.core.modules.base import ModuleBase
import saqc
class Rolling(ModuleBase): class Rolling:
def roll( def roll(
self, self,
field: str, field: str,
...@@ -24,4 +22,4 @@ class Rolling(ModuleBase): ...@@ -24,4 +22,4 @@ class Rolling(ModuleBase):
flag: float = BAD, flag: float = BAD,
**kwargs **kwargs
): ):
return self.defer("roll", locals()) return self._defer("roll", locals())
...@@ -8,12 +8,10 @@ import numpy as np ...@@ -8,12 +8,10 @@ import numpy as np
import pandas as pd import pandas as pd
from typing_extensions import Literal from typing_extensions import Literal
from saqc.core import Flags
from saqc.core.modules.base import ModuleBase
import saqc import saqc
class Scores(ModuleBase): class Scores:
def assignKNNScore( def assignKNNScore(
self, self,
field: str, field: str,
...@@ -28,4 +26,4 @@ class Scores(ModuleBase): ...@@ -28,4 +26,4 @@ class Scores(ModuleBase):
p: int = 2, p: int = 2,
**kwargs **kwargs
) -> saqc.SaQC: ) -> saqc.SaQC:
return self.defer("assignKNNScore", locals()) return self._defer("assignKNNScore", locals())
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