tsdat.qc.checkers

Classes

CheckFailDelta

Checks for deltas between consecutive values larger than 'fail_delta'.

CheckFailMax

Checks for values greater than 'fail_max'.

CheckFailMin

Checks for values less than 'fail_min'.

CheckFailRangeMax

Checks for values greater than 'fail_range'.

CheckFailRangeMin

Checks for values less than 'fail_range'.

CheckMissing

Checks if any data are missing. A variable's data are considered missing if they are

CheckMonotonic

Checks if any values are not ordered strictly monotonically (i.e. values must all be

CheckValidDelta

Checks for deltas between consecutive values larger than 'valid_delta'.

CheckValidMax

Checks for values greater than 'valid_max'.

CheckValidMin

Checks for values less than 'valid_min'.

CheckValidRangeMax

Checks for values greater than 'valid_range'.

CheckValidRangeMin

Checks for values less than 'valid_range'.

CheckWarnDelta

Checks for deltas between consecutive values larger than 'warn_delta'.

CheckWarnMax

Checks for values greater than 'warn_max'.

CheckWarnMin

Checks for values less than 'warn_min'.

CheckWarnRangeMax

Checks for values greater than 'warn_range'.

CheckWarnRangeMin

Checks for values less than 'warn_range'.

class tsdat.qc.checkers.CheckFailDelta[source]

Bases: _CheckDelta

Checks for deltas between consecutive values larger than ‘fail_delta’.

attribute_name :str = fail_delta[source]
class tsdat.qc.checkers.CheckFailMax[source]

Bases: _CheckMax

Checks for values greater than ‘fail_max’.

attribute_name :str = fail_max[source]
class tsdat.qc.checkers.CheckFailMin[source]

Bases: _CheckMin

Checks for values less than ‘fail_min’.

attribute_name :str = fail_min[source]
class tsdat.qc.checkers.CheckFailRangeMax[source]

Bases: _CheckMax

Checks for values greater than ‘fail_range’.

attribute_name :str = fail_range[source]
class tsdat.qc.checkers.CheckFailRangeMin[source]

Bases: _CheckMin

Checks for values less than ‘fail_range’.

attribute_name :str = fail_range[source]
class tsdat.qc.checkers.CheckMissing[source]

Bases: tsdat.qc.base.QualityChecker

Checks if any data are missing. A variable’s data are considered missing if they are set to the variable’s _FillValue (if it has a _FillValue) or NaN (NaT for datetime- like variables).

Class Methods

run

Identifies and flags quality problems with the data.

Method Descriptions

run(self, dataset: xarray.Dataset, variable_name: str) numpy.typing.NDArray[numpy.bool8][source]

Identifies and flags quality problems with the data.

Checks the quality of a specific variable in the dataset and returns the results of the check as a boolean array where True values represent quality problems and False values represent data that passes the quality check.

QualityCheckers should not modify dataset variables; changes to the dataset should be made by QualityHandler(s), which receive the results of a QualityChecker as input.

Parameters
  • dataset (xr.Dataset) – The dataset containing the variable to check.

  • variable_name (str) – The name of the variable to check.

Returns

NDArray[np.bool8] – The results of the quality check, where True values indicate a quality problem.

class tsdat.qc.checkers.CheckMonotonic[source]

Bases: tsdat.qc.base.QualityChecker

Checks if any values are not ordered strictly monotonically (i.e. values must all be increasing or all decreasing). The check marks all values as failed if any data values are not ordered monotonically.

class Parameters[source]

Bases: pydantic.BaseModel

dim :Optional[str][source]
require_decreasing :bool = False[source]
require_increasing :bool = False[source]

Class Methods

check_monotonic_not_increasing_and_decreasing

Method Descriptions

classmethod check_monotonic_not_increasing_and_decreasing(cls, inc: bool, values: Dict[str, Any]) bool[source]
parameters :CheckMonotonic.Parameters[source]

Class Methods

get_axis

run

Identifies and flags quality problems with the data.

Method Descriptions

get_axis(self, variable: xarray.DataArray) int[source]
run(self, dataset: xarray.Dataset, variable_name: str) numpy.typing.NDArray[numpy.bool8][source]

Identifies and flags quality problems with the data.

Checks the quality of a specific variable in the dataset and returns the results of the check as a boolean array where True values represent quality problems and False values represent data that passes the quality check.

QualityCheckers should not modify dataset variables; changes to the dataset should be made by QualityHandler(s), which receive the results of a QualityChecker as input.

Parameters
  • dataset (xr.Dataset) – The dataset containing the variable to check.

  • variable_name (str) – The name of the variable to check.

Returns

NDArray[np.bool8] – The results of the quality check, where True values indicate a quality problem.

class tsdat.qc.checkers.CheckValidDelta[source]

Bases: _CheckDelta

Checks for deltas between consecutive values larger than ‘valid_delta’.

attribute_name :str = valid_delta[source]
class tsdat.qc.checkers.CheckValidMax[source]

Bases: _CheckMax

Checks for values greater than ‘valid_max’.

attribute_name :str = valid_max[source]
class tsdat.qc.checkers.CheckValidMin[source]

Bases: _CheckMin

Checks for values less than ‘valid_min’.

attribute_name :str = valid_min[source]
class tsdat.qc.checkers.CheckValidRangeMax[source]

Bases: _CheckMax

Checks for values greater than ‘valid_range’.

attribute_name :str = valid_range[source]
class tsdat.qc.checkers.CheckValidRangeMin[source]

Bases: _CheckMin

Checks for values less than ‘valid_range’.

attribute_name :str = valid_range[source]
class tsdat.qc.checkers.CheckWarnDelta[source]

Bases: _CheckDelta

Checks for deltas between consecutive values larger than ‘warn_delta’.

attribute_name :str = warn_delta[source]
class tsdat.qc.checkers.CheckWarnMax[source]

Bases: _CheckMax

Checks for values greater than ‘warn_max’.

attribute_name :str = warn_max[source]
class tsdat.qc.checkers.CheckWarnMin[source]

Bases: _CheckMin

Checks for values less than ‘warn_min’.

attribute_name :str = warn_min[source]
class tsdat.qc.checkers.CheckWarnRangeMax[source]

Bases: _CheckMax

Checks for values greater than ‘warn_range’.

attribute_name :str = warn_range[source]
class tsdat.qc.checkers.CheckWarnRangeMin[source]

Bases: _CheckMin

Checks for values less than ‘warn_range’.

attribute_name :str = warn_range[source]