Changeset 98d6cfc in sasmodels


Ignore:
Timestamp:
Mar 20, 2016 6:51:31 AM (9 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:
3a45c2c
Parents:
22975f0
Message:

-default/-demo on compare

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/compare.py

    r72a081d r98d6cfc  
    6969    -accuracy=Low accuracy of the resolution calculation Low, Mid, High, Xhigh 
    7070    -edit starts the parameter explorer 
     71    -default/-demo* use demo vs default parameters 
    7172 
    7273Any two calculation engines can be selected for comparison: 
     
    631632    'hist', 'nohist', 
    632633    'edit', 
     634    'demo', 'default', 
    633635    ]) 
    634636VALUE_OPTIONS = [ 
     
    654656 
    655657 
    656 def get_demo_pars(model_info): 
     658def get_pars(model_info, use_demo=False): 
    657659    """ 
    658660    Extract demo parameters from the model definition. 
     
    670672 
    671673    # Plug in values given in demo 
    672     pars.update(model_info['demo']) 
     674    if use_demo: 
     675        pars.update(model_info['demo']) 
    673676    return pars 
    674677 
     
    727730        'rel_err'   : True, 
    728731        'explore'   : False, 
     732        'use_demo'  : True, 
    729733    } 
    730734    engines = [] 
     
    765769        elif arg == '-sasview': engines.append(arg[1:]) 
    766770        elif arg == '-edit':    opts['explore'] = True 
     771        elif arg == '-demo':    opts['use_demo'] = True 
     772        elif arg == '-default':    opts['use_demo'] = False 
    767773    # pylint: enable=bad-whitespace 
    768774 
     
    782788    # Get demo parameters from model definition, or use default parameters 
    783789    # if model does not define demo parameters 
    784     pars = get_demo_pars(model_info) 
     790    pars = get_pars(model_info, opts['use_demo']) 
     791 
    785792 
    786793    # Fill in parameters given on the command line 
Note: See TracChangeset for help on using the changeset viewer.