Changeset d2fb4af in sasmodels for sasmodels/convert.py


Ignore:
Timestamp:
Nov 22, 2016 8:43:16 AM (7 years ago)
Author:
krzywon
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
077666e
Parents:
f80f334
Message:

#795: No longer an issue with multiple backgrounds and scales. A handful of model names were slightly off from the save state names. Currently going through model-by-model to finish this.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/convert.py

    rf80f334 rd2fb4af  
    6464    if id.startswith('M0:'): 
    6565        return True 
    66     if id.startswith('volfraction') or id.startswith('radius_effective'): 
    67         return False 
    6866    if '_pd' in id or '.' in id: 
    6967        return False 
     
    7573        if p.id == id: 
    7674            return p.type == 'sld' 
    77     raise ValueError("unknown parameter %r in conversion"%id) 
     75    return False 
    7876 
    7977def _rescale_sld(model_info, pars, scale): 
     
    137135                i += 1 
    138136                break 
    139             elif re.search("background", key_par) or re.search("scale", key_par): 
     137            elif "background" == key_par or "scale" == key_par: 
    140138                new_pars[key_par] = value_par 
    141139                i += 1 
     
    236234                oldpars[p + ".upper"] /= 1e-13 
    237235    elif name == 'spherical_sld': 
    238         oldpars["CONTROL"] += 1 
     236        oldpars["CONTROL"] = 0 
     237        i = 0 
     238        while "nu_inter" + str(i) in oldpars: 
     239            oldpars["CONTROL"] += 1 
     240            i += 1 
    239241    elif name == 'teubner_strey': 
    240242        # basically undoing the entire Teubner-Strey calculations here. 
Note: See TracChangeset for help on using the changeset viewer.