metawards.utils.extract

metawards.utils.extract(network: metawards._network.Network, population: metawards._population.Population, workspace: metawards._workspace.Workspace, output_dir: metawards._outputfiles.OutputFiles, infections: metawards._infections.Infections, rngs, get_output_functions, nthreads: int, profiler: metawards.utils._profiler.Profiler = None)[source]

Extract data from the network and write this to the specified output directory. Like iterate() this uses a dynamic set of functions that can be utilised to customise what is output dynamically throughout the model run.

Parameters:
  • network (Network) – The network over which the model is being run
  • population (Population) – The population experiencing the model outbreak
  • workspace (Workspace) – A scratch-space that can be used to accumulate data while it is being extracted
  • output_dir (OutputFiles) – The output directory to which to write all files
  • infections (Infections) – Space to hold all of the infections
  • rngs – Thread-safe random number generators (one per thread)
  • get_output_functions – A function that should return the list of output functions that are called in sequence to write the output data. See extract_default() for an example of a suitable function
  • nthreads (int) – The number of threads over which to parallelise extracting the output
  • profiler (Profiler) – The profiler used to profile extracting the output