orbit.bunch_utils#

Functions#

collect_bunch(bunch[, output_dir, return_memmap])

Collects attributes from a PyOrbit Bunch across all MPI ranks and returns it as a dictionary.

save_bunch(bunch[, output_dir, Handler])

Saves the collected bunch attributes to a specified directory.

load_bunch(input_dir[, Handler])

Loads the bunch attributes from a specified directory containing NumPy binary files. :type input_dir: str | Path :param input_dir: The directory from which to load the bunch data files. :type input_dir: str | pathlib.Path :type Handler: type[FileHandler] :param Handler: The file handler class to use for reading the bunch data. Default is NumPyHandler. See orbit.bunch_utils.file_handler for available handlers. :type Handler: FileHandler, optional.

Classes#

ParticleIdNumber()

This routine adds id numbers to particle in a bunch.

BunchDict

FileHandler(*args, **kwargs)

Protocol for file handlers to read/write bunch data.

NumPyHandler(dir_name)

Handler implementing the FileHandler protocol for NumPy binary files. This handler will create two files in the directory passed to the constructor: - coords.npy: A memory-mapped NumPy array containing the bunch coordinates. - attributes.npz: A NumPy archive containing data related to the synchronous particle and other bunch attributes.

Class Inheritance Diagram#

Inheritance diagram of orbit.bunch_utils.particleidnumber.ParticleIdNumber, orbit.bunch_utils.serialize.BunchDict, orbit.bunch_utils.serialize.FileHandler, orbit.bunch_utils.serialize.NumPyHandler