Changeset d18582e in sasmodels for sasmodels/core.py


Ignore:
Timestamp:
Feb 4, 2016 12:44:23 PM (8 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:
5054e80
Parents:
bb6f0f3
Message:

default to double precision if single=False is set in model file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/core.py

    reafc9fa rd18582e  
    7373    return True 
    7474 
    75 def load_model(model_definition, dtype="single", platform="ocl"): 
     75def load_model(model_definition, dtype=None, platform="ocl"): 
    7676    """ 
    7777    Prepare the model for the default execution platform. 
     
    8787    for the calculation. Any valid numpy single or double precision identifier 
    8888    is valid, such as 'single', 'f', 'f32', or np.float32 for single, or 
    89     'double', 'd', 'f64'  and np.float64 for double. 
     89    'double', 'd', 'f64'  and np.float64 for double.  If *None*, then use 
     90    'single' unless the model defines single=False. 
    9091 
    9192    *platform* should be "dll" to force the dll to be used for C models, 
     
    9495    if isstr(model_definition): 
    9596        model_definition = load_model_definition(model_definition) 
     97    if dtype is None: 
     98        dtype = 'single' if getattr(model_definition, 'single', True) else 'double' 
    9699    source, info = generate.make(model_definition) 
    97100    if callable(info.get('Iq', None)): 
Note: See TracChangeset for help on using the changeset viewer.