Changeset 899e050 in sasmodels
- Timestamp:
- Nov 29, 2018 6:52:34 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:
- c11d09f
- Parents:
- 9d8a027 (diff), a4f1a73 (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. - git-author:
- Wojciech Potrzebowski <Wojciech.Potrzebowski@…> (11/29/18 06:52:34)
- git-committer:
- GitHub <noreply@…> (11/29/18 06:52:34)
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/sasview_model.py
rce1eed5 ra4f1a73 25 25 from . import core 26 26 from . import custom 27 from . import kernelcl 27 28 from . import product 28 29 from . import generate … … 30 31 from . import modelinfo 31 32 from .details import make_kernel_args, dispersion_mesh 33 from .kernelcl import reset_environment 32 34 33 35 # pylint: disable=unused-import … … 68 70 #: has changed since we last reloaded. 69 71 _CACHED_MODULE = {} # type: Dict[str, "module"] 72 73 def reset_environment(): 74 # type: () -> None 75 """ 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 fit 79 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 = None 70 84 71 85 def find_model(modelname): … … 680 694 def _calculate_Iq(self, qx, qy=None): 681 695 if self._model is None: 682 self._model = core.build_model(self._model_info) 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) 683 701 if qy is not None: 684 702 q_vectors = [np.asarray(qx), np.asarray(qy)] -
doc/guide/plugin.rst
r57c609b r9d8a027 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, by 276 loading and modifying existing models. This is done implicitly by 277 :func:`sasmodels.core.load_model_info`, which can create a mixture model 278 from a pair of existing models. For example:: 279 280 from sasmodels.core import load_model_info 281 model_info = load_model_info('sphere+cylinder') 282 283 See :class:`sasmodels.modelinfo.ModelInfo` for details about the model 284 attributes that are defined. 274 285 275 286 Model Parameters
Note: See TracChangeset
for help on using the changeset viewer.