tsdat.qc.qc
¶
Classes¶
Class that provides static helper functions for providing quality |
|
Applies a single Quality Manager to the given Dataset, as defined by |
-
class
tsdat.qc.qc.
QualityManagement
[source]¶ Class that provides static helper functions for providing quality control checks on a tsdat-standardized xarray dataset.
Class Methods
Applies the Quality Managers defined in the given Config to this dataset.
Method Descriptions
-
static
run
(ds: xarray.Dataset, config: tsdat.config.Config, previous_data: xarray.Dataset) → xarray.Dataset[source]¶ Applies the Quality Managers defined in the given Config to this dataset. QC results will be embedded in the dataset. QC metadata will be stored as attributes, and QC flags will be stored as a bitwise integer in new companion qc_ variables that are added to the dataset. This method will create QC companion variables if they don’t exist.
- Parameters
ds (xr.Dataset) – The dataset to apply quality managers to
config (Config) – A configuration definition (loaded from yaml)
previous_data (xr.Dataset) – A dataset from the previous processing interval (i.e., file). This is used to check for consistency between files, such as for monitonic or delta checks when we need to check the previous value.
- Returns
The dataset after quality checkers and handlers have been applied.
- Return type
xr.Dataset
-
static
-
class
tsdat.qc.qc.
QualityManager
(ds: xarray.Dataset, config: tsdat.config.Config, definition: tsdat.config.QualityManagerDefinition, previous_data: xarray.Dataset)[source]¶ Applies a single Quality Manager to the given Dataset, as defined by the Config
- Parameters
ds (xr.Dataset) – The dataset for which we will perform quality management.
config (Config) – The Config from the pipeline definition file.
definition (QualityManagerDefinition) – Definition of the quality test this class manages.
previous_data (xr.Dataset) – A dataset from the previous processing interval (i.e., file). This is used to check for consistency between files, such as for monitonic or delta checks when we need to check the previous value.
Class Methods
Runs the QualityChecker and QualityHandler(s) for each specified
Method Descriptions
-
run
(self) → xarray.Dataset[source]¶ Runs the QualityChecker and QualityHandler(s) for each specified variable as defined in the config file.
- Returns
The dataset after the quality checker and the quality handlers have been run.
- Raises
QCError – A QCError indicates that a fatal error has occurred.
- Return type
xr.Dataset