tsdat.qc.checkers
¶
Classes¶
Checks the difference between consecutive values and reports a failure if the |
|
Checks that no values for the specified variable are greater than a specified |
|
Checks that no values for the specified variable are less than a specified minimum |
|
Checks that no values for the specified variable are greater than a specified |
|
Checks that no values for the specified variable are less than a specified minimum |
|
Checks if any data are missing. A variable’s data are considered missing if they are |
|
Checks if any values are not ordered strictly monotonically (i.e. values must all be |
|
Checks the difference between consecutive values and reports a failure if the |
|
Checks that no values for the specified variable are greater than a specified |
|
Checks that no values for the specified variable are less than a specified minimum |
|
Checks that no values for the specified variable are greater than a specified |
|
Checks that no values for the specified variable are less than a specified minimum |
|
Checks the difference between consecutive values and reports a failure if the |
|
Checks that no values for the specified variable are greater than a specified |
|
Checks that no values for the specified variable are less than a specified minimum |
|
Checks that no values for the specified variable are greater than a specified |
|
Checks that no values for the specified variable are less than a specified minimum |
-
class
tsdat.qc.checkers.
CheckFailDelta
[source]¶ Bases:
_CheckDelta
Checks the difference between consecutive values and reports a failure if the difference is less than the threshold specified by the value in the attribute provided to this check.
- Parameters
attribute_name (str) – The name of the attribute containing the threshold to use.
-
class
tsdat.qc.checkers.
CheckFailMax
[source]¶ Bases:
_CheckMax
Checks that no values for the specified variable are greater than a specified threshold. The value of the threshold is specified by an attribute on each data variable, and the attribute to search for is specified as a property of this base class.
If the specified attribute does not exist on the variable being checked then no failures will be reported.
- Parameters
attribute_name (str) – The name of the attribute containing the maximum
If the attribute ends in '_range' then it is assumed to be a list (threshold.) –
:param : :param and the first value from the list will be used as the minimum threshold.: :param allow_equal: True if values equal to the threshold should pass the check, :type allow_equal: bool :param False otherwise.:
-
class
tsdat.qc.checkers.
CheckFailMin
[source]¶ Bases:
_CheckMin
Checks that no values for the specified variable are less than a specified minimum threshold. The value of the threshold is specified by an attribute on each data variable, and the attribute to search for is specified as a property of this base class.
If the specified attribute does not exist on the variable being checked then no failures will be reported.
- Parameters
attribute_name (str) – The name of the attribute containing the minimum
If the attribute ends in '_range' then it is assumed to be a list (threshold.) –
:param : :param and the first value from the list will be used as the minimum threshold.: :param allow_equal: True if values equal to the threshold should pass the check, :type allow_equal: bool :param False otherwise.:
-
class
tsdat.qc.checkers.
CheckFailRangeMax
[source]¶ Bases:
_CheckMax
Checks that no values for the specified variable are greater than a specified threshold. The value of the threshold is specified by an attribute on each data variable, and the attribute to search for is specified as a property of this base class.
If the specified attribute does not exist on the variable being checked then no failures will be reported.
- Parameters
attribute_name (str) – The name of the attribute containing the maximum
If the attribute ends in '_range' then it is assumed to be a list (threshold.) –
:param : :param and the first value from the list will be used as the minimum threshold.: :param allow_equal: True if values equal to the threshold should pass the check, :type allow_equal: bool :param False otherwise.:
-
class
tsdat.qc.checkers.
CheckFailRangeMin
[source]¶ Bases:
_CheckMin
Checks that no values for the specified variable are less than a specified minimum threshold. The value of the threshold is specified by an attribute on each data variable, and the attribute to search for is specified as a property of this base class.
If the specified attribute does not exist on the variable being checked then no failures will be reported.
- Parameters
attribute_name (str) – The name of the attribute containing the minimum
If the attribute ends in '_range' then it is assumed to be a list (threshold.) –
:param : :param and the first value from the list will be used as the minimum threshold.: :param allow_equal: True if values equal to the threshold should pass the check, :type allow_equal: bool :param False otherwise.:
-
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
Checks the quality of a specific variable in the dataset and returns the results
Method Descriptions
-
run
(self, dataset: xarray.Dataset, variable_name: str) → numpy.typing.NDArray[numpy.bool8][source]¶ 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
The results of the quality check, where True values indicate a quality problem.
- Return type
NDArray[np.bool8]
-
-
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 Methods
Checks the quality of a specific variable in the dataset and returns the results
Method Descriptions
-
run
(self, dataset: xarray.Dataset, variable_name: str) → numpy.typing.NDArray[numpy.bool8][source]¶ 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
The results of the quality check, where True values indicate a quality problem.
- Return type
NDArray[np.bool8]
-
-
class
tsdat.qc.checkers.
CheckValidDelta
[source]¶ Bases:
_CheckDelta
Checks the difference between consecutive values and reports a failure if the difference is less than the threshold specified by the value in the attribute provided to this check.
- Parameters
attribute_name (str) – The name of the attribute containing the threshold to use.
-
class
tsdat.qc.checkers.
CheckValidMax
[source]¶ Bases:
_CheckMax
Checks that no values for the specified variable are greater than a specified threshold. The value of the threshold is specified by an attribute on each data variable, and the attribute to search for is specified as a property of this base class.
If the specified attribute does not exist on the variable being checked then no failures will be reported.
- Parameters
attribute_name (str) – The name of the attribute containing the maximum
If the attribute ends in '_range' then it is assumed to be a list (threshold.) –
:param : :param and the first value from the list will be used as the minimum threshold.: :param allow_equal: True if values equal to the threshold should pass the check, :type allow_equal: bool :param False otherwise.:
-
class
tsdat.qc.checkers.
CheckValidMin
[source]¶ Bases:
_CheckMin
Checks that no values for the specified variable are less than a specified minimum threshold. The value of the threshold is specified by an attribute on each data variable, and the attribute to search for is specified as a property of this base class.
If the specified attribute does not exist on the variable being checked then no failures will be reported.
- Parameters
attribute_name (str) – The name of the attribute containing the minimum
If the attribute ends in '_range' then it is assumed to be a list (threshold.) –
:param : :param and the first value from the list will be used as the minimum threshold.: :param allow_equal: True if values equal to the threshold should pass the check, :type allow_equal: bool :param False otherwise.:
-
class
tsdat.qc.checkers.
CheckValidRangeMax
[source]¶ Bases:
_CheckMax
Checks that no values for the specified variable are greater than a specified threshold. The value of the threshold is specified by an attribute on each data variable, and the attribute to search for is specified as a property of this base class.
If the specified attribute does not exist on the variable being checked then no failures will be reported.
- Parameters
attribute_name (str) – The name of the attribute containing the maximum
If the attribute ends in '_range' then it is assumed to be a list (threshold.) –
:param : :param and the first value from the list will be used as the minimum threshold.: :param allow_equal: True if values equal to the threshold should pass the check, :type allow_equal: bool :param False otherwise.:
-
class
tsdat.qc.checkers.
CheckValidRangeMin
[source]¶ Bases:
_CheckMin
Checks that no values for the specified variable are less than a specified minimum threshold. The value of the threshold is specified by an attribute on each data variable, and the attribute to search for is specified as a property of this base class.
If the specified attribute does not exist on the variable being checked then no failures will be reported.
- Parameters
attribute_name (str) – The name of the attribute containing the minimum
If the attribute ends in '_range' then it is assumed to be a list (threshold.) –
:param : :param and the first value from the list will be used as the minimum threshold.: :param allow_equal: True if values equal to the threshold should pass the check, :type allow_equal: bool :param False otherwise.:
-
class
tsdat.qc.checkers.
CheckWarnDelta
[source]¶ Bases:
_CheckDelta
Checks the difference between consecutive values and reports a failure if the difference is less than the threshold specified by the value in the attribute provided to this check.
- Parameters
attribute_name (str) – The name of the attribute containing the threshold to use.
-
class
tsdat.qc.checkers.
CheckWarnMax
[source]¶ Bases:
_CheckMax
Checks that no values for the specified variable are greater than a specified threshold. The value of the threshold is specified by an attribute on each data variable, and the attribute to search for is specified as a property of this base class.
If the specified attribute does not exist on the variable being checked then no failures will be reported.
- Parameters
attribute_name (str) – The name of the attribute containing the maximum
If the attribute ends in '_range' then it is assumed to be a list (threshold.) –
:param : :param and the first value from the list will be used as the minimum threshold.: :param allow_equal: True if values equal to the threshold should pass the check, :type allow_equal: bool :param False otherwise.:
-
class
tsdat.qc.checkers.
CheckWarnMin
[source]¶ Bases:
_CheckMin
Checks that no values for the specified variable are less than a specified minimum threshold. The value of the threshold is specified by an attribute on each data variable, and the attribute to search for is specified as a property of this base class.
If the specified attribute does not exist on the variable being checked then no failures will be reported.
- Parameters
attribute_name (str) – The name of the attribute containing the minimum
If the attribute ends in '_range' then it is assumed to be a list (threshold.) –
:param : :param and the first value from the list will be used as the minimum threshold.: :param allow_equal: True if values equal to the threshold should pass the check, :type allow_equal: bool :param False otherwise.:
-
class
tsdat.qc.checkers.
CheckWarnRangeMax
[source]¶ Bases:
_CheckMax
Checks that no values for the specified variable are greater than a specified threshold. The value of the threshold is specified by an attribute on each data variable, and the attribute to search for is specified as a property of this base class.
If the specified attribute does not exist on the variable being checked then no failures will be reported.
- Parameters
attribute_name (str) – The name of the attribute containing the maximum
If the attribute ends in '_range' then it is assumed to be a list (threshold.) –
:param : :param and the first value from the list will be used as the minimum threshold.: :param allow_equal: True if values equal to the threshold should pass the check, :type allow_equal: bool :param False otherwise.:
-
class
tsdat.qc.checkers.
CheckWarnRangeMin
[source]¶ Bases:
_CheckMin
Checks that no values for the specified variable are less than a specified minimum threshold. The value of the threshold is specified by an attribute on each data variable, and the attribute to search for is specified as a property of this base class.
If the specified attribute does not exist on the variable being checked then no failures will be reported.
- Parameters
attribute_name (str) – The name of the attribute containing the minimum
If the attribute ends in '_range' then it is assumed to be a list (threshold.) –
:param : :param and the first value from the list will be used as the minimum threshold.: :param allow_equal: True if values equal to the threshold should pass the check, :type allow_equal: bool :param False otherwise.: