Changes in / [4c8cf97:3fb9404] in sasmodels


Ignore:
Location:
sasmodels
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/core.py

    r7624dd3 r2d81cfe  
    149149    """ 
    150150    if '@' in model_string: 
    151         terms = model_string.split('+') 
    152         results = [] 
    153         for term in terms: 
    154             if '@' in term: 
    155                 p_info, q_info = [load_model_info(part) 
    156                                   for part in term.split("@")] 
    157                 results.append(product.make_product_info(p_info, q_info)) 
    158             else: 
    159                 results.append(load_model_info(term)) 
    160         return mixture.make_mixture_info(results, operation='+') 
     151        parts = model_string.split('@') 
     152        if len(parts) != 2: 
     153            raise ValueError("Use P@S to apply a structure factor S to model P") 
     154        P_info, Q_info = [load_model_info(part) for part in parts] 
     155        return product.make_product_info(P_info, Q_info) 
    161156 
    162157    product_parts = [] 
  • sasmodels/mixture.py

    r71bf6de r2d81cfe  
    9494            # If model is a sum model, each constituent model gets its own scale parameter 
    9595            scale_prefix = prefix 
    96             if prefix == '' and hasattr(part,"operation") and part.operation == '*': 
     96            if prefix == '' and part.operation == '*': 
    9797                # `part` is a composition product model. Find the prefixes of 
    9898                # it's parameters to form a new prefix for the scale, eg: 
Note: See TracChangeset for help on using the changeset viewer.