Changes in / [e589e9a:3b6567f] in sasmodels


Ignore:
Files:
3 added
2 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/modelinfo.py

    r39a06c9 r39a06c9  
    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 
     
    841846    info.profile = getattr(kernel_module, 'profile', None) # type: ignore 
    842847    info.sesans = getattr(kernel_module, 'sesans', None) # type: ignore 
    843     # Default single and opencl to True for C models.  Python models have callable Iq. 
    844     info.opencl = getattr(kernel_module, 'opencl', not callable(info.Iq)) 
    845     info.single = getattr(kernel_module, 'single', not callable(info.Iq)) 
    846848    info.random = getattr(kernel_module, 'random', None) 
    847849 
     
    852854    info.hidden = getattr(kernel_module, 'hidden', None) # type: ignore 
    853855 
     856    info.lineno = {} 
     857    _find_source_lines(info, kernel_module) 
     858    if getattr(kernel_module, 'py2c', False): 
     859        try: 
     860            warnings = autoc.convert(info, kernel_module) 
     861        except Exception as exc: 
     862            warnings = [str(exc)] 
     863        if warnings: 
     864            warnings.append("while converting %s from C to python"%name) 
     865            if len(warnings) > 2: 
     866                warnings = "\n".join(warnings) 
     867            else: 
     868                warnings = " ".join(warnings) 
     869            logger.warn(warnings) 
     870 
     871    # Default single and opencl to True for C models.  Python models have callable Iq. 
     872    # Needs to come after autoc.convert since the Iq symbol may have been 
     873    # converted from python to C 
     874    info.opencl = getattr(kernel_module, 'opencl', not callable(info.Iq)) 
     875    info.single = getattr(kernel_module, 'single', not callable(info.Iq)) 
     876 
    854877    if callable(info.Iq) and parameters.has_2d: 
    855878        raise ValueError("oriented python models not supported") 
    856879 
    857     info.lineno = {} 
    858     _find_source_lines(info, kernel_module) 
    859880    return info 
    860881 
Note: See TracChangeset for help on using the changeset viewer.