pynbody.util.iter_subclasses.IterableSubclasses#

class pynbody.util.iter_subclasses.IterableSubclasses[source]#

Bases: object

A mixin for classes where we need to be able to iterate over their subclasses, possibly in a user-specified order. This is used by HaloCatalogue and SimSnap to find a suitable loader for a given file.

Methods

iter_subclasses()

Iterate over all subclasses of this class, recursively.

iter_subclasses_with_priority(priority)

Iterate over all subclasses, starting with the given priorities

__init__(*args, **kwargs)#
classmethod iter_subclasses() Iterable[type][source]#

Iterate over all subclasses of this class, recursively.

This is used by HaloCatalogue and SimSnap to find a suitable loader for a given file.

classmethod iter_subclasses_with_priority(priority: Iterable[str | type]) Iterable[type][source]#

Iterate over all subclasses, starting with the given priorities

The priorities can be provided either as a string or a class