py21cmfast.outputs.PerturbHaloField.prepare

PerturbHaloField.prepare(flush: Optional[Sequence[str]] = None, keep: Optional[Sequence[str]] = None, force: bool = False)

Prepare the instance for being passed to another function.

This will flush all arrays in “flush” from memory, and ensure all arrays in “keep” are in memory. At least one of these must be provided. By default, the complement of the given parameter is all flushed/kept.

Parameters:
  • flush – Arrays to flush out of memory. Note that if no file is associated with this instance, these arrays will be lost forever.

  • keep – Arrays to keep or load into memory. Note that if these do not already exist, they will be loaded from file (if the file exists). Only one of flush and keep should be specified.

  • force – Whether to force flushing arrays even if no disk storage exists.