Changes in / [33969b6:1662ebe] in sasmodels


Ignore:
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • .gitignore

    re9ed2de re9ed2de  
    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

    r33969b6 r33969b6  
    181181        subprocess.check_output(command, shell=shell, stderr=subprocess.STDOUT) 
    182182    except subprocess.CalledProcessError as exc: 
    183         raise RuntimeError("compile failed.\n%s\n%s"%(command_str, exc.output)) 
     183        raise RuntimeError("compile failed.\n%s\n%s" 
     184                           % (command_str, exc.output.decode())) 
    184185    if not os.path.exists(output): 
    185186        raise RuntimeError("compile failed.  File is in %r"%source) 
  • sasmodels/modelinfo.py

    r95498a3 r95498a3  
    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 
     
    807812    info.sesans = getattr(kernel_module, 'sesans', None) # type: ignore 
    808813    # Default single and opencl to True for C models.  Python models have callable Iq. 
    809     info.opencl = getattr(kernel_module, 'opencl', not callable(info.Iq)) 
    810     info.single = getattr(kernel_module, 'single', not callable(info.Iq)) 
    811814    info.random = getattr(kernel_module, 'random', None) 
    812815 
     
    817820    info.hidden = getattr(kernel_module, 'hidden', None) # type: ignore 
    818821 
     822    info.lineno = {} 
     823    _find_source_lines(info, kernel_module) 
     824    if getattr(kernel_module, 'py2c', False): 
     825        try: 
     826            autoc.convert(info, kernel_module) 
     827        except Exception as exc: 
     828            logger.warn(str(exc) + " while converting %s from C to python"%name) 
     829 
     830    # Needs to come after autoc.convert since the Iq symbol may have been 
     831    # converted from python to C 
     832    info.opencl = getattr(kernel_module, 'opencl', not callable(info.Iq)) 
     833    info.single = getattr(kernel_module, 'single', not callable(info.Iq)) 
     834 
    819835    if callable(info.Iq) and parameters.has_2d: 
    820836        raise ValueError("oriented python models not supported") 
    821  
    822     info.lineno = {} 
    823     _find_source_lines(info, kernel_module) 
    824837 
    825838    return info 
Note: See TracChangeset for help on using the changeset viewer.