pynbody.snapshot.load

Contents

pynbody.snapshot.load#

pynbody.snapshot.load(filename, *args, **kwargs) SimSnap[source]#

Loads a file using the appropriate class, returning a SimSnap instance.

This routine is the main entry point for loading snapshots. It will try to load the file using the appropriate class, based on inspection by the candidate subclasses. If no class can load the file, an OSError is raised.

Parameters:
  • filename (str) – The filename to load

  • priority (optional, list[str | type]) – A list of SimSnap subclasses to try, in order. The first class which is capable of loading the file is used. If not specified, the ordering is as specified in the configuration files.

  • *args – Other arguments and keyword arguments are passed to the class constructor that is used to load the file.

  • **kwargs – Other arguments and keyword arguments are passed to the class constructor that is used to load the file.

Returns:

The loaded snapshot

Return type:

SimSnap