ts_shape.eventlog.taxonomy
Per-method label rules — the source of truth for ocel:activity names.
Every public DataFrame-returning method on every detector class under
ts_shape.events.* must have an entry here. The coverage test
tests/eventlog/test_adapter_coverage.py enforces this.
A :class:LabelRule describes:
template— theocel:activityvalue. May contain{field}placeholders that get substituted from legacy DataFrame columns.pack— one ofquality,production,engineering,maintenance,supplychain,energy,correlation,development.shape— how to interpret each legacy row:"point"→ single-timestamp event; requiressystime,"interval"→ requiresstartandendcolumns,"summary"→ a windowed/aggregate row; requiresstartandend(the event is stamped atend),"static"→ no time semantics; stamped with thetimestamppassed to :func:~ts_shape.eventlog.to_event_log(default: the Unix epoch).produces_objects— object types the adapter auto-extracts from the legacy DataFrame's standard columns (e.g.source_uuid -> asset). Callers can always attach additional contextual object types (batch, shift, operator, ...) via theobjects=argument to :func:~ts_shape.eventlog.to_event_log. Empty tuple means "no auto-extraction; objects only appear if the caller binds them".object_columns— for declared object types, the detector column that carries the oid (e.g.{"serial": "identifier", "station": "station_name"}for the traceability timelines). Used when the caller does not bind that type; likesource_uuid -> assetthe binding is not part of the event id (the column already is). A tuple of columns links each row to the oid of every column (e.g.{"station": ("from_station", "to_station")}); an oid named twice links once.eid_omit— frame columns left out of the event id: columns appended to a detector after its ids were fixed that repeat a column already in the id (thesource_uuidof theMultiProcessTraceabilityEventsframes), so existing ids stay the same.
| Name | Description |
|---|---|
LabelRule | How one detector method's output maps onto OCEL events. |
| Name | Description |
|---|---|
resolve | Map a deprecated class / method name to its current name. |
get | Look up the label rule registered for a detector method. |
template_fields | Names of the {field} placeholders in an activity template. |
render_activity | Substitute {field} placeholders in rule.template from row. |
LabelRule
LabelRule(
template: str,
pack: str,
shape: str = "point",
produces_objects: tuple[str, ...] = ("asset",),
severity_field: str | None = None,
value_field: str | None = None,
drop_fields: tuple[str, ...] = (),
standard_attrs: Mapping[str, object] = dict(),
severity_thresholds: tuple[float, float] | None = None,
object_columns: Mapping[str, str | tuple[str, ...]] = dict(),
eid_omit: tuple[str, ...] = (),
) -> None
How one detector method's output maps onto OCEL events.
See the module docstring for the meaning of template, pack,
shape, and produces_objects. severity_field and
value_field name legacy columns read into the severity and value
attributes, drop_fields lists legacy columns to discard, and
standard_attrs maps standard attribute keys to a legacy column name
or a literal value. object_columns maps a declared object type to the
column that carries its oid (or a tuple of such columns). severity_thresholds is the (warn, critical)
pair of lower bounds that buckets a numeric severity score into
warn / critical (below warn is info); None uses the
z-score bounds (3.0, 4.5).
resolve
resolve(class_name: str, method_name: str) -> tuple[str, str]
Map a deprecated class / method name to its current name.
Current names pass through unchanged, so callers can always resolve before looking up the registry.
get
get(class_name: str, method_name: str) -> LabelRule | None
Look up the label rule registered for a detector method.
Deprecated class and method names resolve to their current names.
| Name | Type | Description | Default |
|---|---|---|---|
class_name | str | Name of the detector class, e.g. "LeadTimeAnalysisEvents". | required |
method_name | str | Name of the method on that class. | required |
| Type | Description |
|---|---|
LabelRule | None | The matching LabelRule, or None if no rule is registered. |
template_fields
template_fields(template: str) -> list[str]
Names of the {field} placeholders in an activity template.
render_activity
render_activity(rule: LabelRule, row: Mapping[str, object]) -> str
Substitute {field} placeholders in rule.template from row.
Missing fields and missing values (None, NaN, <NA>) render as
unknown rather than raising — adapters should not crash on partial
input data.
| Name | Type | Description | Default |
|---|---|---|---|
rule | LabelRule | The label rule whose template is rendered. | required |
row | Mapping[str, object] | One detector-frame row (a mapping or a pd.Series). | required |
| Type | Description |
|---|---|
str | The activity name. |