Changeset 16bc3fc in sasmodels


Ignore:
Timestamp:
Feb 19, 2015 11:00:19 AM (10 years ago)
Author:
pkienzle
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
6edb74a
Parents:
8632a35
Message:

fix direct model evaluation to use default value if parameter value is not given

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/direct_model.py

    rae7b97b r16bc3fc  
    4646    limits = kernel.info['limits'] 
    4747    disperser = pars.get(name+'_pd_type', 'gaussian') 
    48     value = pars.get(name) 
     48    value = pars.get(name, kernel.info['defaults'][name]) 
    4949    npts = pars.get(name+'_pd_n', 0) 
    5050    width = pars.get(name+'_pd', 0.0) 
     
    6767        q_vectors = [np.ascontiguousarray(q,dtype=dtype) for q in q_vectors] 
    6868        self.kernel = make_kernel(self.model, q_vectors) 
    69     def __call__(self, pars): 
     69    def __call__(self, **pars): 
    7070        return call_kernel(self.kernel, pars) 
    7171 
     
    9090                for pair in sys.argv[3:] 
    9191                for k,v in [pair.split('=')]) 
    92     Iq = model(pars) 
     92    Iq = model(**pars) 
    9393    print Iq[0] 
    9494 
Note: See TracChangeset for help on using the changeset viewer.