Changes in / [bf227cd:a1c91c2] in sasmodels


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/convert.py

    r667a6f2 r310ddcb  
    44import warnings 
    55 
    6 STRUCTURE_FACTORS = [ 
    7     'hardsphere', 
    8     'stickyhardsphere', 
    9     'squarewell', 
    10     'HayterMSAsq' 
    11 ] 
    126# List of models which SasView versions don't contain the explicit 'scale' argument. 
    137# When converting such a model, please update this list. 
    14 MODELS_WITHOUT_SCALE = STRUCTURE_FACTORS + [ 
     8MODELS_WITHOUT_SCALE = [ 
    159    'teubner_strey', 
    1610    'broad_peak', 
     
    2721# List of models which SasView versions don't contain the explicit 'background' argument. 
    2822# When converting such a model, please update this list. 
    29 MODELS_WITHOUT_BACKGROUND = STRUCTURE_FACTORS + [ 
     23MODELS_WITHOUT_BACKGROUND = [ 
    3024    'guinier', 
    3125] 
     
    128122    # Note: update compare.constrain_pars to match 
    129123    name = model_info['id'] 
    130     if name in MODELS_WITHOUT_SCALE: 
     124    if name in MODELS_WITHOUT_SCALE or model_info['structure_factor']: 
    131125        if oldpars.pop('scale', 1.0) != 1.0: 
    132126            warnings.warn("parameter scale not used in sasview %s"%name) 
    133     if name in MODELS_WITHOUT_BACKGROUND: 
     127    if name in MODELS_WITHOUT_BACKGROUND or model_info['structure_factor']: 
    134128        if oldpars.pop('background', 0.0) != 0.0: 
    135129            warnings.warn("parameter background not used in sasview %s"%name) 
     
    161155    name = model_info['id'] 
    162156    # Note: update convert.revert_model to match 
    163     if name in MODELS_WITHOUT_SCALE: 
     157    if name in MODELS_WITHOUT_SCALE or model_info['structure_factor']: 
    164158        pars['scale'] = 1 
    165     if name in MODELS_WITHOUT_BACKGROUND: 
     159    if name in MODELS_WITHOUT_BACKGROUND or model_info['structure_factor']: 
    166160        pars['background'] = 0 
    167161    # sasview multiplies background by structure factor 
Note: See TracChangeset for help on using the changeset viewer.