- class glue.config.DataFactoryRegistry¶
Stores data factories. Data factories take filenames as input, and return
The members property returns a list of (function, label, identifier, priority) namedtuples:
Function is the factory that creates the data object
label is a short human-readable description of the factory
identifier is a function that takes
(filename, **kwargs)as input and returns True if the factory can open the file
priority is a numerical value that indicates how confident the data factory is that it should read the data, relative to other data factories. For example, a highly specialized FITS reader for specific FITS file types can be given a higher priority than the generic FITS reader in order to take precedence over it.
New data factories can be registered via:
@data_factory('label_name', identifier=identifier, priority=10) def new_factory(file_name): ...
If not specified, the priority defaults to 0.
__call__(label[, identifier, priority, ...])
This is provided so that registry instances can be used as decorators.
- __call__(label, identifier=None, priority=None, default='', deprecated=False)¶
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