Changeset 12f77e9 in sasmodels for sasmodels/compare.py


Ignore:
Timestamp:
Oct 30, 2018 10:56:38 AM (5 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master
Children:
4e96703
Parents:
1657e21 (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-608-user-defined-weights

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/compare.py

    r01dba26 r12f77e9  
    369369 
    370370    # Limit magnetic SLDs to a smaller range, from zero to iron=5/A^2 
    371     if par.name.startswith('M0:'): 
     371    if par.name.endswith('_M0'): 
    372372        return np.random.uniform(0, 5) 
    373373 
     
    539539    magnetic_pars = [] 
    540540    for p in parameters.user_parameters(pars, is2d): 
    541         if any(p.id.startswith(x) for x in ('M0:', 'mtheta:', 'mphi:')): 
     541        if any(p.id.endswith(x) for x in ('_M0', '_mtheta', '_mphi')): 
    542542            continue 
    543543        if p.id.startswith('up:'): 
     
    551551            pdtype=pars.get(p.id+"_pd_type", 'gaussian'), 
    552552            relative_pd=p.relative_pd, 
    553             M0=pars.get('M0:'+p.id, 0.), 
    554             mphi=pars.get('mphi:'+p.id, 0.), 
    555             mtheta=pars.get('mtheta:'+p.id, 0.), 
     553            M0=pars.get(p.id+'_M0', 0.), 
     554            mphi=pars.get(p.id+'_mphi', 0.), 
     555            mtheta=pars.get(p.id+'_mtheta', 0.), 
    556556        ) 
    557557        lines.append(_format_par(p.name, **fields)) 
     
    619619    if suppress: 
    620620        for p in pars: 
    621             if p.startswith("M0:"): 
     621            if p.endswith("_M0"): 
    622622                pars[p] = 0 
    623623    else: 
     
    625625        first_mag = None 
    626626        for p in pars: 
    627             if p.startswith("M0:"): 
     627            if p.endswith("_M0"): 
    628628                any_mag |= (pars[p] != 0) 
    629629                if first_mag is None: 
Note: See TracChangeset for help on using the changeset viewer.