Skip to content

bottleneck_detection

bottleneck_detection ¤

BottleneckDetectionEvents ¤

BottleneckDetectionEvents(
    dataframe: DataFrame,
    *,
    time_column: str = "systime",
    event_uuid: str = "prod:bottleneck",
    value_column: str = "value_bool"
)

Bases: Base

Production: Bottleneck Detection

Identify which station constrains a production line by analyzing utilization of multiple boolean run-state signals.

Methods: - station_utilization: Per-station uptime percentage per window. - detect_bottleneck: Identify the bottleneck station per window. - shifting_bottleneck: Track when the bottleneck moves between stations. - throughput_constraint_summary: Summary statistics across all stations.

station_utilization ¤

station_utilization(
    station_uuids: List[str], window: str = "1h"
) -> pd.DataFrame

Per-station uptime percentage per time window.

Parameters:

Name Type Description Default
station_uuids List[str]

List of UUID strings identifying station run-state signals.

required
window str

Resample window (e.g. '1h', '30m').

'1h'

Returns:

Type Description
DataFrame

DataFrame with columns: window_start, uuid, utilization_pct.

detect_bottleneck ¤

detect_bottleneck(
    station_uuids: List[str], window: str = "1h"
) -> pd.DataFrame

Identify the bottleneck station per window.

The bottleneck is the station with the highest utilization — it is always running because it is the constraint.

Parameters:

Name Type Description Default
station_uuids List[str]

List of station run-state UUIDs.

required
window str

Resample window.

'1h'

Returns:

Type Description
DataFrame

DataFrame with columns: window_start, window_end, bottleneck_uuid, utilization_pct.

shifting_bottleneck ¤

shifting_bottleneck(
    station_uuids: List[str], window: str = "1h"
) -> pd.DataFrame

Track when the bottleneck identity changes between stations.

Parameters:

Name Type Description Default
station_uuids List[str]

List of station run-state UUIDs.

required
window str

Resample window.

'1h'

Returns:

Type Description
DataFrame

DataFrame with columns: systime, from_uuid, to_uuid,

DataFrame

previous_utilization, new_utilization.

throughput_constraint_summary ¤

throughput_constraint_summary(
    station_uuids: List[str], window: str = "1h"
) -> Dict[str, Any]

Summary statistics for bottleneck analysis.

Parameters:

Name Type Description Default
station_uuids List[str]

List of station run-state UUIDs.

required
window str

Resample window.

'1h'

Returns:

Type Description
Dict[str, Any]

Dict with: bottleneck_counts, bottleneck_percentages,

Dict[str, Any]

most_frequent_bottleneck, avg_utilization_per_station.