Ignore:
Timestamp:
Jan 11, 2017 4:19:17 AM (7 years ago)
Author:
wojciech
Children:
1b061a31
Parents:
4320104
Message:

Minor code changes to make pylint happy

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/fitting/gpu_options.py

    r4320104 r65d1d04  
    1717 
    1818class CustomMessageBox(wx.Dialog): 
     19    """ 
     20    Custom message box for OpenCL results 
     21    """ 
    1922    def __init__(self, parent, msg, title): 
    2023 
     
    2629 
    2730        self.text = wx.TextCtrl(self, -1, size=(500, 400), 
    28                            style=wx.TE_MULTILINE|wx.TE_READONLY) 
     31                                style=wx.TE_MULTILINE|wx.TE_READONLY) 
    2932        self.text.SetValue(msg) 
    3033        self.text.SetBackgroundColour(self.GetBackgroundColour()) 
     
    4043        self.vbox.Add(self.panel, 0, wx.ALL, 10) 
    4144 
    42         self.message_text = wx.StaticText(self, -1,"If tests fail on OpenCL devices, " 
    43                                 "please select No OpenCL option.\n\n" 
    44                                 "In case of large number of failing tests, " 
    45                                 "please consider sending\n" 
    46                                 "above report to help@sasview.org.") 
     45        self.message_text = wx.StaticText(self, -1, "If tests fail on OpenCL devices, " 
     46                                                    "please select No OpenCL option.\n\n" 
     47                                                    "In case of large number of failing tests, " 
     48                                                    "please consider sending\n" 
     49                                                    "above report to help@sasview.org.") 
    4750 
    4851        self.vbox.Add(self.message_text, 0, wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 10) 
     
    8790        self.buttons = [] 
    8891        #Check if SAS_OPENCL is already set as enviromental variable 
    89         self.sas_opencl = os.environ.get("SAS_OPENCL","") 
     92        self.sas_opencl = os.environ.get("SAS_OPENCL", "") 
    9093 
    9194        for clopt in clinfo: 
     
    134137        self.Bind(wx.EVT_BUTTON, self.on_help, help_btn) 
    135138 
    136         test_text = wx.StaticText(self, -1,"WARNING: Running tests can take a few minutes!") 
     139        test_text = wx.StaticText(self, -1, "WARNING: Running tests can take a few minutes!") 
    137140        self.vbox.Add(test_text, 0, wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 10) 
    138141 
     
    170173                for device in devices: 
    171174                    if len(devices) > 1 and len(platforms) > 1: 
    172                         combined_index = ":".join([str(p_index),str(d_index)]) 
     175                        combined_index = ":".join([str(p_index), str(d_index)]) 
    173176                    elif len(platforms) > 1: 
    174177                        combined_index = str(p_index) 
    175178                    else: 
    176179                        combined_index = str(d_index) 
    177                     #combined_index = ":".join([str(p_index),str(d_index)]) \ 
    178                     #    if len(platforms) > 1 else str(d_index) 
    179                     clinfo.append((combined_index, ":".join([platform.name,device.name]))) 
     180                    clinfo.append((combined_index, ":".join([platform.name, device.name]))) 
    180181                    d_index += 1 
    181182                p_index += 1 
     
    183184            warnings.warn("pyopencl import failed. Using only CPU computations") 
    184185 
    185         clinfo.append(("None","No OpenCL")) 
     186        clinfo.append(("None", "No OpenCL")) 
    186187        return clinfo 
    187188 
     
    211212        else: 
    212213            if "SAS_OPENCL" in os.environ: 
    213                 del(os.environ["SAS_OPENCL"]) 
     214                del os.environ["SAS_OPENCL"] 
    214215 
    215216        #Sasmodels kernelcl doesn't exist when initiated with None 
     
    227228            btn.SetValue(0) 
    228229 
    229         self.sas_opencl=None 
     230        self.sas_opencl = None 
    230231 
    231232    def on_test(self, event): 
     
    246247        else: 
    247248            if "SAS_OPENCL" in os.environ: 
    248                 del(os.environ["SAS_OPENCL"]) 
     249                del os.environ["SAS_OPENCL"] 
    249250 
    250251        #Sasmodels kernelcl doesn't exist when initiated with None 
     
    263264            env = environment() 
    264265            clinfo = [(ctx.devices[0].platform.vendor, 
    265                       ctx.devices[0].platform.version, 
    266                       ctx.devices[0].vendor, 
    267                       ctx.devices[0].name, 
    268                       ctx.devices[0].version) 
    269                     for ctx in env.context] 
     266                       ctx.devices[0].platform.version, 
     267                       ctx.devices[0].vendor, 
     268                       ctx.devices[0].name, 
     269                       ctx.devices[0].version) 
     270                      for ctx in env.context] 
    270271        except ImportError: 
    271272            clinfo = None 
     
    295296            msg += 'Failing tests: ' 
    296297            msg += json.dumps(info['failing tests']) 
    297             msg +="\n" 
    298         else: 
    299             msg+="All tests passed!\n" 
    300  
    301         msg +="\nPlatform Details:\n\n" 
     298            msg += "\n" 
     299        else: 
     300            msg += "All tests passed!\n" 
     301 
     302        msg += "\nPlatform Details:\n\n" 
    302303        msg += "Sasmodels version: " 
    303304        msg += info['version']+"\n" 
Note: See TracChangeset for help on using the changeset viewer.