Changes in sasmodels/convert.py [a69d8cd:610ef23] in sasmodels


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/convert.py

    ra69d8cd r610ef23  
    165165    if version == (3, 1, 2): 
    166166        oldpars = _hand_convert_3_1_2_to_4_1(name, oldpars) 
     167    if version < (4, 2, 0): 
     168        oldpars = _rename_magnetic_pars(oldpars) 
    167169    return oldpars 
     170 
     171def _rename_magnetic_pars(pars): 
     172    """ 
     173    Change from M0:par to par_M0, etc. 
     174    """ 
     175    keys = list(pars.items()) 
     176    for k in keys: 
     177        if k.startswith('M0:'): 
     178            pars[k[3:]+'_M0'] = pars.pop(k) 
     179        elif k.startswith('mtheta:'): 
     180            pars[k[7:]+'_mtheta'] = pars.pop(k) 
     181        elif k.startswith('mphi:'): 
     182            pars[k[5:]+'_mphi'] = pars.pop(k) 
     183        elif k.startswith('up:'): 
     184            pars['up_'+k[3:]] = pars.pop(k) 
     185    return pars 
    168186 
    169187def _hand_convert_3_1_2_to_4_1(name, oldpars): 
Note: See TracChangeset for help on using the changeset viewer.