pynbody.snapshot.identify

Contents

pynbody.snapshot.identify#

pynbody.snapshot.identify(filename, priority=None, **kwargs) → type[SimSnap] | None[source]#

Return the SimSnap subclass that load() would use for the specified file, without loading it.

Added in version 2.8.0.

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

  • priority (optional, list[str | type]) – As for load()

  • **kwargs – Keyword arguments that would be passed to load(). Those which can affect whether a given class is able to load the file (such as remote_dir) are taken into account; others (such as take) are ignored.

Returns:

The class that would be used, or None if no class can load the file

Return type:

type[SimSnap] | None