Changes in / [8803a38:2c4a190] in sasmodels
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/guide/plugin.rst
r9d8a027 r57c609b 272 272 structure factor to account for interactions between particles. See 273 273 `Form_Factors`_ for more details. 274 275 **model_info = ...** lets you define a model directly, for example, by276 loading and modifying existing models. This is done implicitly by277 :func:`sasmodels.core.load_model_info`, which can create a mixture model278 from a pair of existing models. For example::279 280 from sasmodels.core import load_model_info281 model_info = load_model_info('sphere+cylinder')282 283 See :class:`sasmodels.modelinfo.ModelInfo` for details about the model284 attributes that are defined.285 274 286 275 Model Parameters -
sasmodels/sasview_model.py
ra4f1a73 rbd547d0 25 25 from . import core 26 26 from . import custom 27 from . import kernelcl28 27 from . import product 29 28 from . import generate … … 31 30 from . import modelinfo 32 31 from .details import make_kernel_args, dispersion_mesh 33 from .kernelcl import reset_environment34 32 35 33 # pylint: disable=unused-import … … 70 68 #: has changed since we last reloaded. 71 69 _CACHED_MODULE = {} # type: Dict[str, "module"] 72 73 def reset_environment():74 # type: () -> None75 """76 Clear the compute engine context so that the GUI can change devices.77 78 This removes all compiled kernels, even those that are active on fit79 pages, but they will be restored the next time they are needed.80 """81 kernelcl.reset_environment()82 for model in MODELS.values():83 model._model = None84 70 85 71 def find_model(modelname): … … 694 680 def _calculate_Iq(self, qx, qy=None): 695 681 if self._model is None: 696 # Only need one copy of the compiled kernel regardless of how many 697 # times it is used, so store it in the class. Also, to reset the 698 # compute engine, need to clear out all existing compiled kernels, 699 # which is much easier to do if we store them in the class. 700 self.__class__._model = core.build_model(self._model_info) 682 self._model = core.build_model(self._model_info) 701 683 if qy is not None: 702 684 q_vectors = [np.asarray(qx), np.asarray(qy)]
Note: See TracChangeset
for help on using the changeset viewer.