Skip to content

capability_trending

CapabilityTrendingEvents ¤

CapabilityTrendingEvents(
    dataframe: DataFrame,
    signal_uuid: str,
    *,
    upper_spec: Optional[float] = None,
    lower_spec: Optional[float] = None,
    upper_spec_uuid: Optional[str] = None,
    lower_spec_uuid: Optional[str] = None,
    value_column: str = "value_double",
    event_uuid: str = "quality:capability_trend",
    time_column: str = "systime"
)

Bases: Base

Quality: Process Capability Trending

Track process capability indices (Cp, Cpk, Pp, Ppk) over rolling time windows to detect capability degradation before quality escapes occur.

Specification limits can be provided as fixed floats or as UUIDs referencing signal rows in the DataFrame (matching the ToleranceDeviationEvents pattern).

Methods: - capability_over_time: Cp/Cpk/Pp/Ppk per time window. - detect_capability_drop: Alert when Cpk falls below threshold. - capability_forecast: Extrapolate Cpk trend to predict threshold breach. - yield_estimate: Estimated yield, DPMO, and sigma level per window.

capability_over_time ¤

capability_over_time(window: str = '8h') -> pd.DataFrame

Compute Cp, Cpk, Pp, Ppk per time window.

Parameters:

Name Type Description Default
window str

Resample window size.

'8h'

Returns:

Type Description
DataFrame

DataFrame with columns: window_start, cp, cpk, pp, ppk,

DataFrame

mean, std, n_samples.

detect_capability_drop ¤

detect_capability_drop(
    window: str = "8h",
    min_cpk: float = 1.33,
    lookback: int = 5,
) -> pd.DataFrame

Detect windows where Cpk drops below threshold or degrades significantly.

Parameters:

Name Type Description Default
window str

Resample window size.

'8h'
min_cpk float

Minimum acceptable Cpk value.

1.33
lookback int

Number of previous windows for rolling average comparison.

5

Returns:

Type Description
DataFrame

DataFrame with columns: window_start, cpk, prev_avg_cpk, drop_pct, alert.

capability_forecast ¤

capability_forecast(
    window: str = "8h",
    horizon: int = 5,
    threshold: float = 1.33,
) -> pd.DataFrame

Extrapolate Cpk trend to predict when it will breach threshold.

Parameters:

Name Type Description Default
window str

Resample window size.

'8h'
horizon int

Number of future windows to forecast.

5
threshold float

Cpk threshold to predict breach for.

1.33

Returns:

Type Description
DataFrame

DataFrame with columns: window_start, cpk, trend_slope,

DataFrame

forecast_cpk, windows_to_threshold.

yield_estimate ¤

yield_estimate(window: str = '8h') -> pd.DataFrame

Estimate yield, DPMO, and sigma level per window.

Assumes normal distribution within each window.

Parameters:

Name Type Description Default
window str

Resample window size.

'8h'

Returns:

Type Description
DataFrame

DataFrame with columns: window_start, estimated_yield_pct,

DataFrame

dpmo, sigma_level.