Changes in sasmodels/product.py [058460c:146793b] in sasmodels


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/product.py

    r058460c r146793b  
    100100    # Remember the component info blocks so we can build the model 
    101101    model_info.composition = ('product', [p_info, s_info]) 
     102    model_info.control = p_info.control 
     103    model_info.hidden = p_info.hidden 
     104    if getattr(p_info, 'profile', None) is not None: 
     105        profile_pars = set(p.id for p in p_info.parameters.kernel_parameters) 
     106        def profile(**kwargs): 
     107            # extract the profile args 
     108            kwargs = dict((k, v) for k, v in kwargs.items() if k in profile_pars) 
     109            return p_info.profile(**kwargs) 
     110    else: 
     111        profile = None 
     112    model_info.profile = profile 
     113    model_info.profile_axes = p_info.profile_axes 
     114 
    102115    # TODO: delegate random to p_info, s_info 
    103116    #model_info.random = lambda: {} 
     
    129142    def __init__(self, model_info, P, S): 
    130143        # type: (ModelInfo, KernelModel, KernelModel) -> None 
     144        #: Combined info plock for the product model 
    131145        self.info = model_info 
     146        #: Form factor modelling individual particles. 
    132147        self.P = P 
     148        #: Structure factor modelling interaction between particles. 
    133149        self.S = S 
    134         self.dtype = P.dtype 
     150        #: Model precision. This is not really relevant, since it is the 
     151        #: individual P and S models that control the effective dtype, 
     152        #: converting the q-vectors to the correct type when the kernels 
     153        #: for each are created. Ideally this should be set to the more 
     154        #: precise type to avoid loss of precision, but precision in q is 
     155        #: not critical (single is good enough for our purposes), so it just 
     156        #: uses the precision of the form factor. 
     157        self.dtype = P.dtype  # type: np.dtype 
    135158 
    136159    def make_kernel(self, q_vectors): 
Note: See TracChangeset for help on using the changeset viewer.