Iterations Component

LASIF projects are organized into iterations and this component deals with creating, modifying or deleting iterations. Any information regarding the iterations, can be accessed via this component.


class lasif.components.iterations.IterationsComponent(communicator, component_name)[source]

Component dealing with the iterations of the project. Mostly an organizational component.

  • communicator – The communicator instance.

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

get_long_iteration_name(iteration_name: str)[source]

Returns the long form of an iteration from its short or long name.

>>> comm = getfixture('iterations_comm')
>>> comm.iterations.get_long_iteration_name("1")

iteration_name (str) – Name of iteration

has_iteration(iteration_name: str)[source]

Checks for existance of an iteration


iteration_name (str) – Name of iteration


Returns a list of all the iterations known to LASIF.

setup_directories_for_iteration(iteration_name: str, events: List[str], remove_dirs: bool = False, event_specific: bool = False)[source]

Sets up the directory structure required for the iteration

  • iteration_name (str) – The iteration for which to create the folders.

  • events (List[str]) – which events are in the iteration

  • remove_dirs (bool, optional) – Boolean if set to True the iteration is removed, defaults to False

  • event_specific (bool, optional) – Will create specific folder for each model if inversion uses event specific meshes, defaults to False

setup_events_toml(iteration_name: str, events: List[str])[source]

Writes all events into a toml file. User can modify this if he wishes to use less events for this specific iteration. Lasif should be smart enough to know which events were used in which iteration.

  • iteration_name (str) – Name of iteration

  • events (List[str]) – List of events to include

setup_iteration_toml(iteration_name: str)[source]

Sets up a toml file which can be used to keep track of needed information related to the iteration. It can be used to specify which events to use and it can remember which input parameters were used.


iteration_name (str) – The iteration for which to create the folders.

write_info_toml(iteration_name: str, simulation_type: str)[source]

Write a toml file to store information related to how the important config settings were when input files were generated. This will create a new file when forward input files are generated.

  • iteration_name (str) – The iteration for which to write into toml

  • simulation_type (str) – The type of simulation.