recpack.pipelines.registries.AlgorithmRegistry

class recpack.pipelines.registries.AlgorithmRegistry

Registry for easy retrieval of algorithm types by name.

The registry comes preregistered with all recpack algorithms.

Methods

get(key)

Retrieve the value for this key.

register(key, c)

Register a new Python type (most often a class).

get(key: str) type

Retrieve the value for this key. This value is a Python type (most often a class).

Parameters

key (str) – The key to fetch

Returns

The class type associated with the key

Return type

type

register(key: str, c: type)

Register a new Python type (most often a class).

After registration, the key can be used to fetch the Python type from the registry.

Parameters
  • key (str) – key to register the type at. Needs to be unique to the registry.

  • c (type) – class to register.