Changeset 51ec7e8 in sasmodels for sasmodels/convert.py


Ignore:
Timestamp:
Jul 18, 2016 4:54:39 PM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
263daec
Parents:
ce176ca
Message:

working rpa implementation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/convert.py

    r4a21b121 r51ec7e8  
    176176            newid = p.id 
    177177            oldid = translation.get(p.id, p.id) 
    178             del translation[newid] 
     178            translation.pop(newid, None) 
    179179            for k in range(1, p.length+1): 
    180                 translation[newid+str(k)] = oldid+str(k) 
     180                if newid+str(k) not in translation: 
     181                    translation[newid+str(k)] = oldid+str(k) 
    181182    # Remove control parameter from the result 
    182183    if model_info.control: 
     
    211212    else: 
    212213        translation = _get_translation_table(model_info) 
    213     oldpars = _revert_pars(_unscale_sld(pars), translation) 
    214     oldpars = _trim_vectors(model_info, pars, oldpars) 
     214        oldpars = _revert_pars(_unscale_sld(pars), translation) 
     215        oldpars = _trim_vectors(model_info, pars, oldpars) 
    215216 
    216217 
     
    246247            for p in "L1", "L2", "L3", "L4": 
    247248                if p in oldpars: oldpars[p] *= 1e-13 
     249            if pars['case_num'] < 2: 
     250                for k in ("a", "b"): 
     251                    for p in ("L", "N", "Phi", "b", "v"): 
     252                        oldpars.pop(p+k, None) 
     253                for k in "Kab,Kac,Kad,Kbc,Kbd".split(','): 
     254                    oldpars.pop(k, None) 
     255            elif pars['case_num'] < 5: 
     256                for k in ("a",): 
     257                    for p in ("L", "N", "Phi", "b", "v"): 
     258                        oldpars.pop(p+k, None) 
     259                for k in "Kab,Kac,Kad".split(','): 
     260                    oldpars.pop(k, None) 
    248261        elif name == 'core_shell_parallelepiped': 
    249262            _remove_pd(oldpars, 'rimA', name) 
Note: See TracChangeset for help on using the changeset viewer.