Changes in / [225bf94:d8eaa3d] in sasmodels


Ignore:
Files:
3 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • .gitignore

    re9ed2de re9ed2de  
    88*.so 
    99*.obj 
    10 *.o 
    1110/doc/_build/ 
    1211/doc/api/ 
     
    2019/.pydevproject 
    2120/.idea 
    22 .vscode 
    2321/sasmodels.egg-info/ 
    2422/example/Fit_*/ 
  • sasmodels/modelinfo.py

    rd8eaa3d rd8eaa3d  
    1212from os.path import abspath, basename, splitext 
    1313import inspect 
    14 import logging 
    1514 
    1615import numpy as np  # type: ignore 
    17  
    18 from . import autoc 
    1916 
    2017# Optional typing 
     
    3532    TestCondition = Tuple[ParameterSetUser, TestInput, TestValue] 
    3633# pylint: enable=unused-import 
    37  
    38 logger = logging.getLogger(__name__) 
    3934 
    4035# If MAX_PD changes, need to change the loop macros in kernel_iq.c 
     
    865860    info.profile = getattr(kernel_module, 'profile', None) # type: ignore 
    866861    info.sesans = getattr(kernel_module, 'sesans', None) # type: ignore 
     862    # Default single and opencl to True for C models.  Python models have callable Iq. 
     863    info.opencl = getattr(kernel_module, 'opencl', not callable(info.Iq)) 
     864    info.single = getattr(kernel_module, 'single', not callable(info.Iq)) 
    867865    info.random = getattr(kernel_module, 'random', None) 
    868866    info.hidden = getattr(kernel_module, 'hidden', None) # type: ignore 
    869867 
    870     info.lineno = {} 
    871     _find_source_lines(info, kernel_module) 
    872     if getattr(kernel_module, 'py2c', False): 
    873         try: 
    874             warnings = autoc.convert(info, kernel_module) 
    875         except Exception as exc: 
    876             warnings = [str(exc)] 
    877         if warnings: 
    878             warnings.append("while converting %s from C to python"%name) 
    879             if len(warnings) > 2: 
    880                 warnings = "\n".join(warnings) 
    881             else: 
    882                 warnings = " ".join(warnings) 
    883             logger.warn(warnings) 
    884  
    885     # Default single and opencl to True for C models.  Python models have callable Iq. 
    886     # Needs to come after autoc.convert since the Iq symbol may have been 
    887     # converted from python to C 
    888     info.opencl = getattr(kernel_module, 'opencl', not callable(info.Iq)) 
    889     info.single = getattr(kernel_module, 'single', not callable(info.Iq)) 
    890      
    891868    # Set control flag for explicitly set parameters, e.g., in the RPA model. 
    892869    control = getattr(kernel_module, 'control', None) 
     
    897874        raise ValueError("oriented python models not supported") 
    898875 
     876    info.lineno = {} 
     877    _find_source_lines(info, kernel_module) 
    899878    return info 
    900879 
Note: See TracChangeset for help on using the changeset viewer.