normalizer
normalizer ¤
Public to_event_log entry point — looks up the adapter and runs it.
to_event_log ¤
to_event_log(
dataframe: DataFrame,
*,
detector: str,
objects: Mapping[str, object] | None = None,
qualifiers: Mapping[str, str] | None = None,
o2o: TableInput = None,
object_changes: TableInput = None,
validate: bool = True,
timestamp: object | None = None
) -> EventLog
Normalize a detector frame (a detector's output DataFrame) into the canonical event log.
Timestamps: tz-aware times are converted to UTC; naive times are taken
to be UTC (localize them first if they are local wall-clock times).
Interval rows that end before they start are dropped with a
:class:~ts_shape.errors.DataQualityWarning.
Event ids (ocel:eid) are content-based: a hash of the detector, the
row's source_uuid, its timestamps, the activity and every other
column of the row. They are reproducible across runs, independent of
row order, and the same detector on two machines does not collide.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataframe
|
DataFrame
|
The detector frame. |
required |
detector
|
str
|
|
required |
objects
|
Mapping[str, object] | None
|
Binds OCEL object types to, per type:
Types listed in the rule's |
None
|
qualifiers
|
Mapping[str, str] | None
|
Relation qualifier per object type. |
None
|
o2o
|
TableInput
|
OCEL 2.0 object-to-object relations, a DataFrame or iterable of
dict rows with |
None
|
object_changes
|
TableInput
|
Time-varying object attributes with |
None
|
validate
|
bool
|
Check the result against the canonical schema. |
True
|
timestamp
|
object | None
|
Timestamp of the events of a |
None
|
Returns:
| Type | Description |
|---|---|
EventLog
|
The canonical :class: |
Raises:
| Type | Description |
|---|---|
ValueError
|
For a malformed |
KeyError
|
When the detector has no taxonomy entry, or the frame lacks the time columns of its shape. |