save_bunch#
- orbit.bunch_utils.save_bunch(bunch, output_dir='bunch_data/', Handler=<class 'orbit.bunch_utils.serialize.NumPyHandler'>)[source]#
Saves the collected bunch attributes to a specified directory. :param bunch_dict: The PyOrbit::Bunch object or the dictionary containing the collected bunch attributes. :type bunch_dict: Bunch | BunchDict :type output_dir:
str|Path:param output_dir: The directory where the bunch data files will be saved. Default is “bunch_data/”. :type output_dir: str, optional :type Handler:type[FileHandler] :param Handler: The file handler class to use for writing the bunch data. Default is NumPyHandler. :type Handler: FileHandler, optional- Return type
None
- Raises
ValueError – If the provided bunch is neither a Bunch instance nor a BunchDict.
- Parameters
bunch (Bunch | orbit.bunch_utils.serialize.BunchDict) –
output_dir (str | pathlib._local.Path) –
Handler (type[orbit.bunch_utils.serialize.FileHandler]) –