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.
- Parameters:
bunch_dict (Bunch | BunchDict) – The PyOrbit::Bunch object or the dictionary containing the collected bunch attributes.
output_dir (str, optional) – The directory where the bunch data files will be saved (default: “bunch_data/”).
Handler (FileHandler, optional) – The file handler class to use for writing the bunch data (default: NumPyHandler).
bunch (Bunch | BunchDict)
- Return type:
None
- Raises:
ValueError – If the provided bunch is neither a Bunch instance nor a BunchDict.