Changeset a261a83 in sasmodels for sasmodels/generate.py
- Timestamp:
- Nov 30, 2017 12:25:06 AM (6 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 7dde87f
- Parents:
- 0b07b91 (diff), 10ee838 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/generate.py
rff31782 ra261a83 163 163 164 164 import sys 165 from os.path import abspath, dirname, join as joinpath, exists, isdir,getmtime165 from os.path import abspath, dirname, join as joinpath, exists, getmtime 166 166 import re 167 167 import string … … 174 174 from .custom import load_custom_kernel_module 175 175 176 # pylint: disable=unused-import 176 177 try: 177 178 from typing import Tuple, Sequence, Iterator, Dict … … 179 180 except ImportError: 180 181 pass 182 # pylint: enable=unused-import 181 183 182 184 # jitter projection to use in the kernel code. See explore/jitter.py … … 672 674 line instead. 673 675 """ 674 for path, code in sources:676 for _path, code in sources: 675 677 if _IQXY_PATTERN.search(code): 676 678 return True 677 else: 678 return False 679 return False 679 680 680 681 … … 790 791 # TODO: allow mixed python/opencl kernels? 791 792 792 ocl = kernels(kernel_code, call_iq, call_iqxy, clear_iqxy, model_info.name)793 dll = kernels(kernel_code, call_iq, call_iqxy, clear_iqxy, model_info.name)793 ocl = _kernels(kernel_code, call_iq, call_iqxy, clear_iqxy, model_info.name) 794 dll = _kernels(kernel_code, call_iq, call_iqxy, clear_iqxy, model_info.name) 794 795 result = { 795 796 'dll': '\n'.join(source+dll[0]+dll[1]+dll[2]), … … 800 801 801 802 802 def kernels(kernel, call_iq, call_iqxy, clear_iqxy, name):803 def _kernels(kernel, call_iq, call_iqxy, clear_iqxy, name): 803 804 # type: ([str,str], str, str, str) -> List[str] 804 805 code = kernel[0] … … 949 950 950 951 def make_html(model_info): 952 # type: (ModelInfo) -> str 951 953 """ 952 954 Convert model docs directly to html. … … 958 960 959 961 def view_html(model_name): 962 # type: (str) -> None 963 """ 964 Load the model definition and view its help. 965 """ 960 966 from . import modelinfo 961 967 kernel_module = load_kernel_module(model_name) … … 964 970 965 971 def view_html_from_info(info): 972 # type: (ModelInfo) -> None 973 """ 974 View the help for a loaded model definition. 975 """ 966 976 from . import rst2html 967 977 url = "file://"+dirname(info.filename)+"/" … … 988 998 Program which prints the source produced by the model. 989 999 """ 990 import sys991 1000 from .modelinfo import make_model_info 992 1001
Note: See TracChangeset
for help on using the changeset viewer.