operator_performance
operator_performance ¤
Operator/team performance tracking.
Compare production output and quality across operators: - Production by operator - Operator efficiency vs targets - Quality by operator - Operator ranking/comparison
OperatorPerformanceEvents ¤
OperatorPerformanceEvents(
dataframe: DataFrame,
*,
time_column: str = "systime",
shift_definitions: (
dict[str, tuple[str, str]] | None
) = None
)
Bases: Base
Track and compare operator performance.
Each UUID represents one signal: - operator_uuid: operator or team identifier signal - counter_uuid: production counter signal - ok_uuid / nok_uuid: OK/NOK part counters (optional, for quality)
Merge keys: [operator] for operator-level, [date, shift] for shift-level.
Pipeline example::
ops = OperatorPerformanceEvents(df)
by_op = ops.production_by_operator('operator_id', 'part_counter')
# → standalone KPI report
quality = ops.quality_by_operator('operator_id', 'good_parts', 'bad_parts')
# → merge with QualityEvents outputs on [date, shift]
Example usage
tracker = OperatorPerformanceEvents(df)
Parts per operator¤
prod = tracker.production_by_operator( operator_uuid='operator_id', counter_uuid='part_counter', )
Efficiency vs target¤
eff = tracker.operator_efficiency( operator_uuid='operator_id', counter_uuid='part_counter', target_per_shift=500, )
production_by_operator ¤
production_by_operator(
operator_uuid: str,
counter_uuid: str,
*,
value_column_operator: str = "value_string",
value_column_counter: str = "value_integer",
handle_resets: bool = True,
production_day: bool = True
) -> pd.DataFrame
Parts produced per operator.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
operator_uuid
|
str
|
UUID for operator/team identifier signal. |
required |
counter_uuid
|
str
|
UUID for production counter signal. |
required |
value_column_operator
|
str
|
Column containing operator names. |
'value_string'
|
value_column_counter
|
str
|
Column containing counter values. |
'value_integer'
|
handle_resets
|
bool
|
When True (default), treat a decreasing counter as a reset
and count the production accumulated after the reset instead
of losing it. The increments are computed once over the whole
signal and booked to the (operator, date, shift) of the reading
that reports them, so the operators add up to the signal total
and nothing is lost at a shift or operator change.
The result gains a |
True
|
production_day
|
bool
|
When True, an overnight shift's post-midnight readings are attributed to the shift's start date, so a night shift counts as one worked shift. Default True; False groups by raw calendar date. Only affects overnight schedules. |
True
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with columns: |
DataFrame
|
|
DataFrame
|
|
operator_efficiency ¤
operator_efficiency(
operator_uuid: str,
counter_uuid: str,
target_per_shift: int,
*,
value_column_operator: str = "value_string",
value_column_counter: str = "value_integer"
) -> pd.DataFrame
Operator efficiency vs a per-shift target.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
operator_uuid
|
str
|
UUID for operator/team identifier signal. |
required |
counter_uuid
|
str
|
UUID for production counter signal. |
required |
target_per_shift
|
int
|
Target production quantity per shift. |
required |
value_column_operator
|
str
|
Column containing operator names. |
'value_string'
|
value_column_counter
|
str
|
Column containing counter values. |
'value_integer'
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with columns: |
DataFrame
|
|
quality_by_operator ¤
quality_by_operator(
operator_uuid: str,
ok_uuid: str,
nok_uuid: str,
*,
value_column_operator: str = "value_string",
value_column_counter: str = "value_integer",
handle_resets: bool = True
) -> pd.DataFrame
Quality metrics (First Pass Yield) per operator.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
operator_uuid
|
str
|
UUID for operator/team identifier signal. |
required |
ok_uuid
|
str
|
UUID for good parts counter. |
required |
nok_uuid
|
str
|
UUID of the NOK part counter. |
required |
value_column_operator
|
str
|
Column containing operator names. |
'value_string'
|
value_column_counter
|
str
|
Column containing counter values. |
'value_integer'
|
handle_resets
|
bool
|
When True (default), treat a decreasing counter as a reset
and count the OK/NOK parts accumulated after the reset, for
both the OK and NOK counters. Because the counts are taken
over the whole range, a single reset otherwise wipes out an
operator's entire tally. The result gains a |
True
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with columns: |
DataFrame
|
|
DataFrame
|
|
operator_comparison ¤
operator_comparison(
operator_uuid: str,
counter_uuid: str,
*,
value_column_operator: str = "value_string",
value_column_counter: str = "value_integer"
) -> pd.DataFrame
Ranked operator performance comparison.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
operator_uuid
|
str
|
UUID for operator/team identifier signal. |
required |
counter_uuid
|
str
|
UUID for production counter signal. |
required |
value_column_operator
|
str
|
Column containing operator names. |
'value_string'
|
value_column_counter
|
str
|
Column containing counter values. |
'value_integer'
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with columns: |
DataFrame
|
|
DataFrame
|
Canonical twin columns: |
DataFrame
|
the same values as the deprecated column right before it, which is removed |
DataFrame
|
in the next major release. |