Changes in / [87fce00:f173599] in sasmodels


Ignore:
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • compare.py

    r87fce00 r373d1b6  
    301301    ] 
    302302 
     303def get_demo_pars(name): 
     304    import sasmodels.models 
     305    __import__('sasmodels.models.'+name) 
     306    model = getattr(sasmodels.models, name) 
     307    pars = getattr(model, 'demo', None) 
     308    if pars is None: pars = dict((p[0],p[2]) for p in model.parameters) 
     309    return pars 
     310 
    303311def main(): 
    304312    opts = [arg for arg in sys.argv[1:] if arg.startswith('-')] 
     
    322330    # if model does not define demo parameters 
    323331    name = args[0] 
    324     import sasmodels.models 
    325     __import__('sasmodels.models.'+name) 
    326     model = getattr(sasmodels.models, name) 
    327     pars = getattr(model, 'demo', None) 
    328     if pars is None: pars = dict((p[0],p[2]) for p in model.parameters) 
     332    pars = get_demo_pars(name) 
    329333 
    330334    Nopencl = int(args[1]) if len(args) > 1 else 5 
Note: See TracChangeset for help on using the changeset viewer.