orbit.bunch_utils.serialize#
Functions
|
A simple typed namespace. |
|
Collects attributes from a PyOrbit Bunch across all MPI ranks and returns it as a dictionary. :param bunch: The PyOrbit::Bunch object from which to collect attributes. :type bunch: Bunch :param output_dir: The director to use for temporary storage of the bunch coordinates on each MPI rank. If None, the bunch will be stored in "/tmp". Note: take care that the temporary files are created in a directory where all MPI ranks have write access. :type output_dir: str | pathlib.Path, optional :param return_memmap: Return the bunch coordinates as a memory-mapped NumPy array, otherwise the entire array is copied into RAM and returned as normal NDArray. Default is True. :type return_memmap: bool, optional. |
|
Loads the bunch attributes from a specified directory containing NumPy binary files. :param input_dir: The directory from which to load the bunch data files. :type input_dir: str | pathlib.Path :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. |
|
Saves the collected bunch attributes to a specified directory. |
Classes
|
Special type indicating an unconstrained type. |
|
The Bunch python wrapper |
|
|
|
Protocol for file handlers to read/write bunch data. |
|
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. |
|
Base class for protocol classes. |
|