Events Component

The Events component takes care of event information and has methods to find out all sorts of information regarding the events in the project.

Contents:

class lasif.components.events.EventsComponent(folder, communicator, component_name)[source]

Component managing a folder of QuakeML files.

Each file must adhere to the scheme *.xml.

Parameters
  • folder – Folder with QuakeML files.

  • communicator – The communicator instance.

  • component_name – The name of this component for the communicator.

count(iteration: Optional[str] = None)[source]

Get the number of events managed by this component. If iteration given, return number of events in iteration

>>> comm = getfixture('events_comm')
>>> comm.events.count()
2
Parameters

iteration (str, optional) – Name of iteration, defaults to None

get(event_name: str)dict[source]

Get information about one event. This function uses multiple cache layers and is thus very cheap to call. :param event_name: The name of the event. :type event_name: str :rtype: dict

get_all_events(iteration: Optional[str] = None)dict[source]

Returns a dictionary with the key being the event names and the values the information about each event, as would be returned by the get() method.

Parameters

iteration (str, optional) – Name of iteration, defaults to None

Returns

Dictonary with keys as event names and information as values

Return type

dict

has_event(event_name: str)[source]

Test for existence of an event.

Parameters

event_name (str) – The name of the event.

list(iteration: Optional[str] = None)[source]

List of all events. >>> comm = getfixture(‘events_comm’) >>> comm.events.list() # doctest: +NORMALIZE_WHITESPACE [‘GCMT_event_TURKEY_Mag_5.1_2010-3-24-14-11’, ‘GCMT_event_TURKEY_Mag_5.9_2011-5-19-20-15’]

Parameters

iteration (str, optional) – Name of iteration, defaults to None