Skip to content

line_throughput

line_throughput ¤

LineThroughputEvents ¤

LineThroughputEvents(
    dataframe: DataFrame,
    *,
    event_uuid: str = "prod:throughput",
    time_column: str = "systime"
)

Bases: Base

Production: Line Throughput

Methods: - count_parts: Part counts per fixed window from a monotonically increasing counter. - takt_adherence: Cycle time violations against a takt time from step/boolean triggers.

count_parts ¤

count_parts(
    counter_uuid: str,
    *,
    value_column: str = "value_integer",
    window: str = "1m"
) -> pd.DataFrame

Compute parts per window for a counter uuid.

Returns columns: window_start, uuid, source_uuid, is_delta, count

takt_adherence ¤

takt_adherence(
    cycle_uuid: str,
    *,
    value_column: str = "value_bool",
    takt_time: str = "60s",
    min_violation: str = "0s"
) -> pd.DataFrame

Flag cycles whose durations exceed the takt_time.

For boolean triggers: detect True rising edges as cycle boundaries. For integer steps: detect increments as cycle boundaries.

Returns: systime (at boundary), uuid, source_uuid, is_delta, cycle_time_seconds, violation

throughput_oee ¤

throughput_oee(
    counter_uuid: str,
    *,
    value_column: str = "value_integer",
    window: str = "1h",
    target_rate: Optional[float] = None,
    availability_threshold: float = 0.95
) -> pd.DataFrame

Calculate Overall Equipment Effectiveness (OEE) metrics.

OEE = Availability × Performance × Quality

Parameters:

Name Type Description Default
counter_uuid str

UUID for the part counter signal

required
value_column str

Column containing counter values

'value_integer'
window str

Time window for aggregation

'1h'
target_rate Optional[float]

Target production rate (parts per window). If None, uses max observed

None
availability_threshold float

Threshold for considering equipment available

0.95

Returns:

Type Description
DataFrame

DataFrame with columns: window_start, uuid, source_uuid, is_delta,

DataFrame

actual_count, target_count, availability, performance, oee_score

throughput_trends(
    counter_uuid: str,
    *,
    value_column: str = "value_integer",
    window: str = "1h",
    trend_window: int = 24
) -> pd.DataFrame

Analyze throughput trends with moving averages and degradation detection.

Parameters:

Name Type Description Default
counter_uuid str

UUID for the part counter signal

required
value_column str

Column containing counter values

'value_integer'
window str

Time window for counting parts

'1h'
trend_window int

Number of windows for trend calculation

24

Returns:

Type Description
DataFrame

DataFrame with throughput, moving average, trend direction, and degradation flag

cycle_quality_check ¤

cycle_quality_check(
    cycle_uuid: str,
    *,
    value_column: str = "value_bool",
    expected_cycle_time: Optional[float] = None,
    tolerance_pct: float = 0.1
) -> pd.DataFrame

Enhanced cycle detection with quality validation.

Parameters:

Name Type Description Default
cycle_uuid str

UUID for the cycle trigger signal

required
value_column str

Column containing cycle trigger (bool/integer)

'value_bool'
expected_cycle_time Optional[float]

Expected cycle time in seconds. If None, uses median

None
tolerance_pct float

Tolerance percentage for cycle time validation

0.1

Returns:

Type Description
DataFrame

DataFrame with cycle times, validation status, and quality flags