Changeset a54e4be in sasview for guiframe/local_perspectives


Ignore:
Timestamp:
Nov 23, 2010 11:31:25 AM (14 years ago)
Author:
Gervaise Alina <gervyh@…>
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.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
4a7ad5f
Parents:
32c0841
Message:

working on pylint

File:
1 edited

Legend:

Unmodified
Added
Removed
  • guiframe/local_perspectives/plotting/profile_dialog.py

    r519c693 ra54e4be  
     1 
     2 
     3 
    14import wx 
    25import sys 
    3  
    46from copy import deepcopy 
    57from danse.common.plottools.plottables import Graph 
     8from Plotter1D import ModelPanel1D as PlotPanel 
    69from sans.guiframe.dataFitting import Theory1D 
    710import pylab 
    811 
    9 DEFAULT_CMAP= pylab.cm.jet 
    10  
     12DEFAULT_CMAP = pylab.cm.jet 
    1113_BOX_WIDTH = 76 
    1214_STATICBOX_WIDTH = 400 
     
    2325    FONT_VARIANT = 1 
    2426     
    25  
    26              
     27      
    2728class SLDPanel(wx.Dialog): 
    2829    """ 
     
    3536    ## Flag to tell the AUI manager to put this panel in the center pane 
    3637    CENTER_PANE = True 
    37     def __init__(self, parent=None,base=None,data =None,axes =['Radius'],  
    38                  id = -1, *args, **kwds): 
    39         kwds["style"] =  wx.DEFAULT_DIALOG_STYLE 
    40         kwds["size"] = wx.Size(_STATICBOX_WIDTH,PANEL_SIZE)  
    41         wx.Dialog.__init__(self, parent, id = id, *args, **kwds) 
     38    def __init__(self, parent=None, base=None, data=None, axes =['Radius'],  
     39                 id=-1, *args, **kwds): 
     40        kwds["style"] = wx.DEFAULT_DIALOG_STYLE 
     41        kwds["size"] = wx.Size(_STATICBOX_WIDTH, PANEL_SIZE)  
     42        wx.Dialog.__init__(self, parent, id=id, *args, **kwds) 
    4243 
    4344        if data != None: 
    44              
    4545            #Font size  
    46             kwds =[] 
     46            kwds = [] 
    4747            self.SetWindowVariant(variant=FONT_VARIANT) 
    48  
    4948            self.SetTitle("Scattering Length Density Profile") 
    5049            self.parent = base 
    5150            self.data = data 
    5251            self.str = self.data.__str__() 
    53  
    5452            ## when 2 data have the same id override the 1 st plotted 
    5553            self.name = self.data.name 
    56              
    5754            # Panel for plot 
    58             self.plotpanel    = SLDplotpanel(self, axes, -1,  
    59                                              style = wx.TRANSPARENT_WINDOW) 
     55            self.plotpanel = SLDplotpanel(self, axes, -1,  
     56                                             style=wx.TRANSPARENT_WINDOW) 
    6057            self.cmap = DEFAULT_CMAP 
    6158            ## Create Artist and bind it 
     
    6663            data_plot = deepcopy(self.data) 
    6764            data_plot.dy = self._set_dy_data() 
    68             self.newplot=Theory1D(data_plot.x,data_plot.y,data_plot.dy) 
     65            self.newplot = Theory1D(data_plot.x, data_plot.y, data_plot.dy) 
    6966            self.newplot.name = 'SLD' 
    7067            self.plotpanel.add_image(self.newplot)  
    71  
    7268            self.Centre() 
    7369            self.Layout() 
    7470 
    75              
    7671    def _set_dy_data(self):  
    7772        """ 
     
    8176        """ 
    8277        # set dy as zero 
    83         dy = [ 0 for y in self.data.y] 
     78        dy = [0 for y in self.data.y] 
    8479        return dy       
    8580     
     
    9085        # panel sizer 
    9186        sizer = wx.BoxSizer(wx.VERTICAL) 
    92         sizer.Add(self.plotpanel,-1, wx.LEFT|wx.RIGHT, 5) 
    93         sizer.Add((0,10)) 
     87        sizer.Add(self.plotpanel, -1, wx.LEFT|wx.RIGHT, 5) 
     88        sizer.Add((0, 10)) 
    9489        #-----Button------------1 
    9590        id = wx.NewId() 
     
    9792        button_reset.SetToolTipString("Close...") 
    9893        button_reset.Bind(wx.EVT_BUTTON, self._close,  
    99                           id = button_reset.GetId())  
     94                          id=button_reset.GetId())  
    10095        sizer.Add(button_reset, 0, wx.LEFT, _STATICBOX_WIDTH - 80)  
    101         sizer.Add((0,10)) 
    102          
     96        sizer.Add((0, 10)) 
    10397        self.SetSizerAndFit(sizer) 
    104          
    10598        self.Centre() 
    10699        self.Show(True) 
     
    111104        Close the dialog 
    112105        """ 
    113          
    114106        self.Close(True) 
    115107 
    116     def _draw_model(self,event): 
     108    def _draw_model(self, event): 
    117109        """ 
    118110         on_close, update the model2d plot 
     
    131123        return [] 
    132124     
    133 from Plotter1D import ModelPanel1D as PlotPanel 
     125 
    134126class SLDplotpanel(PlotPanel): 
    135127    """ 
    136128    Panel 
    137129    """ 
    138     def __init__(self, parent,axes = [], id = -1, color = None, dpi = None, 
     130    def __init__(self, parent, axes=[], id=-1, color=None, dpi=None, 
    139131                  **kwargs): 
    140132        """ 
    141133        """ 
    142         PlotPanel.__init__(self, parent, id=id, xtransform = 'x', ytransform = 'y',  
    143                            color = color, dpi = dpi,  
    144                            size = (_STATICBOX_WIDTH, PANEL_SIZE-100), **kwargs) 
     134        PlotPanel.__init__(self, parent, id=id, xtransform='x', ytransform='y',  
     135                           color=color, dpi=dpi,  
     136                           size=(_STATICBOX_WIDTH, PANEL_SIZE-100), **kwargs) 
    145137 
    146138        # Keep track of the parent Frame 
     
    167159        self.graph.xaxis('\\rm{%s} '% x1_label, 'A') 
    168160        self.graph.yaxis('\\rm{SLD} ', 'A^{-2}') 
    169  
    170161        #draw 
    171162        self.graph.render(self) 
     
    201192        # Initialize the Frame object 
    202193        wx.Frame.__init__(self, parent, id, title, wx.DefaultPosition,  
    203                           wx.Size(_STATICBOX_WIDTH,PANEL_SIZE)) 
    204          
     194                          wx.Size(_STATICBOX_WIDTH, PANEL_SIZE)) 
    205195        # Panel for 1D plot 
    206         self.plotpanel    = SLDplotpanel(self, -1, style = wx.RAISED_BORDER) 
     196        self.plotpanel    = SLDplotpanel(self, -1, style=wx.RAISED_BORDER) 
    207197 
    208198class ViewApp(wx.App): 
Note: See TracChangeset for help on using the changeset viewer.