handlers
Classes#
DataQualityError #
Bases: ValueError
Raised when the quality of a variable indicates a fatal error has occurred. Manual review of the data in question is often recommended in this case.
FailPipeline #
Bases: QualityHandler
Raises a DataQualityError, halting the pipeline, if the data quality are sufficiently bad. This usually indicates that a manual inspection of the data is recommended.
Raises:
Type | Description |
---|---|
DataQualityError
|
DataQualityError |
Attributes#
Classes#
Parameters #
Bases: BaseModel
Attributes#
class-attribute
instance-attribute
#Additional context set by users that ends up in the traceback message.
class-attribute
instance-attribute
#Tolerance for the number of allowable failures as the ratio of allowable failures to the total number of values checked. Defaults to 0, meaning that any failed checks will result in a DataQualityError being raised.
Functions#
run #
Source code in tsdat/qc/handlers.py
RecordQualityResults #
Bases: QualityHandler
Records the results of the quality check in an ancillary qc variable. Creates the ancillary qc variable if one does not already exist.
Attributes#
Classes#
Parameters #
Bases: BaseModel
Attributes#
instance-attribute
#Indicates the quality of the data if the test results indicate a failure.
class-attribute
instance-attribute
#DEPRECATED
The bit number (e.g., 1, 2, 3, ...) used to indicate if the check passed.
The quality results are bitpacked into an integer array to preserve space. For example, if 'check #0' uses bit 0 and fails, and 'check #1' uses bit 1 and fails then the resulting value on the qc variable would be 2^(0) + 2^(1) = 3. If we had a third check it would be 2^(0) + 2^(1) + 2^(2) = 7.
Functions#
Functions#
get_next_bit_number #
Source code in tsdat/qc/handlers.py
run #
Source code in tsdat/qc/handlers.py
RemoveFailedValues #
Bases: QualityHandler
Replaces all failed values with the variable's _FillValue. If the variable does not have a _FillValue attribute then nan is used instead
Functions#
run #
Source code in tsdat/qc/handlers.py
SortDatasetByCoordinate #
Bases: QualityHandler
Sorts the dataset by the failed variable, if there are any failures.