def __init__(self, modelstr, varmap, registry={}):
        """
        An abstraction for defining how to combine components into a complete
        model as well as derivatives with respect to different variables.

        Parameters
        -----------
        modelstr : dict of strings
            (Using a custom model) The actual equations used to defined the model.
            At least one eq. is required under the key `full`. Other partial
            update equations can be added where the variable name (e.g. 'dI')
            denotes a partial update of I, for example::

                {'full': 'H(P)', 'dP': 'H(dP)'}

        varmap : dict
            (Using a custom model) The mapping of variables in the modelstr
            equations to actual component types. For example::

                {'P': 'obj', 'H': 'psf'}

        registry : dict
            A mapping of categories to components which this model will
            accept. For example::

                {
                    'obj': [objs.PlatonicSpheresCollection],
                    'psf': [psfs.Gaussian4DPoly, psfs.GaussianMomentExpansion]
                }
        """
        self.modelstr = modelstr
        self.varmap = varmap
        self.registry = registry
        self.ivarmap = {v:k for k, v in iteritems(self.varmap)}
        self.check_consistency()
def __init__ ( self , modelstr , varmap , registry = { } ) : self . modelstr = modelstr self . varmap = varmap self . registry = registry self . ivarmap = { v : k for k , v in iteritems ( self . varmap ) } self . check_consistency ( )
An abstraction for defining how to combine components into a complete
        model as well as derivatives with respect to different variables.

        Parameters
        -----------
        modelstr : dict of strings
            (Using a custom model) The actual equations used to defined the model.
            At least one eq. is required under the key `full`. Other partial
            update equations can be added where the variable name (e.g. 'dI')
            denotes a partial update of I, for example::

                {'full': 'H(P)', 'dP': 'H(dP)'}

        varmap : dict
            (Using a custom model) The mapping of variables in the modelstr
            equations to actual component types. For example::

                {'P': 'obj', 'H': 'psf'}

        registry : dict
            A mapping of categories to components which this model will
            accept. For example::

                {
                    'obj': [objs.PlatonicSpheresCollection],
                    'psf': [psfs.Gaussian4DPoly, psfs.GaussianMomentExpansion]
                }