diff --git a/docs/source/examples/usage/StreamConfig.ipynb b/docs/source/examples/usage/StreamConfig.ipynb deleted file mode 100644 index 5afc472..0000000 --- a/docs/source/examples/usage/StreamConfig.ipynb +++ /dev/null @@ -1,121 +0,0 @@ -{ - "metadata": { - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.8.2-final" - }, - "orig_nbformat": 2, - "kernelspec": { - "name": "python_defaultSpec_1597863786755", - "display_name": "Python 3.8.2 64-bit ('ioosqc38': conda)" - } - }, - "nbformat": 4, - "nbformat_minor": 2, - "cells": [ - { - "cell_type": "code", - "execution_count": 60, - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "# Install QC library\n", - "#!pip install git+git://github.com/ioos/ioos_qc.git\n", - "\n", - "# # Alternative installation (install specific branch):\n", - "# !pip uninstall -y ioos_qc\n", - "# !pip install git+git://github.com/ioos/ioos_qc.git@BRANCHNAME\n", - "\n", - "# Alternative installation (run with local updates):\n", - "#!pip uninstall -y ioos_qc\n", - "import sys\n", - "from pathlib import Path\n", - "basedir = Path().absolute()\n", - "libdir = basedir.parent.parent.parent.parent\n", - "sys.path.append(str(libdir))" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Load a StreamConfig object from a Python dictionary" - ] - }, - { - "cell_type": "code", - "execution_count": 63, - "metadata": { - "tags": [] - }, - "outputs": [ - { - "output_type": "execute_result", - "data": { - "text/plain": "OrderedDict([('qartod',\n {'aggregate': {},\n 'gross_range_test': {'suspect_span': [1, 11],\n 'fail_span': [0, 12]}})])" - }, - "metadata": {}, - "execution_count": 63 - } - ], - "source": [ - "from ioos_qc.config import StreamConfig\n", - "config = {\n", - " 'qartod': {\n", - " 'aggregate': {},\n", - " 'gross_range_test': {\n", - " 'suspect_span': [1, 11],\n", - " 'fail_span': [0, 12],\n", - " }\n", - " }\n", - "}\n", - "c = StreamConfig(config)\n", - "c.config" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Load a StreamConfig object from a YAML string" - ] - }, - { - "cell_type": "code", - "execution_count": 62, - "metadata": {}, - "outputs": [ - { - "output_type": "execute_result", - "data": { - "text/plain": "OrderedDict([('qartod',\n {'aggregate': None,\n 'gross_range_test': {'suspect_span': [1, 11],\n 'fail_span': [0, 12]}})])" - }, - "metadata": {}, - "execution_count": 62 - } - ], - "source": [ - "from ioos_qc.config import StreamConfig\n", - "config = \"\"\"\n", - " qartod:\n", - " aggregate:\n", - " gross_range_test:\n", - " suspect_span: [1, 11]\n", - " fail_span: [0, 12]\n", - "\"\"\"\n", - "c = StreamConfig(config)\n", - "c.config" - ] - } - ] -} \ No newline at end of file diff --git a/docs/source/usage.rst b/docs/source/usage.rst index 4d0aa72..d28303f 100644 --- a/docs/source/usage.rst +++ b/docs/source/usage.rst @@ -69,7 +69,6 @@ Configurations Configuration objects represent a collection of quality control tests to run and the parameters for each one. There are three main types of `Config` objects: -- StreamConfig_: This configures QC tests for a single stream of data like a ``list``, ``tuple``, ``numpy.ndarray``, ``dask.array``, ``pandas.Series``, ``netCDF4.Variable``, or ``xarray.DataArray``. This can be used standalone, or as a building block for the following more complex configs. - ContextConfig_: This defines a collection of ``StreamConfig`` objects. These can be applied to multiple variables provided in a ``pandas.DataFrame``, ``dask.DataFrame``, ``netCDF4.Dataset``, or ``xarray.Dataset``. Optionally, these configs can be constrained to specific time domains (``windows``) -- and/or spatial domains (``regions``). - Config_: A collection of ``ContextConfig`` objects, suitable for configuring a single input dataset to be broken up by region and time window before having QC checks applied. @@ -83,34 +82,6 @@ In addition, the ``ContextConfig`` and ``Config`` objects can be initialized wit - netCDF4/xarray filepath (``str`` or ``Path`` object) or ``Dataset`` -StreamConfig -~~~~~~~~~~~~ -A ``StreamConfig`` object defines a specific `ioos_qc` test module and test function along with the configuration parameters in which to run it with. - -.. note:: - - In earlier versions, ``StreamConfig`` was known as ``QcConfig``. - -Usage -^^^^^ - -.. code-block:: python - :linenos: - :caption: A basic ``StreamConfig`` object - - from ioos_qc.config import StreamConfig - - config = { - 'qartod': { - 'gross_range_test': { - 'suspect_span': [1, 11], - 'fail_span': [0, 12], - } - } - } - c = StreamConfig(config) - - ContextConfig ~~~~~~~~~~~~~ A ``ContextConfig`` object defines multiple ``StreamConfig`` objects as well as optional `region` and `window` objects.