Version:

salvus.flow.collections.event_collection

salvus.flow.collections.event_collection salvus flow collections event_collection
Event collection object.

Functions

get_list_of_event_names()

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.
SIGNATURE
def get_list_of_event_names(
    events: (
        str
        | typing.Sequence[str]
        | Event
        | typing.Sequence[Event]
        | EventCollection
    ),
) -> list[str]: ...
ARGUMENTS
Required
events
Type:str | typing.Sequence[str] | Event | typing.Sequence[Event] | EventCollection
Description:
The things to turn into a list of events.
RETURNS
Return type: list[str]

Classes

EventCollection

A list of events.
SIGNATURE
class EventCollection(builtins.object):
    def __init__(self, events: list[Event]): ...
ARGUMENTS
Required
events
Type:list[Event]
Description:
List of events.

Class Methods

EventCollection.from_sources()
Create an event collection object from a list of sources. The receivers will be copied to every event.
SIGNATURE
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: ...
ARGUMENTS
Required
sources
Type:collections.abc.Iterable[simple_config.source._Base] | simple_config.source._Base
Description:
List of sources.
Optional
receivers
Type:collections.abc.Iterable[simple_config.receiver._Base] | simple_config.receiver._Base | None
Default value:None
Description:
List of receivers.
Optional
receiver_channels
Type:collections.abc.Iterable[ReceiverChannel] | ReceiverChannel | None
Default value:None
Description:
List of receiver channels.
Optional
event_name_starting_index
Type:int
Default value:0
Description:
Events will be named f"{event_name_prefix}_{i:04}" where i is the event index. You can change the starting index here.
Optional
event_name_prefix
Type:str
Default value:'event'
Description:
Events will be named f"{event_name_prefix}_{i:04}" where i is the event index. You can change the prefix here.
PAGE CONTENTS