Changeset d6e2f8d in sasmodels


Ignore:
Timestamp:
Aug 26, 2016 8:36:18 AM (8 years ago)
Author:
wojciech
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:
f49675c
Parents:
8407d8c (diff), 1392831 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merged with master

Location:
sasmodels
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/sasview_model.py

    r300a2f7 r3bcb88c  
    454454        """ 
    455455        # TODO: fix test so that parameter order doesn't matter 
    456         ret = ['%s.%s' % (p.name, ext) 
    457                for p in self._model_info.parameters.user_parameters() 
    458                for ext in ('npts', 'nsigmas', 'width') 
    459                if p.polydisperse] 
     456        ret = ['%s.%s' % (p_name, ext) 
     457               for p_name in self.dispersion.keys() 
     458               for ext in ('npts', 'nsigmas', 'width')] 
    460459        #print(ret) 
    461460        return ret 
  • sasmodels/compare.py

    rb32dafd r8407d8c  
    563563    elif dtype.endswith('!'): 
    564564        return eval_ctypes(model_info, data, dtype=dtype[:-1], cutoff=cutoff) 
     565    elif not model_info.opencl: 
     566        return eval_ctypes(model_info, data, dtype=dtype, cutoff=cutoff) 
    565567    else: 
    566568        return eval_opencl(model_info, data, dtype=dtype, cutoff=cutoff) 
  • sasmodels/core.py

    r725ee36 r8407d8c  
    4646#    build_model 
    4747 
    48 KINDS = ("all", "py", "c", "double", "single", "1d", "2d", 
     48KINDS = ("all", "py", "c", "double", "single", "opencl", "1d", "2d", 
    4949         "nonmagnetic", "magnetic") 
    5050def list_models(kind=None): 
     
    6060        * single: models which support single precision 
    6161        * double: models which require double precision 
     62        * opencl: controls if OpenCL is supperessed 
    6263        * 1d: models which are 1D only, or 2D using abs(q) 
    6364        * 2d: models which can be 2D 
     
    8586        return True 
    8687    elif kind == "single" and info.single: 
     88        return True 
     89    elif kind == "opencl" and info.opencl: 
    8790        return True 
    8891    elif kind == "2d" and any(p.type == 'orientation' for p in pars): 
     
    215218    """ 
    216219    # Assign default platform, overriding ocl with dll if OpenCL is unavailable 
    217     if platform is None: 
     220    # If opencl=False OpenCL is switched off 
     221    if platform is None or model_info.opencl: 
    218222        platform = "ocl" 
    219     if platform == "ocl" and not HAVE_OPENCL: 
     223    if platform == "ocl" and not HAVE_OPENCL or not model_info.opencl: 
    220224        platform = "dll" 
    221225 
  • sasmodels/modelinfo.py

    r40a87fa r8407d8c  
    731731    info.category = getattr(kernel_module, 'category', None) 
    732732    info.single = getattr(kernel_module, 'single', True) 
     733    info.opencl = getattr(kernel_module, 'opencl', True) 
    733734    info.structure_factor = getattr(kernel_module, 'structure_factor', False) 
    734735    info.profile_axes = getattr(kernel_module, 'profile_axes', ['x', 'y']) 
Note: See TracChangeset for help on using the changeset viewer.