process_stability_index
process_stability_index ¤
ProcessStabilityIndexEvents ¤
ProcessStabilityIndexEvents(
dataframe: DataFrame,
signal_uuid: str,
*,
target: float | None = None,
lower_spec: float | None = None,
upper_spec: float | None = None,
event_uuid: str = "eng:stability_index",
value_column: str = "value_double",
time_column: str = "systime"
)
Bases: Base
Engineering: Process Stability Index
Generate a single 0-100 stability score per shift/day for a signal. Answers 'is my process running well today?' with one number.
Methods: - stability_score: Composite 0-100 score per window. - score_trend: Is stability improving or degrading? - worst_periods: N worst-scoring windows. - stability_comparison: Compare each window to best-observed.
stability_score ¤
stability_score(window: str = '8h') -> pd.DataFrame
Composite 0-100 stability score per window.
Four sub-scores (each 0-25): - variance_score: low std = high score - bias_score: on-target = high score - excursion_score: in-spec = high score - smoothness_score: low point-to-point jitter = high score
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
window
|
str
|
Scoring window (pandas offset string, e.g. '8h' per shift). Windows with fewer than two samples are skipped. |
'8h'
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with columns: start, end, duration_seconds, uuid, |
DataFrame
|
source_uuid, stability_score, |
DataFrame
|
variance_score, bias_score, excursion_score, smoothness_score, |
DataFrame
|
grade. |
score_trend ¤
score_trend(
window: str = "8h", n_windows: int = 7
) -> pd.DataFrame
Track whether stability is improving or degrading.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
window
|
str
|
Scoring window passed to :meth: |
'8h'
|
n_windows
|
int
|
Number of windows in the rolling average of the score. |
7
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with columns: start, end, duration_seconds, uuid, |
DataFrame
|
source_uuid, stability_score, |
DataFrame
|
rolling_avg, trend_direction, score_change. |
worst_periods ¤
worst_periods(
window: str = "1h", n: int = 5
) -> pd.DataFrame
Return the N worst-scoring windows.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
window
|
str
|
Scoring window passed to :meth: |
'1h'
|
n
|
int
|
Number of lowest-scoring windows to return. |
5
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with columns: start, end, duration_seconds, uuid, |
DataFrame
|
source_uuid, stability_score, |
DataFrame
|
variance_score, bias_score, excursion_score, smoothness_score, |
DataFrame
|
primary_issue. |
stability_comparison ¤
stability_comparison(window: str = '8h') -> pd.DataFrame
Compare each window to the best-observed window.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
window
|
str
|
Scoring window passed to :meth: |
'8h'
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with columns: start, end, duration_seconds, uuid, |
DataFrame
|
source_uuid, stability_score, |
DataFrame
|
best_score, gap_to_best, pct_of_best. |
DataFrame
|
Canonical twin columns: |
DataFrame
|
the same values as the deprecated column right before it, which is removed |
DataFrame
|
in the next major release. |