Changeset 4cc161e in sasmodels


Ignore:
Timestamp:
Sep 12, 2016 1:20:16 AM (5 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:
3764ec1
Parents:
2a0c7a6
Message:

allow calls to ER/VR with no volume parameters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/direct_model.py

    rbde38b5 r4cc161e  
    8585    if model_info.ER is None: 
    8686        return 1.0 
     87    elif not model_info.parameters.form_volume_parameters: 
     88        # handle the case where ER is provided but model is not polydisperse 
     89        return model_info.ER() 
    8790    else: 
    8891        value, weight = _vol_pars(model_info, pars) 
     
    101104    if model_info.VR is None: 
    102105        return 1.0 
     106    elif not model_info.parameters.form_volume_parameters: 
     107        # handle the case where ER is provided but model is not polydisperse 
     108        return model_info.VR() 
    103109    else: 
    104110        value, weight = _vol_pars(model_info, pars) 
     
    152158                for p in model_info.parameters.call_parameters 
    153159                if p.type == 'volume'] 
     160    #import pylab; pylab.plot(vol_pars[0][0],vol_pars[0][1]); pylab.show() 
    154161    value, weight = dispersion_mesh(model_info, vol_pars) 
    155162    return value, weight 
     
    395402    model = build_model(model_info) 
    396403    calculator = DirectModel(data, model) 
    397     pars = dict((k, float(v)) 
     404    pars = dict((k, (float(v) if not k.endswith("_pd_type") else v)) 
    398405                for pair in sys.argv[3:] 
    399406                for k, v in [pair.split('=')]) 
Note: See TracChangeset for help on using the changeset viewer.