Skip to content
Snippets Groups Projects
Commit fa97c356 authored by David Schäfer's avatar David Schäfer Committed by Peter Lünenschloß
Browse files

Docufixes

parent 0104611d
No related branches found
No related tags found
6 merge requests!685Release 2.4,!684Release 2.4,!567Release 2.2.1,!566Release 2.2,!501Release 2.1,!484Docufixes
......@@ -12,6 +12,7 @@ variables:
stages:
- compliance
- test
- build
- deploy
default:
......@@ -108,12 +109,31 @@ python310:
reports:
junit: report.xml
doctest:
stage: test
script:
- cd docs
- pip install -r requirements.txt
- make testonly
# ===========================================================
# Building stage
# ===========================================================
# check if we are able to build a wheel
wheel:
stage: test
stage: build
script:
- pip install wheel
- pip wheel .
- pip install .
docs:
stage: build
script:
- cd docs
- pip install -r requirements.txt
- make doconly
# ===========================================================
# Extra Pipeline (run with a successful run of all other jobs on develop)
......
......@@ -36,11 +36,6 @@ doc:
# generate environment table from dictionary
@$(SPHINXBUILD) -M doctest "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
rm -f *.automodsumm
rm -f *.automodapi
rm -f modules/*.automodsumm
rm -f modules/*.automodapi
rm -f */*.automodsumm
# make documentation
doconly:
......@@ -49,14 +44,8 @@ doconly:
# make test, clean up
testonly:
# generate parent fake module for the functions to be documented
# generate parent fake module for the functions to be documented
@$(SPHINXBUILD) -M doctest "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
rm -f *.automodsumm
rm -f *.automodapi
rm -f modules/*.automodsumm
rm -f modules/*.automodapi
rm -f */*.automodsumm
rm -f -r coredoc
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
......
......@@ -16,7 +16,7 @@ The Python API of SaQC consists of three distinct components:
1. the core class, :py:class:`saqc.SaQC`
2. a number of flagging schemes
3. a collection of :doc:`functions <../modules/saqcFuncTOC>`.
3. a collection of :doc:`functions <../modules/SaQCFunctions>`.
One and two are implemented as distinct classes, the core object is called ``SaQC`` and we currently
provide three flagging schemes, namely:
......
......@@ -78,7 +78,7 @@ In this case, we trigger a :py:meth:`range <saqc.SaQC.flagRange>` test, that fla
the range of the bounds of the interval *[10,60]*. Subsequently, a test to detect spikes, is applied,
using the MAD-method. (:py:meth:`~saqc.SaQC.flagMAD`).
You can find an overview of all available quality control tests
:ref:`here <modules/saqcFuncTOC:SaQC Methods>`. Note that the tests are
:ref:`here <modules/SaQCFunctions:Test Functions>`. Note that the tests are
*executed in the order that you define in the configuration file*. The quality
flags that are set during one test are always passed on to the subsequent one.
......
......@@ -45,30 +45,31 @@ Getting Started
documentation/ConfigurationFiles
documentation/Customizations
.. toctree::
:caption: Functions
:hidden:
:maxdepth: 1
:glob:
:titlesonly:
resampling <funcs/resampling>
generic <funcs/generic>
outliers <funcs/outliers>
breaks <funcs/breaks>
constants <funcs/constants>
changepoints <funcs/changepoints>
drift <funcs/drift>
curvefit <funcs/curvefit>
interpolation <funcs/interpolation>
residuals <funcs/residuals>
tools <funcs/tools>
flagtools <funcs/flagtools>
rolling <funcs/rolling>
scores <funcs/scores>
transformation <funcs/transformation>
noise <funcs/noise>
pattern <funcs/pattern>
..
.. toctree::
:caption: Functions
:hidden:
:maxdepth: 1
:glob:
:titlesonly:
resampling <funcs/resampling>
generic <funcs/generic>
outliers <funcs/outliers>
breaks <funcs/breaks>
constants <funcs/constants>
changepoints <funcs/changepoints>
drift <funcs/drift>
curvefit <funcs/curvefit>
interpolation <funcs/interpolation>
residuals <funcs/residuals>
tools <funcs/tools>
flagtools <funcs/flagtools>
rolling <funcs/rolling>
scores <funcs/scores>
transformation <funcs/transformation>
noise <funcs/noise>
pattern <funcs/pattern>
.. toctree::
......@@ -76,10 +77,11 @@ Getting Started
:hidden:
:maxdepth: 2
Package <modules/saqc>
Core <modules/saqcCore>
Methods <modules/saqcFuncTOC>
Constants <modules/saqcConstants>
Package <modules/SaQC>
Core <modules/SaQCCore>
Test Functions <modules/SaQCFunctions>
Translations <modules/SaQCTranslation>
Constants <modules/SaQCConstants>
.. toctree::
:caption: Developer Resources
......
File moved
File moved
......@@ -2,7 +2,7 @@
..
.. SPDX-License-Identifier: GPL-3.0-or-later
saqc
SaQC
====
.. automodapi:: saqc.core
......
......@@ -2,8 +2,11 @@
..
.. SPDX-License-Identifier: GPL-3.0-or-later
SaQC Methods
------------
SaQC
====
Test Functions
--------------
.. toctree::
:glob:
......
.. SPDX-FileCopyrightText: 2021 Helmholtz-Zentrum für Umweltforschung GmbH - UFZ
..
.. SPDX-License-Identifier: GPL-3.0-or-later
SaQC Object Methods
===================
.. currentmodule:: saqc
.. autosummary::
SaQC
.. SPDX-FileCopyrightText: 2021 Helmholtz-Zentrum für Umweltforschung GmbH - UFZ
..
.. SPDX-License-Identifier: GPL-3.0-or-later
SaQC
====
.. automodapi:: saqc.core.translation
:include-all-objects:
......@@ -5,7 +5,8 @@
# SPDX-License-Identifier: GPL-3.0-or-later
# -*- coding: utf-8 -*-
"""The system for automated quality controll package."""
"""The System for automated Quality Control package."""
from saqc.constants import BAD, DOUBTFUL, FILTER_ALL, FILTER_NONE, GOOD, UNFLAGGED
......
......@@ -8,7 +8,7 @@ from __future__ import annotations
from copy import copy as shallowcopy
from copy import deepcopy
from typing import Any, Dict, List, Tuple, Union
from typing import Any, Callable, Dict, List, Tuple, Union
import numpy as np
import pandas as pd
......@@ -25,9 +25,8 @@ class History:
names are increasing integers starting with 0. After initialisation
the FH is empty and has no columns at all.
To get the worst flags (highest value) that are currently stored in
the FH, we provide a ``max()`` method. It returns a pd.Series indicating
the worst flag per row.
To get the latest flags, that are currently stored in the FH, we provide
a ``squeeze()`` method.
For more details and a detailed discussion, why this is needed, how this
works and possible other implementations, see #GL143 [1].
......@@ -44,7 +43,7 @@ class History:
createHistoryFromData: function to create History from existing data
"""
def __init__(self, index: pd.Index):
def __init__(self, index: pd.Index | None):
self.hist = pd.DataFrame(index=index)
self.meta = []
......@@ -125,7 +124,9 @@ class History:
return self
def append(self, value: Union[pd.Series, History], meta: dict = None) -> History:
def append(
self, value: Union[pd.Series, History], meta: dict | None = None
) -> History:
"""
Create a new FH column and insert given pd.Series to it.
......@@ -211,11 +212,11 @@ class History:
def squeeze(self, raw=False) -> pd.Series:
"""
Get the maximum value per row of the FH.
Get the last flag value per row of the FH.
Returns
-------
pd.Series: maximum values
pd.Series
"""
result = self.hist.astype(float)
if result.empty:
......@@ -266,7 +267,7 @@ class History:
def apply(
self,
index: pd.Index,
func: callable,
func: Callable,
func_kws: dict,
func_handle_df: bool = False,
copy: bool = True,
......
......@@ -37,6 +37,7 @@ class TranslationScheme:
the inverse of the 'forward' translation.
The translation mechanism imposes a few restrictions:
- The scheme must be well definied, i.e. we need a backward translation for
every forward translation (each value in `self._forward` needs a key in
`self._backward`).
......
......@@ -29,7 +29,6 @@ def test_codeSnippets(fname):
FILEURL = "https://git.ufz.de/rdm-software/saqc/-/blob/develop/"
@pytest.mark.skip
@pytest.mark.parametrize("fname", ["README.md"])
def test_links(fname):
with open(fname, "r") as f:
......
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