autom8qc.qaqc.limit

GlobalMinimumTest

Class

class autom8qc.qaqc.limit.GlobalMinimumTest(min_val, min_lim=None)

Bases: autom8qc.qaqc.base.QAQCTest

This class implements the Global Minimum test. Each instance of the class needs the parameter min_val that defines the lower limit of valid data points. Optionally you can also use the parameter min_lim for doubtful values. The probabilities for data points between min_val and min_lim will be linear interpolated (0, 1).

Parameters
  • NAME (str) – Name of the test

  • DESCRIPTION (str) – Description of the test

  • CATEGORY (str) – Category of the test

  • SUPPORTED_STRUCTURES (tuple or BaseStructure) – Supported data structures (e.g., Series)

  • parameters (ParameterList) – Supported parameters (default: None)

Supported parameters:
  • min_val (float): Lower limit for valid points

  • min_lim (float): Lower limit for doubtful points (optional)

SUPPORTED_STRUCTURES

alias of autom8qc.core.structures.Series

perform(series)

Performs the test and returns the probabilities. If a data point has nan as value, the probability for the point will also nan.

Raises

InvalidType – If structure is not supported

Parameters

series (pd.Series) – Series

Returns

Probabilities

Return type

pd.Series

static supported_parameters()

Returns the supported parameters.

Returns

Supported parameters

Return type

ParameterList

Example

# Generate sample data
import numpy as np
import pandas as pd
np.random.seed(42)
mu, sigma = 50, 4
values = np.random.normal(mu, sigma, 300)
index = pd.date_range(start="1/1/2021", periods=300, freq="min")
series = pd.Series(values, index=index)

# Perform test
from autom8qc.qaqc.limit import GlobalMinimumTest
test = GlobalMinimumTest(min_val=43, min_lim=42)
test.plot(series=series, series_name="Example")

Visualization

../_images/GlobalMinimumTest.svg

GlobalMaximumTest

Class

class autom8qc.qaqc.limit.GlobalMaximumTest(max_val, max_lim=None)

Bases: autom8qc.qaqc.base.QAQCTest

This class implements the Global maximum test. Each instance of the class needs the parameter max_val that defines the upper limit for valid data points. Optionally you can also use the parameter max_lim that defines the upper limit for doubtful limits. The probabilities for data points between max_val and max_lim will be linear interpolated (0, 1).

Parameters
  • NAME (str) – Name of the test

  • DESCRIPTION (str) – Description of the test

  • CATEGORY (str) – Category of the test

  • SUPPORTED_STRUCTURES (tuple or BaseStructure) – Supported data structures (e.g., Series)

  • parameters (ParameterList) – Supported parameters (default: None)

Supported parameters:
  • max_val (float): Upper limit for valid points

  • max_lim (float): Upper limit for doubtful points (optional)

SUPPORTED_STRUCTURES

alias of autom8qc.core.structures.Series

perform(series)

Performs the test and returns the probabilities. If a nan value is passed, nan also will return for it.

Raises

InvalidType – If structure is not supported

Parameters

series (pd.Series) – Series

Returns

Probabilities (1=Valid, 0=Invalid)

Return type

pd.Series

static supported_parameters()

Returns the supported parameters.

Returns

Supported parameters

Return type

ParameterList

Example

# Generate sample data
import numpy as np
import pandas as pd
np.random.seed(42)
mu, sigma = 50, 5
values = np.random.normal(mu, sigma, 300)
index = pd.date_range(start="1/1/2021", periods=300, freq="min")
series = pd.Series(values, index=index)

# Perform test
from autom8qc.qaqc.limit import GlobalMaximumTest
test = GlobalMaximumTest(max_val=59, max_lim=60)
test.plot(series=series, series_name="Example")

Visualization

../_images/GlobalMaximumTest.svg

GlobalRangeTest

Class

class autom8qc.qaqc.limit.GlobalRangeTest(min_val, max_val, min_lim=None, max_lim=None)

Bases: autom8qc.qaqc.base.QAQCTest

This class implements the Global range test. Each instance of the class needs the parameters max_val that defines the upper limit for valid data points and the parameter min_val that defines the lower limit for valid data points. A data point is valid if min_val < data point < max_val. Optionally you can also use the parameters max_lim that defines the upper limit for doubtful limits and min_lim that defines the lower limit for doubtful values. The probabilities for data points between min_val and min_lim (same for max_val and max_lim) will be linear interpolated (0, 1).

Parameters
  • NAME (str) – Name of the test

  • DESCRIPTION (str) – Description of the test

  • CATEGORY (str) – Category of the test

  • SUPPORTED_STRUCTURES (tuple or BaseStructure) – Supported data structures (e.g., Series)

  • parameters (ParameterList) – Supported parameters (default: None)

Supported parameters:
  • min_val (float): Lower limit for valid points

  • min_lim (float): Lower limit for doubtful points (optional)

  • max_val (float): Upper limit for valid points

  • max_lim (float): Upper limit for doubtful points (optional)

SUPPORTED_STRUCTURES

alias of autom8qc.core.structures.Series

perform(series)

Performs the test and returns the probabilities. If a nan value is passed, nan also will return for it.

Raises

InvalidType – If structure is not supported

Parameters

series (pd.Series) – Series

Returns

Probabilities (1=Valid, 0=Invalid)

Return type

pd.Series

static supported_parameters()

Returns the supported parameters.

Returns

Supported parameters

Return type

ParameterList

Example

# Generate sample data
import numpy as np
import pandas as pd
np.random.seed(42)
mu, sigma = 50, 2
values = np.random.normal(mu, sigma, 300)
index = pd.date_range(start="1/1/2021", periods=300, freq="min")
series = pd.Series(values, index=index)

# Perform test
from autom8qc.qaqc.limit import GlobalRangeTest
test = GlobalRangeTest(min_lim=46, min_val=47, max_val=54, max_lim=55)
test.plot(series=series, series_name="Example")

Visualization

../_images/GlobalRangeTest.svg