EventHook

class selene_sim.EventHook

A base class for configuring events to be sent by Selene, detecting related events in the results stream, and handling them.

__abstractmethods__ = frozenset({'get_selene_flags', 'on_new_shot', 'try_invoke'})
abstractmethod get_selene_flags() list[str]

Define any arguments to the Selene executable that are required to enable the output of information pertinent to this EventHook.

For example, if Selene has a flag –provide-foo that enables emitting [(‘FOO:VALUE’, value)] events to the result stream, this method should return [’–provide-foo’].

abstractmethod on_new_shot() None

If this EventHook stores information on a shot-by-shot basis, implement this method to handle the creation of a new shot.

abstractmethod try_invoke(tag: str, data: list) bool

Check the tag to see if it is relevant to this EventHook. If so, parse the data and return True.