sncosmo.register(instance, name=None, data_class=None, force=False)[source]

Register a class instance.


The object to be registered.

namestr, optional

Identifier. If None, the name is taken from the name attribute of the instance, if it exists and is a string.

data_classclassobj, optional

If given, the instance is registered as an instance of this class rather the the class of the instance itself. Use this for registering subclasses when you wish them to be accessible from their superclass.

forcebool, optional

Whether to override any existing instance of the same name. Note: this may not play well with versioned instances.