emodpy.generic.serialization module

emodpy.generic.serialization.enable_serialization(task: EMODTask, use_absolute_times: bool = False)[source]

Enable serialization etierh by TIME or TIMESTEP based on use_absolute_times :param task: Task to enable :param use_absolute_times: When true, Serialization_Type will be set to TIME, otherwise it will be set to :param *TIMESTEP*:

Returns:

emodpy.generic.serialization.add_serialization_timesteps(task: EMODTask, timesteps: List[int], end_at_final: bool = False, use_absolute_times: bool = False)[source]

Serialize the population of this simulation at specified time steps.

If the simulation is run on multiple cores, multiple files will be created.

Parameters:
  • task (EMODTask) – An EMODSimulation

  • timesteps (List[int]) – Array of integers representing the time steps to use

  • end_at_final (bool) – False means set the simulation duration such that the last serialized_population file ends the simulation. NOTE- may not work if time step size is not 1

  • use_absolute_times (bool) – False means the method will define simulation times instead of time steps see documentation on Serialization_Type for details

Returns:

None

emodpy.generic.serialization.load_serialized_population(task: EMODTask, population_path: str, population_filenames: List[str])[source]

Sets simulation to load a serialized population from the filesystem

Parameters:
  • task (EMODTask) – An EMODSimulation

  • population_path (str) – relative path from the working directory to the location of the serialized population files.

  • population_filenames (List[str]) – names of files in question

Returns:

None