Changeset edb0f85 in sasmodels


Ignore:
Timestamp:
Nov 2, 2017 1:47:06 PM (7 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
3a45c2c
Parents:
ee95012
Message:

tweak implementation of sld profile for product models

Location:
sasmodels
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/product.py

    ree95012 redb0f85  
    103103    model_info.hidden = p_info.hidden 
    104104    if getattr(p_info, 'profile', None) is not None: 
     105        profile_pars = set(p.id for p in p_info.parameters.kernel_parameters) 
    105106        def profile(**kwargs): 
    106             list_params = [p.name.split('[')[0] for p in p_info.parameters.kernel_parameters] 
    107             form_factor_args = dict((k, v) for k, v in kwargs.items() if k in list_params)             
    108             return p_info.profile(**form_factor_args) 
     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) 
    109110    else: 
    110111        profile = None 
    111112    model_info.profile = profile 
    112113    model_info.profile_axes = p_info.profile_axes 
    113      
     114 
    114115    # TODO: delegate random to p_info, s_info 
    115116    #model_info.random = lambda: {} 
  • sasmodels/sasview_model.py

    r1f35235 redb0f85  
    205205                                           structure_factor._model_info) 
    206206    ConstructedModel = make_model_from_info(model_info) 
    207     return ConstructedModel(form_factor.multiplicity)     
     207    return ConstructedModel(form_factor.multiplicity) 
    208208 
    209209 
Note: See TracChangeset for help on using the changeset viewer.