From ef9b8b31b057c82f74bb61bf5912e1692eb45970 Mon Sep 17 00:00:00 2001 From: David Schaefer <david.schaefer@ufz.de> Date: Tue, 29 Nov 2022 17:37:23 +0100 Subject: [PATCH] removed unused option --- saqc/funcs/tools.py | 11 ----------- saqc/lib/plotting.py | 23 ++--------------------- tests/funcs/test_tools.py | 8 ++------ 3 files changed, 4 insertions(+), 38 deletions(-) diff --git a/saqc/funcs/tools.py b/saqc/funcs/tools.py index 1d3f7c380..fca98f923 100644 --- a/saqc/funcs/tools.py +++ b/saqc/funcs/tools.py @@ -230,7 +230,6 @@ class ToolsMixin: field: str, path: Optional[str] = None, max_gap: Optional[str] = None, - history: Optional[Literal["valid", "complete"] | list] = "valid", xscope: Optional[slice] = None, phaseplot: Optional[str] = None, store_kwargs: Optional[dict] = None, @@ -264,15 +263,6 @@ class ToolsMixin: before plotting. If an offset string is passed, only points that have a distance below `max_gap` get connected via the plotting line. - history : {"valid", "complete", None, list of strings}, default "valid" - Discriminate the plotted flags with respect to the tests they originate from. - - * "valid" - Only plot those flags, that do not get altered or "unflagged" by subsequent tests. Only list tests - in the legend, that actually contributed flags to the overall resault. - * "complete" - plot all the flags set and list all the tests ran on a variable. Suitable for debugging/tracking. - * None - just plot the resulting flags for one variable, without any historical meta information. - * list of strings - plot only flags set by those tests listed. - xscope : slice or Offset, default None Parameter, that determines a chunk of the data to be plotted processed. `xscope` can be anything, that is a valid argument to the ``pandas.Series.__getitem__`` method. @@ -321,7 +311,6 @@ class ToolsMixin: flags=flags, level=level, max_gap=max_gap, - history=history, xscope=xscope, phaseplots=phaseplot, ax_kwargs=ax_kwargs, diff --git a/saqc/lib/plotting.py b/saqc/lib/plotting.py index 8236d73d5..84d8af264 100644 --- a/saqc/lib/plotting.py +++ b/saqc/lib/plotting.py @@ -13,7 +13,6 @@ import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import pandas as pd -from typing_extensions import Literal from saqc.core.flags import Flags, History from saqc.lib.tools import toSequence @@ -63,7 +62,6 @@ def makeFig( flags: Flags, level: float, max_gap: str | None = None, - history: Literal["valid", "complete"] | Sequence[str] | None = "valid", xscope: slice | None = None, phaseplots: Sequence[str] | None = None, ax_kwargs: dict | None = None, @@ -91,18 +89,6 @@ def makeFig( before plotting. If an Offset string is passed, only points that have a distance below `max_gap` get connected via the plotting line. - - history : {"valid", "complete", None, list of strings}, default "valid" - Discriminate the plotted flags with respect to the tests they originate from. - - * "valid" - Only plot those flags, that do not get altered or "unflagged" by subsequent tests. Only list tests - in the legend, that actually contributed flags to the overall resault. - * "complete" - plot all the flags set and list all the tests ran on a variable. Suitable for debugging/tracking. - * "clear" - clear plot from all the flagged values - * None - just plot the resulting flags for one variable, without any historical meta information. - * list of strings - for any string ``s`` in the list, plot the flags set by test labeled, ``s`` - if ``s`` is - not present in the history labels, plot any flags, set by a test labeled ``s`` - xscope : slice or Offset, default None Parameter, that determines a chunk of the data to be plotted / processed. `s` can be anything, that is a valid argument to the ``pandas.Series.__getitem__`` method. @@ -206,13 +192,8 @@ def _getMarkers( histories: Sequence[History], cyclestart: int ) -> dict[str, dict[str, str]]: - shapes = SCATTER_KWARGS.get("marker", "o") - shapes = itertools.cycle(toSequence(shapes)) - - colors = SCATTER_KWARGS.get( - "color", plt.rcParams["axes.prop_cycle"].by_key()["color"] - ) - colors = itertools.cycle(toSequence(colors)) + shapes = itertools.cycle(toSequence(SCATTER_KWARGS["marker"])) + colors = itertools.cycle(toSequence(SCATTER_KWARGS["color"])) for _ in range(0, cyclestart): next(colors) next(shapes) diff --git a/tests/funcs/test_tools.py b/tests/funcs/test_tools.py index 8ec0b5262..b39fc7a6d 100644 --- a/tests/funcs/test_tools.py +++ b/tests/funcs/test_tools.py @@ -24,15 +24,11 @@ def test_makeFig(): d_saqc = ( d_saqc.flagRange("data", max=500) .flagRange("data", max=400) - .flagRange("data", max=300) + .flagRange("data", max=300) ) # not interactive, no storing - dummy_path = "" - d_saqc = d_saqc.plot(field="data", path="") - d_saqc = d_saqc.plot(field="data", path=dummy_path, history="valid", stats=True) - d_saqc = d_saqc.plot(field="data", path=dummy_path, history="complete") d_saqc = d_saqc.plot( - field="data", path=dummy_path, ax_kwargs={"ylabel": "data is data"}, stats=True + field="data", path="", ax_kwargs={"ylabel": "data is data"}, stats=True ) -- GitLab