Skip to content

oee_calculator

oee_calculator ¤

Overall Equipment Effectiveness (OEE) calculator.

OEE = Availability x Performance x Quality

Industry-standard metric for manufacturing productivity: - Availability: actual run time / planned production time - Performance: actual throughput / ideal throughput - Quality: good parts / total parts

OEECalculator ¤

OEECalculator(
    dataframe: DataFrame, *, time_column: str = "systime"
)

Bases: Base

Calculate Overall Equipment Effectiveness from timeseries signals.

Combines availability (from run/idle state), performance (from part counters and ideal cycle time), and quality (from total/reject counters) into a single OEE metric per day.

Example usage

oee = OEECalculator(df)

Individual components¤

avail = oee.calculate_availability('machine_state') perf = oee.calculate_performance('part_counter', ideal_cycle_time=30.0, run_state_uuid='machine_state') qual = oee.calculate_quality('total_counter', 'reject_counter')

Combined daily OEE¤

daily = oee.calculate_oee( run_state_uuid='machine_state', counter_uuid='part_counter', ideal_cycle_time=30.0, total_uuid='total_counter', reject_uuid='reject_counter', )

Initialize OEE calculator.

Parameters:

Name Type Description Default
dataframe DataFrame

Input DataFrame with timeseries data.

required
time_column str

Name of timestamp column (default: 'systime').

'systime'

calculate_availability ¤

calculate_availability(
    run_state_uuid: str,
    planned_time_hours: Optional[float] = None,
    *,
    value_column: str = "value_bool"
) -> pd.DataFrame

Calculate availability percentage from run/idle intervals.

Availability = run_time / planned_time. When planned_time_hours is None the planned time is derived from the first-to-last timestamp span for each day.

Parameters:

Name Type Description Default
run_state_uuid str

UUID of the boolean run-state signal (True = running).

required
planned_time_hours Optional[float]

Fixed planned production hours per day. If None, the time span covered by data each day is used.

None
value_column str

Column holding the boolean state.

'value_bool'

Returns:

Type Description
DataFrame

DataFrame with columns:

DataFrame
  • date
DataFrame
  • run_seconds
DataFrame
  • planned_seconds
DataFrame
  • availability_pct

calculate_performance ¤

calculate_performance(
    counter_uuid: str,
    ideal_cycle_time: float,
    run_state_uuid: Optional[str] = None,
    *,
    value_column: str = "value_integer",
    run_value_column: str = "value_bool"
) -> pd.DataFrame

Calculate performance percentage (actual vs ideal throughput).

Performance = (actual_parts * ideal_cycle_time) / run_time. If run_state_uuid is None, the total time span per day is used as run time.

Parameters:

Name Type Description Default
counter_uuid str

UUID of the monotonic part counter.

required
ideal_cycle_time float

Ideal cycle time in seconds per part.

required
run_state_uuid Optional[str]

Optional UUID for run-state to compute actual run time.

None
value_column str

Column holding counter values.

'value_integer'
run_value_column str

Column holding boolean run state.

'value_bool'

Returns:

Type Description
DataFrame

DataFrame with columns:

DataFrame
  • date
DataFrame
  • actual_parts
DataFrame
  • ideal_parts
DataFrame
  • run_seconds
DataFrame
  • performance_pct

calculate_quality ¤

calculate_quality(
    total_uuid: str,
    reject_uuid: str,
    *,
    value_column: str = "value_integer"
) -> pd.DataFrame

Calculate quality percentage (good parts / total parts).

Parameters:

Name Type Description Default
total_uuid str

UUID of the total-parts counter.

required
reject_uuid str

UUID of the reject-parts counter.

required
value_column str

Column holding counter values.

'value_integer'

Returns:

Type Description
DataFrame

DataFrame with columns:

DataFrame
  • date
DataFrame
  • total_parts
DataFrame
  • reject_parts
DataFrame
  • good_parts
DataFrame
  • quality_pct

calculate_oee ¤

calculate_oee(
    run_state_uuid: str,
    counter_uuid: str,
    ideal_cycle_time: float,
    total_uuid: Optional[str] = None,
    reject_uuid: Optional[str] = None,
    *,
    planned_time_hours: Optional[float] = None
) -> pd.DataFrame

Calculate daily OEE = Availability * Performance * Quality.

When total_uuid / reject_uuid are not provided, quality is assumed to be 100 %.

Parameters:

Name Type Description Default
run_state_uuid str

UUID of the boolean run-state signal.

required
counter_uuid str

UUID of the monotonic part counter.

required
ideal_cycle_time float

Ideal cycle time in seconds per part.

required
total_uuid Optional[str]

Optional UUID of total-parts counter (for quality).

None
reject_uuid Optional[str]

Optional UUID of reject-parts counter (for quality).

None
planned_time_hours Optional[float]

Fixed planned production hours per day.

None

Returns:

Type Description
DataFrame

DataFrame with columns:

DataFrame
  • date
DataFrame
  • availability_pct
DataFrame
  • performance_pct
DataFrame
  • quality_pct
DataFrame
  • oee_pct