Changeset e85aa2e in sasmodels for sasmodels/convert.py


Ignore:
Timestamp:
Nov 2, 2016 9:40:32 AM (7 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
037aa3d
Parents:
fef353f
Message:

support scale ↔ scale_factor conversion in P*S models

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/convert.py

    r999c87f re85aa2e  
    161161        oldpars['rimB.width'] = 0.0 
    162162        oldpars['rimC.width'] = 0.0 
     163    elif name == 'core_shell_ellipsoid:1': 
    163164    elif name == 'hollow_cylinder': 
    164165        # now uses radius and thickness 
     
    228229    if newname is None: 
    229230        return name, pars 
    230     if newname.endswith(':1'): 
     231    if ':' in newname:   # core_shell_ellipsoid:1 
    231232        model_info = load_model_info(newname[:-2]) 
    232233        # Know that the table exists and isn't multiplicity so grab it directly 
     234        # Can't use _get_translation_table since that will return the 'bare' 
     235        # version. 
    233236        translation = CONVERSION_TABLE[newname] 
    234237    else: 
     
    305308        composition_type, parts = model_info.composition 
    306309        if composition_type == 'product': 
    307             translation = {'scale':'scale_factor'} 
    308             translation.update(_get_translation_table(parts[0])) 
     310            translation = _get_translation_table(parts[0]) 
     311            # structure factor models include scale:scale_factor mapping 
    309312            translation.update(_get_translation_table(parts[1])) 
    310313        else: 
Note: See TracChangeset for help on using the changeset viewer.