Changeset f619de7 in sasmodels for sasmodels/core.py
- Timestamp:
- Apr 11, 2016 9:14:50 AM (8 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 7ae2b7f
- Parents:
- 9a943d0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/core.py
r6d6508e rf619de7 26 26 HAVE_OPENCL = False 27 27 28 try: 29 from typing import List, Union, Optional, Any 30 DType = Union[None, str, np.dtype] 31 from .kernel import KernelModel 32 except ImportError: 33 pass 34 35 28 36 # TODO: refactor composite model support 29 37 # The current load_model_info/build_model does not reuse existing model … … 39 47 40 48 def list_models(): 49 # type: () -> List[str] 41 50 """ 42 51 Return the list of available models on the model path. … … 48 57 49 58 def isstr(s): 59 # type: (Any) -> bool 50 60 """ 51 61 Return True if *s* is a string-like object. … … 55 65 return True 56 66 57 def load_model(model_name, **kw): 67 def load_model(model_name, dtype=None, platform='ocl'): 68 # type: (str, DType, str) -> KernelModel 58 69 """ 59 70 Load model info and build model. 71 72 *model_name* is the name of the model as used by :func:`load_model_info`. 73 Additional keyword arguments are passed directly to :func:`build_model`. 60 74 """ 61 return build_model(load_model_info(model_name), **kw) 75 return build_model(load_model_info(model_name), 76 dtype=dtype, platform=platform) 62 77 63 78 64 79 def load_model_info(model_name): 80 # type: (str) -> modelinfo.ModelInfo 65 81 """ 66 82 Load a model definition given the model name. … … 86 102 87 103 def build_model(model_info, dtype=None, platform="ocl"): 104 # type: (modelinfo.ModelInfo, DType, str) -> KernelModel 88 105 """ 89 106 Prepare the model for the default execution platform. … … 138 155 139 156 def precompile_dll(model_name, dtype="double"): 157 # type: (str, DType) -> Optional[str] 140 158 """ 141 159 Precompile the dll for a model.
Note: See TracChangeset
for help on using the changeset viewer.