Changeset 31641b2 in sasmodels


Ignore:
Timestamp:
Mar 21, 2016 4:20:32 PM (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:
abc03d8
Parents:
afda63c (diff), 88aa3ee (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'polydisp' of https://github.com/SasView/sasmodels into polydisp

Location:
sasmodels
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/compare.py

    r1edf610 ra4e2ae5  
    452452    """ 
    453453    # initialize the code so time is more accurate 
    454     #value = calculator(**suppress_pd(pars)) 
     454    if Nevals > 1: 
     455        value = calculator(**suppress_pd(pars)) 
    455456    toc = tic() 
    456457    for _ in range(max(Nevals, 1)):  # make sure there is at least one eval 
  • sasmodels/core.py

    r1edf610 r88aa3ee  
    222222    """ 
    223223    if mono: 
    224         values = [pars.get(p.name, p.default) for p in kernel.info['parameters']] 
    225         weights = [1.0]*len(values) 
    226     else: 
    227         vw_pairs = [get_weights(p, pars) for p in kernel.info['parameters']] 
    228         values, weights = zip(*vw_pairs) 
    229  
    230     #TODO: This is what we thought to do if max([len(w) for w in weights]) > 1: 
    231     print("from") 
    232     import pprint; pprint.pprint(weights) 
    233     print("to") 
     224        active = lambda name: False 
     225    elif kernel.dim == '1d': 
     226        active = lambda name: name in set(kernel.info['par_type']['1d']) 
     227    elif kernel.dim == '2d': 
     228        active = lambda name: name in set(kernel.info['par_type']['2d']) 
     229    else: 
     230        active = lambda name: True 
     231 
     232    vw_pairs = [(get_weights(p, pars) if active(p.name) else ([p.default], [1])) 
     233                for p in kernel.info['parameters']] 
     234    values, weights = zip(*vw_pairs) 
     235 
    234236    if max([len(w) for w in weights]) > 1: 
    235237        details = generate.poly_details(kernel.info, weights) 
  • sasmodels/kernelcl.py

    rc072f83 r445d1c0  
    446446        q_input = GpuInput(q_vectors, dtype) 
    447447        self.dtype = dtype 
     448        self.dim = '2d' if q_input.is_2d else '1d' 
    448449        self.kernel = kernel 
    449450        self.info = model_info 
     
    452453        # plus three for the normalization values 
    453454        self.result = np.empty(q_input.nq+3, q_input.dtype) 
    454         #self.dim = '2d' if q_input.is_2d else '1d' 
    455455 
    456456        # Inputs and outputs for each kernel call 
  • sasmodels/kerneldll.py

    r0880966 r445d1c0  
    256256        self.kernel = kernel 
    257257        self.res = np.empty(q_input.nq+3, q_input.dtype) 
    258         dim = '2d' if q_input.is_2d else '1d' 
    259         self.parameters = model_info['par_type'][dim] 
     258        self.dim = '2d' if q_input.is_2d else '1d' 
    260259 
    261260        # In dll kernel, but not in opencl kernel 
  • sasmodels/generate.py

    r1edf610 rafda63c  
    684684 
    685685def poly_details(model_info, weights): 
    686     print("entering poly",weights) 
    687686    pars = model_info['parameters'][2:]  # skip scale and background 
    688687    max_pd = model_info['max_pd'] 
     
    707706        if theta_par >= 0 and pd_length[theta_par] <= 1: 
    708707            theta_par = -1 
    709  
    710     print("p","max_pd","constants_offset",par_offset,max_pd,constants_offset,npars) 
    711     print(idx) 
    712     print(pd_length[idx]) 
    713     print(pd_offset[idx]) 
    714     print(pd_stride) 
    715     print(pd_isvol[idx]) 
    716708 
    717709    details = np.empty(constants_offset + 2, 'int32') 
     
    727719    for k,parameter_num in enumerate(idx): 
    728720        details[coord_offset+parameter_num] = 2**k 
    729     details[constants_offset]   = 1   # fast_coord_count: one fast index 
     721    details[constants_offset] = 1   # fast_coord_count: one fast index 
    730722    details[constants_offset+1] = theta_par 
    731723    print ("details",details) 
Note: See TracChangeset for help on using the changeset viewer.