Changeset 9cfcac8 in sasmodels


Ignore:
Timestamp:
Jan 21, 2016 6:31:27 PM (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:
608e31e
Parents:
caeb06d
Message:

reduce lint

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/compare.py

    rcaeb06d r9cfcac8  
    99trig, etc., and may not be completely IEEE 754 compliant.  This lets 
    1010make sure that the model calculations are stable, or if you need to 
    11 tag the model as double precision only.   
    12  
    13 Run using ./compare.sh (Linux, Mac) or compare.bat (Windows) in the  
     11tag the model as double precision only. 
     12 
     13Run using ./compare.sh (Linux, Mac) or compare.bat (Windows) in the 
    1414sasmodels root to see the command line options. 
    1515 
    16 Note that there is no way within sasmodels to select between an  
    17 OpenCL CPU device and a GPU device, but you can do so by setting the  
     16Note that there is no way within sasmodels to select between an 
     17OpenCL CPU device and a GPU device, but you can do so by setting the 
    1818PYOPENCL_CTX environment variable ahead of time.  Start a python 
    1919interpreter and enter:: 
     
    262262    # convert model parameters from sasmodel form to sasview form 
    263263    #print("old",sorted(pars.items())) 
    264     modelname, _pars = revert_model(model_definition, {}) 
     264    modelname, _ = revert_model(model_definition, {}) 
    265265    #print("new",sorted(_pars.items())) 
    266266    sas = __import__('sas.models.'+modelname) 
     
    331331 
    332332def eval_ctypes(model_definition, data, dtype='double', cutoff=0.): 
     333    """ 
     334    Return a model calculator using the DLL calculation engine. 
     335    """ 
    333336    if dtype == 'quad': 
    334337        dtype = 'longdouble' 
     
    404407    parameters. 
    405408    """ 
    406     Nbase, Ncomp = opts['N1'], opts['N2'] 
     409    Nbase, Ncomp = opts['n1'], opts['n2'] 
    407410    pars = opts['pars'] 
    408411    data = opts['data'] 
     
    550553    info = generate.make_info(model_definition) 
    551554    # Get the default values for the parameters 
    552     pars = dict((p[0],p[2]) for p in info['parameters']) 
     555    pars = dict((p[0], p[2]) for p in info['parameters']) 
    553556 
    554557    # Fill in default values for the polydispersity parameters 
     
    584587        sys.exit(1) 
    585588    if len(args) > 3: 
    586         print("expected parameters: model Nopencl Nsasview") 
     589        print("expected parameters: model N1 N2") 
    587590 
    588591    invalid = [o[1:] for o in flags 
     
    650653 
    651654    if len(engines) == 0: 
    652         engines.extend(['single','sasview']) 
     655        engines.extend(['single', 'sasview']) 
    653656    elif len(engines) == 1: 
    654657        if engines[0][0] != 'sasview': 
     
    662665    model_definition = core.load_model_definition(name) 
    663666 
    664     N1 = int(args[1]) if len(args) > 1 else 1 
    665     N2 = int(args[2]) if len(args) > 2 else 1 
     667    n1 = int(args[1]) if len(args) > 1 else 1 
     668    n2 = int(args[2]) if len(args) > 2 else 1 
    666669 
    667670    # Get demo parameters from model definition, or use default parameters 
     
    695698    # Create the computational engines 
    696699    data, _index = make_data(opts) 
    697     if N1: 
     700    if n1: 
    698701        base = make_engine(model_definition, data, engines[0], opts['cutoff']) 
    699702    else: 
    700703        base = None 
    701     if N2: 
     704    if n2: 
    702705        comp = make_engine(model_definition, data, engines[1], opts['cutoff']) 
    703706    else: 
     
    708711        'name'      : name, 
    709712        'def'       : model_definition, 
    710         'N1'        : N1, 
    711         'N2'        : N2, 
     713        'n1'        : n1, 
     714        'n2'        : n2, 
    712715        'presets'   : presets, 
    713716        'pars'      : pars, 
Note: See TracChangeset for help on using the changeset viewer.