MethodRegister#

class mrinufft.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

registry_global = {'density': {'cell_count': <function cell_count>, 'pipe': <function pipe>, 'voronoi': <function voronoi>}, 'gradient_connection_solver': {'auto': <function _solve_auto>, 'lp': <function _solve_lp_1d>, 'lp-minslew': <function _solve_lp_1d>, 'osqp': <function _solve_qp_osqp>}, 'optimizer': {'cg': <function cg>, 'lsmr': <function lsmr>, 'lsqr': <function lsqr>}, 'orc_factorization': {'mfi': <function compute_mfi_coefficients>, 'mti': <function compute_mti_coefficients>, 'svd': <function compute_svd_coefficients>}, 'smaps': {'espirit': <function espirit>, 'low_frequency': <function low_frequency>}}[source]#
__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.