MethodRegister#

class mrinufft._utils.MethodRegister(register_name: str, docstring_subs: dict[str, str] | None = None)[source]#

Bases: object

A Decorator to register methods of the same type in dictionnaries.

Parameters:
  • name (str) – The register name

  • docstring_sub (dict[str,str]) – List of potential subsititutions to apply to the docstring.

Methods

__init__

make_getter

Create a get_{register_name} function to get methods from the registry.

Attributes

registry

Get the registry dictionary.

registry_global

__call__(method_name=None)[source]#

Register the function in the registry.

It also substitute placeholder in docstrings.

make_getter() Callable[source]#

Create a get_{register_name} function to get methods from the registry.

Return type:

Callable

property registry[source]#

Get the registry dictionary.