Changeset 39cc3be in sasmodels


Ignore:
Timestamp:
Mar 21, 2016 7:05:29 AM (9 years ago)
Author:
wojciech
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:
a6f9577
Parents:
9f51b0e
Message:

Calling order paramtere clean up

Location:
sasmodels
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/core.py

    r7ff3cf3 r39cc3be  
    223223    if mono or True: 
    224224        pars = np.array([values.get(p.name, p.default) 
    225                          for p in kernel.info['parameters']]) 
    226         weights = np.array([1.0]) 
     225                         for p in kernel.info['parameters']], 
     226                        dtype=kernel.dtype) 
     227        weights = np.array([1.0], dtype=kernel.dtype) 
    227228        details = kernel.info['mono_details'] 
    228         return kernel(details, pars, weights, cutoff) 
     229        return kernel(details,  weights, pars, cutoff) 
    229230    else: 
    230231        pairs = [get_weights(p, values) for p in kernel.info['parameters']] 
     
    232233        details = generate.poly_details(kernel.info, weights, pars) 
    233234        weights, pars = [np.hstack(v) for v in (weights, pars)] 
    234         return kernel(details, pars, weights, cutoff) 
     235        return kernel(details, weights, pars, cutoff) 
    235236 
    236237def call_ER_VR(model_info, vol_pars): 
  • sasmodels/kernel_iq.c

    r5cf3c33 r39cc3be  
    6060  if (problem->pd_length[0] == 1) { 
    6161    // Shouldn't need to copy!! 
    62     printf("copying\n"); 
     62 
    6363    for (int k=0; k < NPARS; k++) { 
    6464      pvec[k] = pars[k+2];  // skip scale and background 
  • sasmodels/kerneldll.py

    r7ff3cf3 r39cc3be  
    253253        self.info = model_info 
    254254        self.q_input = q_input 
     255        self.dtype = q_input.dtype 
    255256        self.kernel = kernel 
    256257        self.res = np.empty(q_input.nq+3, q_input.dtype) 
     
    261262        self.p_res = self.res.ctypes.data 
    262263 
    263     def __call__(self, details, values, weights, cutoff): 
     264    def __call__(self, details, weights, values, cutoff): 
    264265        real = (np.float32 if self.q_input.dtype == generate.F32 
    265266                else np.float64 if self.q_input.dtype == generate.F64 
    266267                else np.float128) 
     268        if details.dtype != np.int32 or weights.dtype != real or values.dtype != real: 
     269            raise TypeError("numeric type does not match the kernel type") 
     270        #details = np.asarray(details, dtype='int32') 
     271        #weights = np.asarray(weights, dtype=real) 
     272        #values = np.asarray(values, dtype=real) 
    267273        args = [ 
    268274            self.q_input.nq, # nq 
     
    277283            ] 
    278284        self.kernel(*args) 
    279  
    280285        return self.res[:-3] 
    281286 
Note: See TracChangeset for help on using the changeset viewer.