Version:

salvus.project.components.event_component

salvus.project.components.event_component salvus project components event_component
The event component.

Classes

EventComponent

Project subclass handling all things related to the events.
SIGNATURE
class EventComponent(builtins.object):
    def __init__(self, project: Project, path: pathlib.Path): ...
ARGUMENTS
Required
project
Type:Project
Description:
The project for the component.
Required
path
Type:pathlib.Path
Description:
The event path in the project.

Methods

EventComponent.add()
Adds an event or event collection object to the project.
Might not be supported for all event backends and not every backend can add all types of event representations.
SIGNATURE
def add(
    self,
    e: Event | EventCollection | EventBlockCollection | str | pathlib.Path,
    check_consistency_with_domain: bool = True,
) -> None: ...
ARGUMENTS
Required
e
Type:Event | EventCollection | EventBlockCollection | str | pathlib.Path
Description:
Event, EventCollection, or an event block representation to be added.
Optional
check_consistency_with_domain
Type:bool
Default value:True
Description:
Ensure that the entity is compatible with the simulation domain.
EventComponent.delete()
Delete an event.
Might not be supported for all backends.
Fully delete all data and what not from the chosen event. Be careful as there is no other prompt and calling this function will irrevocably delete all data for the chosen event.
SIGNATURE
def delete(self, event_name: str) -> None: ...
ARGUMENTS
Required
event_name
Type:str
Description:
Name of the event to be deleted.
EventComponent.exists()
Determine if the specified event exists within the project.
SIGNATURE
def exists(self, event_name: str) -> bool: ...
ARGUMENTS
Required
event_name
Type:str
Description:
The name of the event.
EventComponent.get()
Get an event.
SIGNATURE
def get(self, event_name: str) -> Event: ...
ARGUMENTS
Required
event_name
Type:str
Description:
Name of the event.
EventComponent.get_all()
Get all events.
SIGNATURE
def get_all(self) -> EventCollection: ...
EventComponent.list()
Get a list of all events.
SIGNATURE
def list(self) -> list[str]: ...
EventComponent.update()
Special function updating a single event.
This is different deleting and re-adding an event in that all associated data will be retained. Please be aware of of the consequences and that it is not always advisable to change existing data in a project.
SIGNATURE
def update(self, e: Event) -> None: ...
ARGUMENTS
Required
e
Type:Event
Description:
Event to be updated.
PAGE CONTENTS