Changes in / [899e050:9d8a027] in sasmodels


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/sasview_model.py

    ra4f1a73 rbd547d0  
    2525from . import core 
    2626from . import custom 
    27 from . import kernelcl 
    2827from . import product 
    2928from . import generate 
     
    3130from . import modelinfo 
    3231from .details import make_kernel_args, dispersion_mesh 
    33 from .kernelcl import reset_environment 
    3432 
    3533# pylint: disable=unused-import 
     
    7068#: has changed since we last reloaded. 
    7169_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 
    8470 
    8571def find_model(modelname): 
     
    694680    def _calculate_Iq(self, qx, qy=None): 
    695681        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) 
    701683        if qy is not None: 
    702684            q_vectors = [np.asarray(qx), np.asarray(qy)] 
Note: See TracChangeset for help on using the changeset viewer.