load_bunch#

orbit.bunch_utils.load_bunch(input_dir, Handler=<class 'orbit.bunch_utils.serialize.NumPyHandler'>)[source]#

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.

Returns

A dictionary containing the loaded bunch attributes.

Return type

BunchDict

Raises
  • FileNotFoundError – If the required files are not found in the specified directory.

  • TypeError – If an attribute in the loaded bunch has an unsupported type.

Parameters
  • input_dir (str | pathlib._local.Path) –

  • Handler (FileHandler, optional) –