Changeset e075203 in sasview for src/sas/sasgui


Ignore:
Timestamp:
Mar 22, 2017 8:08:56 AM (7 years ago)
Author:
krzywon
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
f6bb24d
Parents:
39f0bf4
Message:

PEP 8

Location:
src/sas/sasgui/guiframe/local_perspectives/plotting
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/guiframe/local_perspectives/plotting/Plotter2D.py

    r39f0bf4 re075203  
    532532 
    533533        """ 
    534         ## Clear current slicer 
     534        # Clear current slicer 
    535535        if not self.slicer == None: 
    536536            self.slicer.clear() 
    537         ## Create a new slicer 
     537        # Create a new slicer 
    538538        self.slicer_z += 1 
    539539        self.slicer = slicer(self, self.subplot, zorder=self.slicer_z) 
    540540        self.subplot.set_ylim(self.data2D.ymin, self.data2D.ymax) 
    541541        self.subplot.set_xlim(self.data2D.xmin, self.data2D.xmax) 
    542         ## Draw slicer 
     542        # Draw slicer 
    543543        self.update() 
    544544        self.slicer.update() 
     
    560560        """ 
    561561        self.onCircular(event, True) 
     562 
    562563    def onCircular(self, event, ismask=False): 
    563564        """ 
     
    571572        npt = math.floor(npt) 
    572573        from sas.sascalc.dataloader.manipulations import CircularAverage 
    573         ## compute the maximum radius of data2D 
     574        # compute the maximum radius of data2D 
    574575        self.qmax = max(math.fabs(self.data2D.xmax), 
    575576                        math.fabs(self.data2D.xmin)) 
     
    577578                        math.fabs(self.data2D.ymin)) 
    578579        self.radius = math.sqrt(math.pow(self.qmax, 2) + math.pow(self.ymax, 2)) 
    579         ##Compute beam width 
     580        # Compute beam width 
    580581        bin_width = (self.qmax + self.qmax) / npt 
    581         ## Create data1D circular average of data2D 
     582        # Create data1D circular average of data2D 
    582583        Circle = CircularAverage(r_min=0, r_max=self.radius, 
    583584                                 bin_width=bin_width) 
     
    598599        new_plot.name = "Circ avg " + self.data2D.name 
    599600        new_plot.source = self.data2D.source 
    600         #new_plot.info = self.data2D.info 
     601        # new_plot.info = self.data2D.info 
    601602        new_plot.interactive = True 
    602603        new_plot.detector = self.data2D.detector 
    603604 
    604         ## If the data file does not tell us what the axes are, just assume... 
     605        # If the data file does not tell us what the axes are, just assume... 
    605606        new_plot.xaxis("\\rm{Q}", "A^{-1}") 
    606607        if hasattr(self.data2D, "scale") and \ 
     
    614615        new_plot.id = "Circ avg " + self.data2D.name 
    615616        new_plot.is_data = True 
    616         self.parent.update_theory(data_id=self.data2D.id, \ 
    617                                        theory=new_plot) 
     617        self.parent.update_theory(data_id=self.data2D.id, theory=new_plot) 
    618618        wx.PostEvent(self.parent, 
    619619                     NewPlotEvent(plot=new_plot, title=new_plot.name)) 
     
    628628 
    629629        """ 
    630         if self.slicer != None: 
     630        if self.slicer is not None: 
    631631            from parameters_panel_slicer import SlicerParameterPanel 
    632632            dialog = SlicerParameterPanel(self, -1, "Slicer Parameters") 
     
    718718        Clear the slicer on the plot 
    719719        """ 
    720         if not self.slicer == None: 
     720        if self.slicer is not None: 
    721721            self.slicer.clear() 
    722722            self.subplot.figure.canvas.draw() 
     
    734734        """ 
    735735        event_id = str(evt.GetId()) 
    736         if self.parent != None: 
     736        if self.parent is not None: 
    737737            self._default_save_location = self.parent._default_save_location 
    738738        default_name = self.plots[self.graph.selected_plottable].label 
     
    757757        if default_name.count('.') > 0: 
    758758            default_name = default_name.split('.')[0] 
    759         #default_name += "_out" 
    760         if self.parent != None: 
     759        if self.parent is not None: 
    761760            self.parent.show_data2d(data, default_name) 
    762761 
    763762    def modifyGraphAppearance(self, e): 
    764         self.graphApp = graphAppearance(self, 'Modify graph appearance', legend=False) 
     763        self.graphApp = graphAppearance(self, 'Modify graph appearance', 
     764                                        legend=False) 
    765765        self.graphApp.setDefaults(self.grid_on, self.legend_on, 
    766766                                  self.xaxis_label, self.yaxis_label, 
  • src/sas/sasgui/guiframe/local_perspectives/plotting/parameters_panel_slicer.py

    r39f0bf4 re075203  
    4646        """ 
    4747        event.Skip() 
    48         if event.obj_class == None: 
     48        if event.obj_class is None: 
    4949            self.set_slicer(None, None) 
    5050        else: 
     
    5959                     wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 5) 
    6060        self.type = type 
    61         if type == None: 
     61        if type is None: 
    6262            label = "Right-click on 2D plot for slicer options" 
    6363            title = wx.StaticText(self, -1, label, style=wx.ALIGN_LEFT) 
     
    164164            try: 
    165165                params[item[0]] = float(item[1].GetValue()) 
    166                 item[1].SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)) 
     166                item[1].SetBackgroundColour( 
     167                    wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW)) 
    167168                item[1].Refresh() 
    168169            except: 
     
    171172                item[1].Refresh() 
    172173 
    173         if has_error == False: 
     174        if not has_error: 
    174175            # Post parameter event 
    175             ##parent hier is plotter2D 
     176            # parent here is plotter2D 
    176177            event = SlicerParameterEvent(type=self.type, params=params) 
    177178            wx.PostEvent(self.parent, event) 
Note: See TracChangeset for help on using the changeset viewer.