Changes in / [5fb0634:a6d3f46] in sasmodels


Ignore:
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • .gitignore

    r9248bf7 r67cc0ff  
    88*.so 
    99*.obj 
     10*.o 
    1011/doc/_build/ 
    1112/doc/api/ 
     
    1920/.pydevproject 
    2021/.idea 
     22.vscode 
    2123/sasmodels.egg-info/ 
    2224/example/Fit_*/ 
  • sasmodels/kerneldll.py

    r2d81cfe r1ddb794  
    185185        subprocess.check_output(command, shell=shell, stderr=subprocess.STDOUT) 
    186186    except subprocess.CalledProcessError as exc: 
    187         raise RuntimeError("compile failed.\n%s\n%s"%(command_str, exc.output)) 
     187        raise RuntimeError("compile failed.\n%s\n%s" 
     188                           % (command_str, exc.output.decode())) 
    188189    if not os.path.exists(output): 
    189190        raise RuntimeError("compile failed.  File is in %r"%source) 
  • sasmodels/modelinfo.py

    r108e70e rc01ed3e  
    1212from os.path import abspath, basename, splitext 
    1313import inspect 
     14import logging 
    1415 
    1516import numpy as np  # type: ignore 
     17 
     18from . import autoc 
    1619 
    1720# Optional typing 
     
    3235    TestCondition = Tuple[ParameterSetUser, TestInput, TestValue] 
    3336# pylint: enable=unused-import 
     37 
     38logger = logging.getLogger(__name__) 
    3439 
    3540# If MAX_PD changes, need to change the loop macros in kernel_iq.c 
     
    789794    info.structure_factor = getattr(kernel_module, 'structure_factor', False) 
    790795    info.profile_axes = getattr(kernel_module, 'profile_axes', ['x', 'y']) 
     796    info.c_code = getattr(kernel_module, 'c_code', None) 
    791797    info.source = getattr(kernel_module, 'source', []) 
    792798    info.c_code = getattr(kernel_module, 'c_code', None) 
     
    804810    info.sesans = getattr(kernel_module, 'sesans', None) # type: ignore 
    805811    # Default single and opencl to True for C models.  Python models have callable Iq. 
    806     info.opencl = getattr(kernel_module, 'opencl', not callable(info.Iq)) 
    807     info.single = getattr(kernel_module, 'single', not callable(info.Iq)) 
    808812    info.random = getattr(kernel_module, 'random', None) 
    809813 
     
    814818    info.hidden = getattr(kernel_module, 'hidden', None) # type: ignore 
    815819 
     820    info.lineno = {} 
     821    _find_source_lines(info, kernel_module) 
     822    if getattr(kernel_module, 'py2c', False): 
     823        try: 
     824            autoc.convert(info, kernel_module) 
     825        except Exception as exc: 
     826            logger.warn(str(exc) + " while converting %s from C to python"%name) 
     827 
     828    # Needs to come after autoc.convert since the Iq symbol may have been 
     829    # converted from python to C 
     830    info.opencl = getattr(kernel_module, 'opencl', not callable(info.Iq)) 
     831    info.single = getattr(kernel_module, 'single', not callable(info.Iq)) 
     832 
    816833    if callable(info.Iq) and parameters.has_2d: 
    817834        raise ValueError("oriented python models not supported") 
    818  
    819     info.lineno = {} 
    820     _find_source_lines(info, kernel_module) 
    821835 
    822836    return info 
Note: See TracChangeset for help on using the changeset viewer.