neptoon.quality_control
quality_assessment¶
Classes:
- DateTimeIndexValidator
- ValidationError
- QualityCheck
- QualityAssessmentFlagBuilder
- DataQualityAssessor
Functions:
- apply
- add_check
- apply_checks
- return_targets
- builder
- builder
- change_saqc_scheme
- apply_quality_assessment
- add_custom_flag_builder
- add_quality_check
- import_checks_from_config
- return_data_frame
- return_flags_data_frame
DateTimeIndexValidator ¶
Validator class which checks that the supplied data frame has a datetime index
Init
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_frame
|
DataFrame
|
DataFrame to be checked |
required |
ValidationError ¶
Bases: Exception
Custom exception for validation errors.
QualityCheck ¶
Creates quality check.
Examples:
Create a quality check that flags neutron intensity values outside the range 500-550:
>>> from neptoon.column_info import ColumnInfo
>>> from neptoon.quality_control import QualityCheck, QAMethod
>>>
>>> check = QualityCheck(
... target=QATarget.RAW_NEUTRONS,
... method=QAMethod.RANGE_CHECK,
... params={
... "lower_bound": 500,
... "upper_bound": 550,
... },
... )
See neptoon.quality_control.WhatParamsDoINeed if you need help on allowable params.
QualityAssessmentFlagBuilder ¶
Staging place for the checks as they are built. First a user adds a check using the add_check method.
DataQualityAssessor ¶
Base class for working with SaQC in neptoon. It handles creating the object and checks that the data going in has a datetime index (essential for working in SaQC).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_frame
|
DataFrame
|
DataFrame containing time series data. |
required |
change_saqc_scheme ¶
Changes the saqc_scheme for SaQC object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scheme
|
str
|
String representing the scheme for flags. Can be: - simple - float - dmp - positional - annotated-float |
required |
apply_quality_assessment ¶
Cycles through the quality checks in the builder applying each of them to the data frame
add_custom_flag_builder ¶
Add a custom built flag builder to the object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
builder
|
QualityAssessmentFlagBuilder
|
A flag builder - presumed to be pre-constructed |
required |
add_quality_check ¶
Can be a check or a list of checks to the internal QualitCheckBuilder
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
check
|
QualityCheck | List of QualityCheck
|
Quality checks |
required |
import_checks_from_config ¶
Here could be a function for building the quality checks from a supplied config file
return_data_frame ¶
Returns the timeseries DataFrame.
Returns:
| Type | Description |
|---|---|
DataFrame
|
The main DataFrame |
return_flags_data_frame ¶
Returns the flag dataframe
Returns:
| Type | Description |
|---|---|
DataFrame
|
The DataFrame with assigned flags |