Changeset 6d6508e in sasmodels for sasmodels/kerneldll.py


Ignore:
Timestamp:
Apr 7, 2016 6:57:33 PM (8 years ago)
Author:
Paul Kienzle <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:
d2fc9a4
Parents:
3707eee
Message:

refactor model_info from dictionary to class

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/kerneldll.py

    r1e2a1ba r6d6508e  
    5555 
    5656from . import generate 
     57from . import details 
    5758from .kernelpy import PyInput, PyModel 
    5859from .exception import annotate_exception 
     
    9596    """ 
    9697    bits = 8*dtype.itemsize 
    97     return "sas_%s%d"%(model_info['id'], bits) 
     98    return "sas_%s%d"%(model_info.id, bits) 
    9899 
    99100def dll_path(model_info, dtype): 
     
    123124    models are allowed as DLLs. 
    124125    """ 
    125     if callable(model_info.get('Iq', None)): 
     126    if callable(model_info.Iq): 
    126127        return PyModel(model_info) 
    127128     
     
    259260        self.result = np.empty(q_input.nq+3, q_input.dtype) 
    260261 
    261     def __call__(self, details, weights, values, cutoff): 
     262    def __call__(self, call_details, weights, values, cutoff): 
    262263        real = (np.float32 if self.q_input.dtype == generate.F32 
    263264                else np.float64 if self.q_input.dtype == generate.F64 
    264265                else np.float128) 
    265         assert isinstance(details, generate.CoordinationDetails) 
     266        assert isinstance(call_details, details.CallDetails) 
    266267        assert weights.dtype == real and values.dtype == real 
    267268 
    268         start, stop = 0, details.total_pd 
     269        start, stop = 0, call_details.total_pd 
    269270        #print("in kerneldll") 
    270271        #print("weights", weights) 
     
    274275            start, # pd_start 
    275276            stop, # pd_stop pd_stride[MAX_PD] 
    276             details.ctypes.data, # problem 
     277            call_details.ctypes.data, # problem 
    277278            weights.ctypes.data,  # weights 
    278279            values.ctypes.data,  #pars 
Note: See TracChangeset for help on using the changeset viewer.