Fetch registration for database queries

cosmic.sample.sampler.sampler.get_sampler(data_format, data_class)

Return the sampler() function for the given format

Parameters

data_format : str

name of the format

data_class : type

the class that the sampler returns

Raises

astropy.io.registry.IORegistryError

if not registration is found matching data_format

cosmic.sample.sampler.sampler.register_sampler(data_format, data_class, function, force=False, usage=None)

Register a new method to InitialBinaryTable.sampler() for a given format

Parameters

data_format : str

name of the format to be registered

data_class : type

the class that the sampler returns

function : callable

the method to call from InitialBinaryTable.sampler()

force : bool, optional

overwrite existing registration for data_format if found, default: False