Changeset 445d1c0 in sasmodels


Ignore:
Timestamp:
Mar 21, 2016 4:08:33 PM (9 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:
88aa3ee
Parents:
a4e2ae5
Message:

restrict polydispersity checks in bumps to 1d parameters for 1d data

Location:
sasmodels
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/core.py

    r1edf610 r445d1c0  
    222222    """ 
    223223    if mono: 
    224         values = [pars.get(p.name, p.default) for p in kernel.info['parameters']] 
    225         weights = [1.0]*len(values) 
     224        active = set() 
     225    elif kernel.dim == '1d': 
     226        active = set(kernel.info['par_type']['1d']) 
     227    elif kernel.dim == '2d': 
     228        active = set(kernel.info['par_type']['2d']) 
    226229    else: 
    227230        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") 
     231 
     232    vw_pairs = [(get_weights(p, pars) if p.name in active 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 
Note: See TracChangeset for help on using the changeset viewer.