Changeset fa5fd8d in sasmodels for sasmodels/core.py


Ignore:
Timestamp:
Apr 12, 2016 4:02:41 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:
04045f4
Parents:
7ae2b7f
Message:

support number of shells selection in sasview wrapper for onion model

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/core.py

    r7ae2b7f rfa5fd8d  
    102102 
    103103def build_model(model_info, dtype=None, platform="ocl"): 
    104     # type: (modelinfo.ModelInfo, DType, str) -> KernelModel 
     104    # type: (modelinfo.ModelInfo, np.dtype, str) -> KernelModel 
    105105    """ 
    106106    Prepare the model for the default execution platform. 
     
    134134            raise ValueError('unknown mixture type %s'%composition_type) 
    135135 
     136    # If it is a python model, return it immediately 
     137    if callable(model_info.Iq): 
     138        return kernelpy.PyModel(model_info) 
     139 
    136140    ## for debugging: 
    137141    ##  1. uncomment open().write so that the source will be saved next time 
     
    144148    source = generate.make_source(model_info) 
    145149    if dtype is None: 
    146         dtype = 'single' if model_info.single else 'double' 
    147     if callable(model_info.Iq): 
    148         return kernelpy.PyModel(model_info) 
     150        dtype = generate.F32 if model_info.single else generate.F64 
    149151    if (platform == "dll" 
    150152            or not HAVE_OPENCL 
Note: See TracChangeset for help on using the changeset viewer.