LinkFunctionRegistry#
- class glue.config.LinkFunctionRegistry#
Bases:
RegistryStores functions to convert between quantities
The members property is a list of (function, info_string, output_labels) namedtuples.
info_stringdescribes what the function does.output_labelsis a list of names for each output.categoryis a category in which the link function will appear (defaults to ‘General’).New link functions can be registered via
- @link_function(info=”maps degrees to arcseconds”,
output_labels=[‘arcsec’])
- def degrees2arcsec(degrees):
return degrees * 3600
Link functions are expected to receive and return numpy arrays
Methods Summary
__call__([info, output_labels, category])This is provided so that registry instances can be used as decorators.
Methods Documentation
- __call__(info='', output_labels=None, category='General')#
This is provided so that registry instances can be used as decorators. The decorators should add the decorated code object to the registry, and return the original function