ts_shape.eventlog.lambda_rules.detector
LambdaDetector — the runtime object produced by register_lambda_rule.
A LambdaDetector is the lambda-rule counterpart of the 290 built-in
detector classes under ts_shape.events.*. It does not subclass any
of them — instead it implements the same conceptual contract:
evaluate(df)returns a detector frame (the layout a built-in detector returns).to_event_log(df, ...)runs the evaluator and hands the result to the canonical :func:~ts_shape.eventlog.to_event_logdispatcher.
Because the spec is registered in :data:ts_shape.eventlog.taxonomy.REGISTRY
at registration time, to_event_log finds it without any new code path.
| Name | Description |
|---|---|
LambdaDetector | Runnable form of a :class:RuleSpec. |
LambdaDetector
LambdaDetector(spec: RuleSpec) -> None
Runnable form of a :class:RuleSpec.
| Name | Description |
|---|---|
evaluate | Apply the rule to dataframe and return a detector frame. |
to_event_log | Evaluate the rule on dataframe and normalize the result to an event log. |
| Name | Type | Description | Default |
|---|---|---|---|
spec | RuleSpec | Rule spec whose trigger expression the detector evaluates. | required |
evaluate
evaluate(dataframe: pd.DataFrame) -> pd.DataFrame
Apply the rule to dataframe and return a detector frame.
| Name | Type | Description | Default |
|---|---|---|---|
dataframe | DataFrame | Input DataFrame the rule's trigger expression is evaluated on. | required |
| Type | Description |
|---|---|
DataFrame | Detector frame whose layout depends on the rule's shape |
DataFrame | (see :func:~ts_shape.eventlog.lambda_rules.evaluator.evaluate). |
to_event_log
to_event_log(
dataframe: pd.DataFrame,
*,
objects: Mapping[str, object] | None = None,
qualifiers: Mapping[str, str] | None = None
) -> EventLog
Evaluate the rule on dataframe and normalize the result to an event log.
| Name | Type | Description | Default |
|---|---|---|---|
dataframe | DataFrame | Input DataFrame the rule is evaluated on. | required |
objects | Mapping[str, object] | None | Optional OCEL object bindings, mapping an object type to a column name, callable, Series or scalar; passed through to :func:~ts_shape.eventlog.to_event_log. None uses only the auto-extracted objects. | None |
qualifiers | Mapping[str, str] | None | Optional mapping of object type to the relation qualifier written for that type. None leaves qualifiers empty. | None |
A rule that is not registered (built directly from a :class:RuleSpec
rather than with :func:register_lambda_rule) is labelled from its
own spec for this call; the global taxonomy is left as it is.
| Type | Description |
|---|---|
EventLog | The canonical :class:~ts_shape.eventlog.model.EventLog. |