Changeset 21c93c3 in sasmodels


Ignore:
Timestamp:
Mar 6, 2019 4:14:41 PM (7 months ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
fd7291e
Parents:
f3767c2
Message:

fix translation of 3.x models with control parameters to 4.2

Location:
sasmodels
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/convert.py

    r610ef23 r21c93c3  
    105105                    translation[newid+str(k)] = oldid+str(k) 
    106106    # Remove control parameter from the result 
    107     if model_info.control: 
    108         translation[model_info.control] = "CONTROL" 
     107    control_pars = [p.id for p in model_info.parameters.kernel_parameters 
     108                    if p.is_control] 
     109    if control_pars: 
     110        control_id = control_pars[0] 
     111        translation[control_id] = "CONTROL" 
    109112    return translation 
    110113 
  • sasmodels/sasview_model.py

    rb171acd r21c93c3  
    255255    control_pars = [p.id for p in model_info.parameters.kernel_parameters 
    256256                    if p.is_control] 
    257     control = control_pars[0] if control_pars else None 
     257    control_id = control_pars[0] if control_pars else None 
    258258    non_fittable = []  # type: List[str] 
    259259    xlabel = model_info.profile_axes[0] if model_info.profile is not None else "" 
    260260    variants = MultiplicityInfo(0, "", [], xlabel) 
    261261    for p in model_info.parameters.kernel_parameters: 
    262         if p.id == control: 
     262        if p.id == control_id: 
    263263            non_fittable.append(p.name) 
    264264            variants = MultiplicityInfo( 
Note: See TracChangeset for help on using the changeset viewer.