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

minor core cleanups

parent 88c05505
No related branches found
No related tags found
No related merge requests found
Pipeline #28928 passed with stage
in 2 minutes and 6 seconds
...@@ -2,45 +2,30 @@ ...@@ -2,45 +2,30 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from __future__ import annotations from __future__ import annotations
# TODO:
# - integrate plotting into the api
# - `data` and `flags` as arguments to `getResult`
import logging import logging
import inspect
import copy as stdcopy import copy as stdcopy
from saqc.lib.tools import toSequence
from typing import Tuple, Union, Optional from typing import Tuple, Union, Optional
from typing_extensions import Literal from typing_extensions import Literal
import pandas as pd import pandas as pd
import numpy as np import numpy as np
import inspect
import matplotlib
from dios import DictOfSeries, to_dios from dios import DictOfSeries, to_dios
from saqc.core.flags import initFlagsLike, Flags from saqc.core.flags import initFlagsLike, Flags
from saqc.core.lib import APIController, ColumnSelector from saqc.core.lib import APIController, ColumnSelector
from saqc.core.register import FUNC_MAP, SaQCFunction from saqc.core.register import FUNC_MAP, SaQCFunction
from saqc.core.modules import FuncModules from saqc.core.modules import FuncModules
from saqc.core.translator.basetranslator import Translator, FloatTranslator from saqc.core.translator.basetranslator import Translator, FloatTranslator
from saqc.lib.types import ExternalFlag, CallGraph, MaterializedGraph, PandasLike
from saqc.constants import BAD from saqc.constants import BAD
from saqc.lib.plotting import makeFig from saqc.lib.tools import toSequence
from saqc.core.translator.basetranslator import Translator, FloatTranslator
from saqc.lib.types import ( from saqc.lib.types import (
ExternalFlag, ExternalFlag,
CallGraph, CallGraph,
MaterializedGraph, MaterializedGraph,
PandasLike, PandasLike,
FreqString,
) )
from saqc.lib.tools import toSequence
logger = logging.getLogger("SaQC") logger = logging.getLogger("SaQC")
...@@ -301,6 +286,7 @@ class SaQC(FuncModules): ...@@ -301,6 +286,7 @@ class SaQC(FuncModules):
**{"nodata": self._nodata, "flag": self._translator(flag), **fkwargs}, **{"nodata": self._nodata, "flag": self._translator(flag), **fkwargs},
) )
# expand regular expressions
fields = self._data.columns.str.match(field) if regex else toSequence(field) fields = self._data.columns.str.match(field) if regex else toSequence(field)
for field in fields: for field in fields:
target = target if target is not None else field target = target if target is not None else field
......
...@@ -17,7 +17,6 @@ class ColumnSelector: ...@@ -17,7 +17,6 @@ class ColumnSelector:
return f"{self.__class__.__name__}({self.field})" return f"{self.__class__.__name__}({self.field})"
# TODO: this seems obsolete
@dataclass @dataclass
class APIController: class APIController:
def errorMessage(self): def errorMessage(self):
......
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