Changeset 1580cc3 in sasview for src/sas/sasgui/perspectives
- Timestamp:
- Nov 13, 2018 12:52:30 PM (6 years ago)
- Branches:
- ticket-1094-headless
- Children:
- ffbf35ee
- Parents:
- 1dc134e6 (diff), f560e23 (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. - Location:
- src/sas/sasgui/perspectives/fitting
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/basepage.py
ra4a1ac9 r5323490 2884 2884 self.magnetic_on = True 2885 2885 button.SetLabel("Magnetic OFF") 2886 m_value = 1 .0e-062886 m_value = 1 2887 2887 for key in self.model.magnetic_params: 2888 2888 if key.count('M0') > 0: 2889 2889 self.model.setParam(key, m_value) 2890 m_value += 0.5 e-062890 m_value += 0.5 2891 2891 else: 2892 2892 self.magnetic_on = False -
src/sas/sasgui/perspectives/fitting/gpu_options.py
r388aefb r8e109f9 8 8 ''' 9 9 10 import json 11 import platform 10 12 import logging 11 13 import os 12 14 import sys 15 13 16 import wx 17 18 try: 19 import pyopencl as cl 20 except ImportError: 21 cl = None 22 14 23 import sasmodels 24 import sasmodels.model_test 25 import sasmodels.kernelcl 26 15 27 from sas.sasgui.guiframe.documentation_window import DocumentationWindow 16 28 … … 169 181 clinfo = [] 170 182 platforms = [] 171 try: 172 import pyopencl as cl 173 platforms = cl.get_platforms() 174 except ImportError: 183 184 if cl is None: 175 185 logger.warn("Unable to import the pyopencl package. It may not " 176 186 "have been installed. If you wish to use OpenCL, try " 177 187 "running pip install --user pyopencl") 178 except cl.LogicError as err: 179 logger.warn("Unable to fetch the OpenCL platforms. This likely " 180 "means that the opencl drivers for your system are " 181 "not installed.") 182 logger.warn(err) 188 else: 189 try: 190 platforms = cl.get_platforms() 191 except cl.LogicError as err: 192 logger.warn("Unable to fetch the OpenCL platforms. This likely " 193 "means that the opencl drivers for your system are " 194 "not installed.") 195 logger.warn(err) 183 196 184 197 p_index = 0 … … 226 239 if "SAS_OPENCL" in os.environ: 227 240 del os.environ["SAS_OPENCL"] 228 229 #Sasmodels kernelcl doesn't exist when initiated with None 230 if 'sasmodels.kernelcl' in sys.modules: 231 sasmodels.kernelcl.ENV = None 232 233 reload(sasmodels.core) 241 sasmodels.kernelcl.reset_environment() 234 242 event.Skip() 235 243 … … 247 255 Run sasmodels check from here and report results from 248 256 """ 249 import json250 import platform251 #import sasmodels252 253 257 #The same block of code as for OK but it is needed if we want to have 254 258 #active response to Test button … … 261 265 if "SAS_OPENCL" in os.environ: 262 266 del os.environ["SAS_OPENCL"] 263 264 #Sasmodels kernelcl doesn't exist when initiated with None 265 if 'sasmodels.kernelcl' in sys.modules: 266 sasmodels.kernelcl.ENV = None 267 268 269 #Need to reload sasmodels.core module to account SAS_OPENCL = "None" 270 reload(sasmodels.core) 271 272 273 from sasmodels.model_test import model_tests 267 sasmodels.kernelcl.reset_environment() 274 268 275 269 try: 276 from sasmodels.kernelcl import environment 277 env = environment() 270 env = sasmodels.kernelcl.environment() 278 271 clinfo = [(ctx.devices[0].platform.vendor, 279 272 ctx.devices[0].platform.version, … … 282 275 ctx.devices[0].version) 283 276 for ctx in env.context] 284 except ImportError:277 except Exception: 285 278 clinfo = None 286 279 287 280 failures = [] 288 281 tests_completed = 0 289 for test in model_tests():282 for test in sasmodels.model_test.model_tests(): 290 283 try: 291 284 test() -
src/sas/sasgui/perspectives/fitting/fitpage.py
rba1c145 r1dc134e6 52 52 # draw sizer 53 53 self._fill_data_sizer() 54 self.is_2D = None55 54 self.fit_started = False 56 55 self.weightbt_string = None
Note: See TracChangeset
for help on using the changeset viewer.