Changeset 78afdec in sasmodels


Ignore:
Timestamp:
Jan 18, 2016 2:48:37 AM (9 years ago)
Author:
piotr
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:
23d3b41
Parents:
421e55c (diff), e66c9f9 (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' of https://github.com/SasView/sasmodels

Files:
5 added
3 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/compare.py

    r8b25ee1 r82c299f  
    123123        rg_max = np.sqrt(90*np.log(10) + 3*np.log(pars['scale']))/q_max 
    124124        pars['rg'] = min(pars['rg'],rg_max) 
     125 
     126    if name == 'rpa': 
     127        # Make sure phi sums to 1.0 
     128        if pars['case_num'] < 2: 
     129            pars['Phia'] = 0. 
     130            pars['Phib'] = 0. 
     131        elif pars['case_num'] < 5: 
     132            pars['Phia'] = 0. 
     133        total = sum(pars['Phi'+c] for c in 'abcd') 
     134        for c in 'abcd': 
     135            pars['Phi'+c] /= total 
    125136 
    126137def parlist(pars): 
  • sasmodels/convert.py

    r55a8316 r78afdec  
    112112        _remove_pd(oldpars, 'num_pearls', name) 
    113113        _remove_pd(oldpars, 'thick_string', name) 
     114    elif name == 'rpa': 
     115        # convert scattering lengths from femtometers to centimeters 
     116        for p in "La", "Lb", "Lc", "Ld": 
     117            if p in oldpars: oldpars[p] *= 1e-13 
    114118 
    115119    return oldname, oldpars 
     
    128132        pars['string_thickness_pd_n'] = 0 
    129133        pars['number_of_pearls_pd_n'] = 0 
     134    elif name == 'rpa': 
     135        pars['case_num'] = int(pars['case_num']) 
    130136    elif getattr(model_definition, 'category', None) == 'structure-factor': 
    131137        pars['scale'], pars['background'] = 1, 0 
  • sasmodels/generate.py

    re97170c re66c9f9  
    265265""" 
    266266 
    267 def format_units(par): 
    268     return RST_UNITS.get(par, par) 
     267def format_units(units): 
     268    return "string" if isinstance(units, list) else RST_UNITS.get(units, units) 
    269269 
    270270def make_partable(pars): 
     
    284284    lines = [ 
    285285        sep, 
    286         " ".join("%-*s" % (w, h) for w, h in zip(column_widths, PARTABLE_HEADERS)), 
     286        " ".join("%-*s" % (w, h) 
     287                 for w, h in zip(column_widths, PARTABLE_HEADERS)), 
    287288        sep, 
    288289        ] 
Note: See TracChangeset for help on using the changeset viewer.