Changeset b3f4831 in sasmodels for sasmodels/convert.py


Ignore:
Timestamp:
Oct 30, 2018 11:07:41 AM (5 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
ticket_1156
Children:
cc8b183
Parents:
5778279 (diff), c6084f1 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into ticket_1156

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/convert.py

    r78f8308 rb3f4831  
    167167    if version < (4, 2, 0): 
    168168        oldpars = _hand_convert_4_1_to_4_2(name, oldpars) 
     169        oldpars = _rename_magnetic_pars(oldpars) 
    169170    return oldpars 
    170171 
     
    174175        oldpars['lattice_distortion'] = oldpars.pop('d_factor') 
    175176    return oldpars 
     177 
     178def _rename_magnetic_pars(pars): 
     179    """ 
     180    Change from M0:par to par_M0, etc. 
     181    """ 
     182    keys = list(pars.items()) 
     183    for k in keys: 
     184        if k.startswith('M0:'): 
     185            pars[k[3:]+'_M0'] = pars.pop(k) 
     186        elif k.startswith('mtheta:'): 
     187            pars[k[7:]+'_mtheta'] = pars.pop(k) 
     188        elif k.startswith('mphi:'): 
     189            pars[k[5:]+'_mphi'] = pars.pop(k) 
     190        elif k.startswith('up:'): 
     191            pars['up_'+k[3:]] = pars.pop(k) 
     192    return pars 
    176193 
    177194def _hand_convert_3_1_2_to_4_1(name, oldpars): 
Note: See TracChangeset for help on using the changeset viewer.