Changeset fe496dd in sasmodels


Ignore:
Timestamp:
Aug 16, 2016 1:06:00 AM (8 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:
6b7e2f7
Parents:
725ee36
git-author:
Paul Kienzle <pkienzle@…> (08/16/16 00:20:53)
git-committer:
Paul Kienzle <pkienzle@…> (08/16/16 01:06:00)
Message:

propagate demo values to mixture demo

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/mixture.py

    rac98886 rfe496dd  
    2828    # type: (List[ModelInfo]) -> ModelInfo 
    2929    """ 
    30     Create info block for product model. 
     30    Create info block for mixture model. 
    3131    """ 
    3232    flatten = [] 
     
    4040    # Build new parameter list 
    4141    combined_pars = [] 
     42    demo = {} 
    4243    for k, part in enumerate(parts): 
    4344        # Parameter prefix per model, A_, B_, ... 
     
    5556                p.length_control = prefix + p.length_control 
    5657            combined_pars.append(p) 
     58        demo.update((prefix+k, v) for k, v in part.demo.items() 
     59                    if k != "background") 
    5760    #print("pars",combined_pars) 
    5861    parameters = ParameterTable(combined_pars) 
     
    7679    # Remember the component info blocks so we can build the model 
    7780    model_info.composition = ('mixture', parts) 
    78     model_info.demo = {} 
     81    model_info.demo = demo 
    7982    return model_info 
    8083 
     
    115118 
    116119    def __call__(self, call_details, values, cutoff, magnetic): 
    117         # type: (CallDetails, np.ndarray, np.ndarry, float) -> np.ndarray 
     120        # type: (CallDetails, np.ndarray, np.ndarry, float, bool) -> np.ndarray 
    118121        scale, background = values[0:2] 
    119122        total = 0.0 
     
    139142class MixtureParts(object): 
    140143    def __init__(self, model_info, kernels, call_details, values): 
     144        # type: (ModelInfo, List[Kernel], CallDetails, np.ndarray) -> None 
    141145        self.model_info = model_info 
    142146        self.parts = model_info.composition[1] 
Note: See TracChangeset for help on using the changeset viewer.