Mondaic

salvus.flow.collections.event_collection

salvus.flow.collections.event_collection salvus flow collections event_collection

Event collection object.

Functions

get_list_of_event_names()

def get_list_of_event_names(
    events: (
        str
        | typing.Sequence[str]
        | Event
        | typing.Sequence[Event]
        | EventCollection
    ),
) -> list[str]: ...

Helper function extracting the list of event names from a series of events or similar data structures.

Note that the output will be sorted sorted alphabetically, i.e., the order of the events is not necessarily preserved.

Parameters
  • events str | typing.Sequence[str] | Event | typing.Sequence[Event] | EventCollection — The things to turn into a list of events.
Returns list[str]

Classes

EventCollection

class EventCollection(builtins.object):
    def __init__(self, events: list[Event]): ...

A list of events.

Parameters
  • events list[Event] — List of events.
Methods
from_sources()
def from_sources(
    sources: (
        collections.abc.Iterable[simple_config.source._Base]
        | simple_config.source._Base
    ),
    receivers: (
        collections.abc.Iterable[simple_config.receiver._Base]
        | simple_config.receiver._Base
        | None
    ) = None,
    receiver_channels: (
        collections.abc.Iterable[ReceiverChannel] | ReceiverChannel | None
    ) = None,
    event_name_starting_index: int = 0,
    event_name_prefix: str = "event",
) -> EventCollection: ...

Create an event collection object from a list of sources. The receivers will be copied to every event.

Parameters
  • sources collections.abc.Iterable[simple_config.source._Base] | simple_config.source._Base — List of sources.
  • receivers collections.abc.Iterable[simple_config.receiver._Base] | simple_config.receiver._Base | None — List of receivers.
  • receiver_channels collections.abc.Iterable[ReceiverChannel] | ReceiverChannel | None — List of receiver channels.
  • event_name_starting_index int — Events will be named f”{event_name_prefix}_{i:04}” where i is the event index. You can change the starting index here.
  • event_name_prefix str — Events will be named f”{event_name_prefix}_{i:04}” where i is the event index. You can change the prefix here.
Returns EventCollection

Used in tutorials