order_traceability
order_traceability ¤
Value-based traceability across stations.
Given multiple station UUIDs that each carry a string signal (any shared identifier — serial number, order number, batch ID, lot number, etc.), build an end-to-end timeline showing when each identifier was at each station, with durations and total lead times.
Typical use case: every machine on a production line writes the current identifier to its own UUID. This module joins those signals to answer "when was identifier X at station A, then B, then C?"
ValueTraceabilityEvents ¤
ValueTraceabilityEvents(
dataframe: DataFrame,
station_uuids: Dict[str, str],
*,
event_uuid: str = "prod:value_trace",
value_column: str = "value_string",
time_column: str = "systime"
)
Bases: Base
Trace a shared identifier across multiple stations.
Each station has its own UUID that carries a string value (the identifier currently being processed — serial number, order ID, batch code, etc.). This module detects when a given identifier appears at each station and builds a timeline.
Example usage
trace = ValueTraceabilityEvents( df, station_uuids={ 'station_a_uuid': 'Station A', 'station_b_uuid': 'Station B', 'station_c_uuid': 'Station C', }, )
Full timeline of every identifier across all stations¤
timeline = trace.build_timeline()
Lead time from first to last station¤
lead = trace.lead_time()
Where is each identifier right now?¤
status = trace.current_status()
Station dwell-time statistics¤
dwell = trace.station_dwell_statistics()
Initialize value traceability.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe
|
DataFrame
|
Input DataFrame with timeseries data. |
required |
station_uuids
|
Dict[str, str]
|
Mapping of UUID -> human-readable station name. e.g. {'uuid_abc': 'Station A', 'uuid_def': 'Station B'} |
required |
event_uuid
|
str
|
UUID to tag derived events with. |
'prod:value_trace'
|
value_column
|
str
|
Column holding the identifier string value. |
'value_string'
|
time_column
|
str
|
Name of timestamp column. |
'systime'
|
build_timeline ¤
build_timeline() -> pd.DataFrame
Build a full timeline of every identifier at every station.
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with columns: |
DataFrame
|
|
DataFrame
|
|
DataFrame
|
|
DataFrame
|
|
DataFrame
|
|
DataFrame
|
|
DataFrame
|
|
DataFrame
|
|
DataFrame
|
|
lead_time ¤
lead_time() -> pd.DataFrame
Compute end-to-end lead time per identifier.
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with columns: |
DataFrame
|
|
DataFrame
|
|
DataFrame
|
|
DataFrame
|
|
DataFrame
|
|
DataFrame
|
|
DataFrame
|
|
DataFrame
|
|
DataFrame
|
|
current_status ¤
current_status() -> pd.DataFrame
Determine the last-known station for each identifier.
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with columns: |
DataFrame
|
|
DataFrame
|
|
DataFrame
|
|
DataFrame
|
|
DataFrame
|
|
DataFrame
|
|
station_dwell_statistics ¤
station_dwell_statistics() -> pd.DataFrame
Compute dwell-time statistics per station (across all identifiers).
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with columns: |
DataFrame
|
|
DataFrame
|
|
DataFrame
|
|
DataFrame
|
|
DataFrame
|
|
DataFrame
|
|
DataFrame
|
|