Event Results¶
Classes for accessing and querying detected events after propagation.
DetectedEvent ¶
Information about a detected event.
Contains all information about an event that was detected during propagation, including timing, state, and event metadata.
Attributes:
| Name | Type | Description |
|---|---|---|
window_open | Epoch | Start time (entry for periods, event time for instantaneous) |
window_close | Epoch | End time (exit for periods, same as window_open for instantaneous) |
entry_state | ndarray | State vector at window_open |
exit_state | ndarray | State vector at window_close |
value | float | Event function value at detection |
name | str | Event detector name |
action | EventAction | Action taken (STOP or CONTINUE) |
event_type | EventType | Event type (INSTANTANEOUS or PERIOD) |
Example
Initialize instance.
action property ¶
action: EventAction
Action taken (STOP or CONTINUE).
Returns:
| Name | Type | Description |
|---|---|---|
EventAction | EventAction | Action taken after event detection |
event_type property ¶
event_type: EventType
Event type (INSTANTANEOUS or PERIOD).
Returns:
| Name | Type | Description |
|---|---|---|
EventType | EventType | Type of event |
window_close property ¶
window_close: Epoch
Window close time (exit for periods, same as window_open for instantaneous).
Returns:
| Name | Type | Description |
|---|---|---|
Epoch | Epoch | End time of the event |
window_open property ¶
window_open: Epoch
Window open time (entry for periods, event time for instantaneous).
Returns:
| Name | Type | Description |
|---|---|---|
Epoch | Epoch | Start time of the event |
EventQuery ¶
Event query builder for filtering detected events.
Provides chainable filter methods for querying events with an idiomatic Python interface. Filters are applied lazily and can be combined in any order.
Example
Initialize instance.
after method descriptor ¶
after(epoch: Epoch) -> EventQuery
Filter events after epoch (inclusive).
Returns events that occurred at or after the specified epoch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
epoch | Epoch | Epoch value (inclusive) | required |
Returns:
| Name | Type | Description |
|---|---|---|
EventQuery | EventQuery | New query with filter applied (for chaining) |
Example
before method descriptor ¶
before(epoch: Epoch) -> EventQuery
Filter events before epoch (inclusive).
Returns events that occurred at or before the specified epoch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
epoch | Epoch | Epoch value (inclusive) | required |
Returns:
| Name | Type | Description |
|---|---|---|
EventQuery | EventQuery | New query with filter applied (for chaining) |
Example
by_action method descriptor ¶
by_action(action: EventAction) -> EventQuery
Filter by event action.
Returns events with the specified action.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
action | EventAction | Event action to filter by (STOP or CONTINUE) | required |
Returns:
| Name | Type | Description |
|---|---|---|
EventQuery | EventQuery | New query with filter applied (for chaining) |
Example
by_detector_index method descriptor ¶
by_detector_index(index: int) -> EventQuery
Filter by detector index.
Returns events detected by the specified detector.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index | int | Detector index (0-based, corresponding to add order) | required |
Returns:
| Name | Type | Description |
|---|---|---|
EventQuery | EventQuery | New query with filter applied (for chaining) |
Example
by_event_type method descriptor ¶
by_event_type(event_type: EventType) -> EventQuery
Filter by event type.
Returns events of the specified type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event_type | EventType | Event type to filter by (INSTANTANEOUS or PERIOD) | required |
Returns:
| Name | Type | Description |
|---|---|---|
EventQuery | EventQuery | New query with filter applied (for chaining) |
Example
by_name_contains method descriptor ¶
by_name_contains(substring: str) -> EventQuery
Filter by detector name substring.
Returns events where the detector name contains the given substring.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
substring | str | Substring to search for in event names | required |
Returns:
| Name | Type | Description |
|---|---|---|
EventQuery | EventQuery | New query with filter applied (for chaining) |
Example
by_name_exact method descriptor ¶
by_name_exact(name: str) -> EventQuery
Filter by exact detector name.
Returns events where the detector name exactly matches the given string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name | str | Exact name to match | required |
Returns:
| Name | Type | Description |
|---|---|---|
EventQuery | EventQuery | New query with filter applied (for chaining) |
Example
collect method descriptor ¶
collect() -> list[DetectedEvent]
Collect filtered events into a list.
Returns:
| Type | Description |
|---|---|
list[DetectedEvent] | list[DetectedEvent]: List of events matching all applied filters |
first method descriptor ¶
first() -> DetectedEvent
Get the first matching event, if any.
Returns:
| Type | Description |
|---|---|
DetectedEvent | DetectedEvent or None: First event matching all filters, or None if empty |
in_time_range method descriptor ¶
in_time_range(start: Epoch, end: Epoch) -> EventQuery
Filter by time range (inclusive).
Returns events that occurred within the specified time range.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start | Epoch | Start of time range (inclusive) | required |
end | Epoch | End of time range (inclusive) | required |
Returns:
| Name | Type | Description |
|---|---|---|
EventQuery | EventQuery | New query with filter applied (for chaining) |
Example
is_empty method descriptor ¶
is_empty() -> bool
Check if the query is empty.
Returns:
| Name | Type | Description |
|---|---|---|
bool | bool | True if no events match all applied filters |
last method descriptor ¶
last() -> DetectedEvent
Get the last matching event, if any.
Returns:
| Type | Description |
|---|---|
DetectedEvent | DetectedEvent or None: Last event matching all filters, or None if empty |
Example
See Also¶
- Event Detectors - Core event detector classes
- Pre-made Events - Convenience event detectors
- Enumerations - EventType, EventAction, etc.