# Path: cotede/qctests/core.py
# class QCCheckVar(QCCheck):
#     """Template for a QC check of a specific variable
#     """
# 
#     def __init__(self, data, varname, cfg=None, autoflag=True, attrs=None):
#         self.varname = varname
#         super().__init__(data=data, cfg=cfg, autoflag=autoflag, attrs=attrs)


import logging
import numpy as np
    import pandas as pd
from numpy import ma
from cotede.qctests import QCCheckVar
    return np.array(y)


def curvature(x):
    """Curvature of a timeseries

    This test is commonly known as gradient for historical reasons, but that
    is a bad name choice since it is not the actual gradient, like:
    d/dx + d/dy + d/dz,
    but as defined by GTSPP, EuroGOOS and others, which is actually the
    curvature of the timeseries..

    Note
    ----
    - Pandas.Series operates with indexes, so it should be done different. In
      that case, call for _curvature_pandas.
    """
    if isinstance(x, ma.MaskedArray):
        x[x.mask] = np.nan
        x = x.data

    if PANDAS_AVAILABLE and isinstance(x, pd.Series):
        return _curvature_pandas(x)

    x = np.atleast_1d(x)
    y = np.nan * x
    y[1:-1] = x[1:-1] - (x[:-2] + x[2:]) / 2.0
    return y



# Path: cotede/qctests/core.py
# class QCCheckVar(QCCheck):
#     """Template for a QC check of a specific variable
#     """
# 
#     def __init__(self, data, varname, cfg=None, autoflag=True, attrs=None):
#         self.varname = varname
#         super().__init__(data=data, cfg=cfg, autoflag=autoflag, attrs=attrs)


# Path: cotede/qctests/gradient.py
import logging
import numpy as np
    import pandas as pd
from numpy import ma
from cotede.qctests import QCCheckVar

    return np.array(y)


def curvature(x):
    """Curvature of a timeseries

    This test is commonly known as gradient for historical reasons, but that
    is a bad name choice since it is not the actual gradient, like:
    d/dx + d/dy + d/dz,
    but as defined by GTSPP, EuroGOOS and others, which is actually the
    curvature of the timeseries..

    Note
    ----
    - Pandas.Series operates with indexes, so it should be done different. In
      that case, call for _curvature_pandas.
    """
    if isinstance(x, ma.MaskedArray):
        x[x.mask] = np.nan
        x = x.data

    if PANDAS_AVAILABLE and isinstance(x, pd.Series):
        return _curvature_pandas(x)

    x = np.atleast_1d(x)
    y = np.nan * x
    y[1:-1] = x[1:-1] - (x[:-2] + x[2:]) / 2.0
    return y



class Gradient(QCCheckVar):