Changeset 31641b2 in sasmodels for sasmodels/core.py


Ignore:
Timestamp:
Mar 21, 2016 4:20:32 PM (8 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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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) 
Note: See TracChangeset for help on using the changeset viewer.