LinkHelperRegistry

class glue.config.LinkHelperRegistry[source]

Bases: glue.config.Registry

Stores helper objects that compute many ComponentLinks at once

The members property is a list of (object, info_string, input_labels) tuples. Object is the link helper. info_string describes what object does. input_labels is a list labeling the inputs. category is a category in which the link function will appear (defaults to ‘General’).

Each link helper takes a list of ComponentIDs as inputs, and returns an iterable object (e.g. list) of ComponentLinks.

New helpers can be registered via

@link_helper(‘Links degrees and arcseconds in both directions’,

[‘degree’, ‘arcsecond’])

def new_helper(degree, arcsecond):
return [ComponentLink([degree], arcsecond, using=lambda d: d*3600),

ComponentLink([arcsecond], degree, using=lambda a: a/3600)]

Methods Summary

__call__(self, info, input_labels[, category])

This is provided so that registry instances can be used as decorators.

Methods Documentation

__call__(self, info, input_labels, category='General')[source]

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