sncosmo.register_loader

sncosmo.register_loader(data_class, name, func, args=None, version=None, meta=None, force=False)[source]

Register a data reading function.

Parameters
data_classclassobj

The class of the object that the loader returns.

namestr

The data identifier.

funccallable

The function to read in the data. Must accept a name and version keyword argument.

argslist, optional

Arguments to pass to the function. Default is an empty list.

versionstr, optional

Sub-version of name, if desired. Use formats such as '1', '1.0', '1.0.0', etc. Default is None.

forcebool, optional

Whether to override any existing function if already present.

metadict, optional

Metadata describing this loader. Default is an empty dictionary.