salvus.project.components.event_component
Classes
EventComponent
EventComponentclass EventComponent(builtins.object):
def __init__(self, project: Project, path: pathlib.Path):
...Project subclass handling all things related to the events.
projectProject — The project for the component.pathpathlib.Path — The event path in the project.
add()
add()def add(
self,
e: Union[
salvus.flow.collections.event.Event,
salvus.flow.collections.event_collection.EventCollection,
str,
pathlib.Path,
salvus.flow.collections.event_block.EventBlockCollection,
],
check_consistency_with_domain: bool = True,
) -> None:
...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.
eUnion[salvus.flow.collections.event.Event, salvus.flow.collections.event_collection.EventCollection, str, pathlib.Path, salvus.flow.collections.event_block.EventBlockCollection] — Event, EventCollection, or an event block representation to be added.check_consistency_with_domainbool — Ensure that the entity is compatible with the simulation domain.
delete()
delete()def delete(self, event_name: str) -> None:
...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.
event_namestr — Name of the event to be deleted.
exists()
exists()def exists(self, event_name: str) -> bool:
...Determine if the specified event exists within the project.
event_namestr — The name of the event.
True or False.get()
get()def get(self, event_name: str) -> salvus.flow.collections.event.Event:
...Get an event.
event_namestr — Name of the event.
get_all()
get_all()def get_all(self) -> salvus.flow.collections.event_collection.EventCollection:
...Get all events.
list()
list()def list(self) -> List[str]:
...Get a list of all events.
update()
update()def update(self, e: salvus.flow.collections.event.Event) -> None:
...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.
esalvus.flow.collections.event.Event — Event to be updated.