Index: src/sas/perspectives/calculator/sld_panel.py
===================================================================
--- src/sas/perspectives/calculator/sld_panel.py	(revision 33f551f41b2ed1fdbc3975c5c191f032187c77d5)
+++ src/sas/perspectives/calculator/sld_panel.py	(revision 49ab5d718dd7743a6a296e666dfb643183bc969d)
@@ -12,5 +12,5 @@
 from sas.guiframe.utils import format_number
 from sas.guiframe.utils import check_float
-from sas.guiframe.events import StatusEvent  
+from sas.guiframe.events import StatusEvent
 
 # the calculator default value for wavelength is 6
@@ -20,7 +20,7 @@
 from periodictable.xsf import xray_sld_from_atoms
 from periodictable.nsf import neutron_scattering
-from sas.perspectives.calculator import calculator_widgets as widget   
+from sas.perspectives.calculator import calculator_widgets as widget
 from sas.guiframe.documentation_window import DocumentationWindow
-       
+
 WAVELENGTH = 6.0
 _BOX_WIDTH = 76
@@ -37,5 +37,5 @@
     PANEL_SIZE = 410
     FONT_VARIANT = 1
-    
+
 class SldPanel(wx.Panel, PanelBase):
     """
@@ -48,5 +48,5 @@
     ## Flag to tell the AUI manager to put this panel in the center pane
     CENTER_PANE = True
-    
+
     def __init__(self, parent, base=None, *args, **kwds):
         """
@@ -79,5 +79,5 @@
         self.SetAutoLayout(True)
         self.Layout()
-       
+
     def _do_layout(self):
         """
@@ -99,7 +99,7 @@
         boxsizer1 = wx.StaticBoxSizer(inputbox, wx.VERTICAL)
         boxsizer1.SetMinSize((_STATICBOX_WIDTH, -1))
-        
+
         compound_txt = wx.StaticText(self, -1, 'Compound ')
-        self.compound_ctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH*2, -1))
+        self.compound_ctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH * 2, -1))
         density_txt = wx.StaticText(self, -1, 'Density ')
         self.density_ctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH, -1))
@@ -112,28 +112,28 @@
         ix = 0
         sizer_input.Add(compound_txt, (iy, ix), (1, 1),
-                             wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+                             wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
         ix += 1
         sizer_input.Add(self.compound_ctl, (iy, ix), (1, 1),
-                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+                            wx.EXPAND | wx.ADJUST_MINSIZE, 0)
         iy += 1
         ix = 0
         sizer_input.Add(density_txt, (iy, ix), (1, 1),
-                             wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+                             wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
         ix += 1
         sizer_input.Add(self.density_ctl, (iy, ix), (1, 1),
-                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
-        ix +=1
-        sizer_input.Add(unit_density_txt,(iy, ix), (1, 1),
-                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+                            wx.EXPAND | wx.ADJUST_MINSIZE, 0)
+        ix += 1
+        sizer_input.Add(unit_density_txt, (iy, ix), (1, 1),
+                            wx.EXPAND | wx.ADJUST_MINSIZE, 0)
         iy += 1
         ix = 0
         sizer_input.Add(wavelength_txt, (iy, ix), (1, 1),
-                             wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+                             wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
         ix += 1
         sizer_input.Add(self.wavelength_ctl, (iy, ix), (1, 1),
-                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+                            wx.EXPAND | wx.ADJUST_MINSIZE, 0)
         ix += 1
         sizer_input.Add(unit_a_txt, (iy, ix), (1, 1),
-                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+                            wx.EXPAND | wx.ADJUST_MINSIZE, 0)
         boxsizer1.Add(sizer_input)
         sizer1.Add(boxsizer1, 0, wx.EXPAND | wx.ALL, 10)
@@ -142,5 +142,5 @@
         boxsizer2 = wx.StaticBoxSizer(outputbox, wx.VERTICAL)
         boxsizer2.SetMinSize((_STATICBOX_WIDTH, -1))
-        
+
         i_complex = '- i'
         neutron_sld_txt = wx.StaticText(self, -1, 'Neutron SLD')
@@ -149,10 +149,10 @@
         self.neutron_sld_real_ctl.SetEditable(False)
         self.neutron_sld_real_ctl.SetToolTipString("Neutron SLD real.")
-        self.neutron_sld_im_ctl = wx.TextCtrl(self, -1, 
+        self.neutron_sld_im_ctl = wx.TextCtrl(self, -1,
                                               size=(_BOX_WIDTH, -1))
         self.neutron_sld_im_ctl.SetEditable(False)
         self.neutron_sld_im_ctl.SetToolTipString("Neutron SLD imaginary.")
         neutron_sld_units_txt = wx.StaticText(self, -1, unit_sld)
-        
+
         cu_ka_sld_txt = wx.StaticText(self, -1, 'Cu Ka SLD')
         self.cu_ka_sld_real_ctl = wx.TextCtrl(self, -1,
@@ -160,10 +160,10 @@
         self.cu_ka_sld_real_ctl.SetEditable(False)
         self.cu_ka_sld_real_ctl.SetToolTipString("Cu Ka SLD real.")
-        self.cu_ka_sld_im_ctl = wx.TextCtrl(self, -1, 
+        self.cu_ka_sld_im_ctl = wx.TextCtrl(self, -1,
                                             size=(_BOX_WIDTH, -1))
         self.cu_ka_sld_im_ctl.SetEditable(False)
         self.cu_ka_sld_im_ctl.SetToolTipString("Cu Ka SLD imaginary.")
         cu_ka_sld_units_txt = wx.StaticText(self, -1, unit_sld)
-        
+
         mo_ka_sld_txt = wx.StaticText(self, -1, 'Mo Ka SLD')
         self.mo_ka_sld_real_ctl = wx.TextCtrl(self, -1,
@@ -176,5 +176,5 @@
         self.mo_ka_sld_im_ctl.SetToolTipString("Mo Ka SLD imaginary.")
         mo_ka_sld_units_txt = wx.StaticText(self, -1, unit_sld)
-        
+
         neutron_inc_txt = wx.StaticText(self, -1, 'Neutron Inc. Xs')
         self.neutron_inc_ctl = wx.TextCtrl(self, -1,
@@ -182,13 +182,13 @@
         self.neutron_inc_ctl.SetEditable(False)
         self.neutron_inc_ctl.SetToolTipString("Neutron Inc. Xs")
-        neutron_inc_units_txt = wx.StaticText(self, -1,  unit_cm1)
-       
-        neutron_abs_txt = wx.StaticText(self, -1, 'Neutron Abs. Xs')     
-        self.neutron_abs_ctl = wx.TextCtrl(self, -1, 
+        neutron_inc_units_txt = wx.StaticText(self, -1, unit_cm1)
+
+        neutron_abs_txt = wx.StaticText(self, -1, 'Neutron Abs. Xs')
+        self.neutron_abs_ctl = wx.TextCtrl(self, -1,
                                            size=(_BOX_WIDTH, -1))
         self.neutron_abs_ctl.SetEditable(False)
         self.neutron_abs_ctl.SetToolTipString("Neutron Abs. Xs")
-        neutron_abs_units_txt = wx.StaticText(self, -1,  unit_cm1)
-      
+        neutron_abs_units_txt = wx.StaticText(self, -1, unit_cm1)
+
         neutron_length_txt = wx.StaticText(self, -1, 'Neutron 1/e length')
         self.neutron_length_ctl = wx.TextCtrl(self, -1,
@@ -196,146 +196,146 @@
         self.neutron_length_ctl.SetEditable(False)
         self.neutron_length_ctl.SetToolTipString("Neutron 1/e length")
-        neutron_length_units_txt = wx.StaticText(self, -1,  unit_cm)
-      
+        neutron_length_units_txt = wx.StaticText(self, -1, unit_cm)
+
         iy = 0
         ix = 0
         sizer_output.Add(neutron_sld_txt, (iy, ix), (1, 1),
-                             wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+                             wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
         ix += 1
         sizer_output.Add(self.neutron_sld_real_ctl, (iy, ix), (1, 1),
-                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+                            wx.EXPAND | wx.ADJUST_MINSIZE, 0)
         ix += 1
         sizer_output.Add(wx.StaticText(self, -1, i_complex),
-                         (iy, ix), (1, 1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+                         (iy, ix), (1, 1), wx.EXPAND | wx.ADJUST_MINSIZE, 0)
         ix += 1
         sizer_output.Add(self.neutron_sld_im_ctl,
-                         (iy, ix), (1, 1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+                         (iy, ix), (1, 1), wx.EXPAND | wx.ADJUST_MINSIZE, 0)
         ix += 1
         sizer_output.Add(neutron_sld_units_txt,
-                         (iy, ix), (1, 1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+                         (iy, ix), (1, 1), wx.EXPAND | wx.ADJUST_MINSIZE, 0)
         iy += 1
         ix = 0
         sizer_output.Add(cu_ka_sld_txt, (iy, ix), (1, 1),
-                             wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+                             wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
         ix += 1
         sizer_output.Add(self.cu_ka_sld_real_ctl, (iy, ix), (1, 1),
-                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+                            wx.EXPAND | wx.ADJUST_MINSIZE, 0)
         ix += 1
         sizer_output.Add(wx.StaticText(self, -1, i_complex),
-                         (iy, ix), (1, 1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+                         (iy, ix), (1, 1), wx.EXPAND | wx.ADJUST_MINSIZE, 0)
         ix += 1
         sizer_output.Add(self.cu_ka_sld_im_ctl,
-                         (iy, ix), (1, 1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)  
+                         (iy, ix), (1, 1), wx.EXPAND | wx.ADJUST_MINSIZE, 0)
         ix += 1
         sizer_output.Add(cu_ka_sld_units_txt,
-                         (iy, ix), (1, 1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
-        iy += 1
-        ix = 0
-        sizer_output.Add(mo_ka_sld_txt,(iy, ix), (1, 1),
-                             wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
-        ix += 1
-        sizer_output.Add(self.mo_ka_sld_real_ctl,(iy, ix), (1, 1),
-                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+                         (iy, ix), (1, 1), wx.EXPAND | wx.ADJUST_MINSIZE, 0)
+        iy += 1
+        ix = 0
+        sizer_output.Add(mo_ka_sld_txt, (iy, ix), (1, 1),
+                             wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
+        ix += 1
+        sizer_output.Add(self.mo_ka_sld_real_ctl, (iy, ix), (1, 1),
+                            wx.EXPAND | wx.ADJUST_MINSIZE, 0)
         ix += 1
         sizer_output.Add(wx.StaticText(self, -1, i_complex),
-                         (iy, ix), (1, 1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+                         (iy, ix), (1, 1), wx.EXPAND | wx.ADJUST_MINSIZE, 0)
         ix += 1
         sizer_output.Add(self.mo_ka_sld_im_ctl,
-                         (iy, ix), (1, 1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)  
+                         (iy, ix), (1, 1), wx.EXPAND | wx.ADJUST_MINSIZE, 0)
         ix += 1
         sizer_output.Add(mo_ka_sld_units_txt,
-                         (iy, ix), (1, 1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+                         (iy, ix), (1, 1), wx.EXPAND | wx.ADJUST_MINSIZE, 0)
         iy += 1
         ix = 0
         sizer_output.Add(neutron_inc_txt, (iy, ix), (1, 1),
-                             wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+                             wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
         ix += 1
         sizer_output.Add(self.neutron_inc_ctl, (iy, ix), (1, 1),
-                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+                            wx.EXPAND | wx.ADJUST_MINSIZE, 0)
         ix += 2
-        sizer_output.Add(neutron_inc_units_txt,(iy, ix), (1, 1),
-                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        sizer_output.Add(neutron_inc_units_txt, (iy, ix), (1, 1),
+                            wx.EXPAND | wx.ADJUST_MINSIZE, 0)
         iy += 1
         ix = 0
         sizer_output.Add(neutron_abs_txt, (iy, ix), (1, 1),
-                             wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+                             wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
         ix += 1
         sizer_output.Add(self.neutron_abs_ctl, (iy, ix), (1, 1),
-                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+                            wx.EXPAND | wx.ADJUST_MINSIZE, 0)
         ix += 2
         sizer_output.Add(neutron_abs_units_txt, (iy, ix), (1, 1),
-                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+                            wx.EXPAND | wx.ADJUST_MINSIZE, 0)
         iy += 1
         ix = 0
         sizer_output.Add(neutron_length_txt, (iy, ix), (1, 1),
-                             wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+                             wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
         ix += 1
         sizer_output.Add(self.neutron_length_ctl, (iy, ix), (1, 1),
-                            wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+                            wx.EXPAND | wx.ADJUST_MINSIZE, 0)
         ix += 2
         sizer_output.Add(neutron_length_units_txt, (iy, ix), (1, 1),
-                            wx.EXPAND|wx.ADJUST_MINSIZE, 0)  
+                            wx.EXPAND | wx.ADJUST_MINSIZE, 0)
         boxsizer2.Add(sizer_output)
-        sizer2.Add(boxsizer2, 0, wx.EXPAND|wx.ALL, 10)
+        sizer2.Add(boxsizer2, 0, wx.EXPAND | wx.ALL, 10)
         #-----Button  sizer------------
-    
+
         id = wx.NewId()
         self.button_calculate = wx.Button(self, id, "Calculate")
         self.button_calculate.SetToolTipString("Calculate SLD.")
-        self.Bind(wx.EVT_BUTTON, self.calculateSld, id=id)   
-        
+        self.Bind(wx.EVT_BUTTON, self.calculateSld, id=id)
+
         id = wx.NewId()
         self.button_help = wx.Button(self, id, "HELP")
         self.button_help.SetToolTipString("help on SLD calculator.")
-        self.Bind(wx.EVT_BUTTON, self.on_help, id=id)   
-        
-        sizer_button.Add((150, 20), 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-        sizer_button.Add(self.button_calculate, 0, wx.RIGHT|wx.ADJUST_MINSIZE, 20)
-        sizer_button.Add(self.button_help, 0, wx.RIGHT|wx.ADJUST_MINSIZE, 20)
+        self.Bind(wx.EVT_BUTTON, self.on_help, id=id)
+
+        sizer_button.Add((150, 20), 1, wx.EXPAND | wx.ADJUST_MINSIZE, 0)
+        sizer_button.Add(self.button_calculate, 0, wx.RIGHT | wx.ADJUST_MINSIZE, 20)
+        sizer_button.Add(self.button_help, 0, wx.RIGHT | wx.ADJUST_MINSIZE, 20)
         sizer3.Add(sizer_button)
         #---------layout----------------
-        vbox  = wx.BoxSizer(wx.VERTICAL)
+        vbox = wx.BoxSizer(wx.VERTICAL)
         vbox.Add(sizer1)
         vbox.Add(sizer2)
         vbox.Add(sizer3)
-        vbox.Fit(self) 
+        vbox.Fit(self)
         self.SetSizer(vbox)
-        
-    def on_help(self, event):    
+
+    def on_help(self, event):
         """
         Bring up the SLD Documentation whenever
-        the HELP button is clicked. 
-        
+        the HELP button is clicked.
+
         Calls DocumentationWindow with the path of the location within the
-        documentation tree (after /doc/ ....".  Note that when using old 
-        versions of Wx (before 2.9) and thus not the release version of 
-        installers, the help comes up at the top level of the file as 
+        documentation tree (after /doc/ ....".  Note that when using old
+        versions of Wx (before 2.9) and thus not the release version of
+        installers, the help comes up at the top level of the file as
         webbrowser does not pass anything past the # to the browser when it is
         running "file:///...."
-    
+
     :param evt: Triggers on clicking the help button
     """
-                
+
         _TreeLocation = "user/perspectives/calculator/sld_calculator_help.html"
         _doc_viewer = DocumentationWindow(self, -1, \
-             _TreeLocation,"General Scattering Calculator Help")
+             _TreeLocation, "General Scattering Calculator Help")
 
     def calculate_xray_sld(self, element):
         """
         Get an element and compute the corresponding SLD for a given formula
-        
+
         :param element:  elements a string of existing atom
-        
+
         """
         myformula = formula(str(element))
         if len(myformula.atoms) != 1:
-            return 
-        element = myformula.atoms.keys()[0] 
+            return
+        element = myformula.atoms.keys()[0]
         energy = xray_energy(element.K_alpha)
-        
+
         self.sld_formula = formula(str(self.compound), density=self.density)
         atom = self.sld_formula.atoms
-        return xray_sld_from_atoms(atom, density=self.density, energy= energy)
-    
+        return xray_sld_from_atoms(atom, density=self.density, energy=energy)
+
     def check_inputs(self):
         """Check validity user inputs"""
@@ -347,5 +347,5 @@
             flag = False
             msg += "Error for Density value :expect float"
-    
+
         self.wavelength = self.wavelength_ctl.GetValue()
         if str(self.wavelength).lstrip().rstrip() == "":
@@ -361,5 +361,5 @@
                 flag = False
                 msg += "Error for wavelength value :expect float"
-                
+
         self.compound = self.compound_ctl.GetValue().lstrip().rstrip()
         if self.compound != "":
@@ -379,16 +379,16 @@
             msg += "Enter a formula"
         return flag, msg
-        
+
     def calculate_sld_helper(self, element, density, molecule_formula):
         """
         Get an element and compute the corresponding SLD for a given formula
-        
+
         :param element:  elements a string of existing atom
-        
+
         """
         element_formula = formula(str(element))
         if len(element_formula.atoms) != 1:
-            return 
-        element = element_formula.atoms.keys()[0] 
+            return
+        element = element_formula.atoms.keys()[0]
         energy = xray_energy(element.K_alpha)
         atom = molecule_formula.atoms
@@ -408,5 +408,5 @@
                 wx.PostEvent(self.base, StatusEvent(status=msg))
             if not flag:
-               return 
+               return
             #get ready to compute
             self.sld_formula = formula(self.compound,
@@ -414,10 +414,10 @@
             (sld_real, sld_im, _), (_, absorp, incoh), \
                         length = neutron_scattering(compound=self.compound,
-                                   density=self.density, 
-                                   wavelength=self.wavelength) 
+                                   density=self.density,
+                                   wavelength=self.wavelength)
             cu_real, cu_im = self.calculate_sld_helper(element="Cu",
                                                  density=self.density,
                                         molecule_formula=self.sld_formula)
-            mo_real, mo_im = self.calculate_sld_helper(element="Mo", 
+            mo_real, mo_im = self.calculate_sld_helper(element="Mo",
                                                        density=self.density,
                                      molecule_formula=self.sld_formula)
@@ -428,10 +428,10 @@
             self.neutron_sld_im_ctl.SetValue(val)
             # Compute the Cu SLD
-            self.cu_ka_sld_real_ctl.SetValue(format_number(cu_real *_SCALE))
-            val = format_number(math.fabs(cu_im )* _SCALE)
+            self.cu_ka_sld_real_ctl.SetValue(format_number(cu_real * _SCALE))
+            val = format_number(math.fabs(cu_im) * _SCALE)
             self.cu_ka_sld_im_ctl.SetValue(val)
             # Compute the Mo SLD
-            self.mo_ka_sld_real_ctl.SetValue(format_number(mo_real *_SCALE))
-            val = format_number(math.fabs(mo_im)* _SCALE)
+            self.mo_ka_sld_real_ctl.SetValue(format_number(mo_real * _SCALE))
+            val = format_number(math.fabs(mo_im) * _SCALE)
             self.mo_ka_sld_im_ctl.SetValue(val)
             # set incoherence and absorption
@@ -444,9 +444,9 @@
         except:
             if self.base is not None:
-                msg = "SLD Calculator: %s"%(sys.exc_value)
+                msg = "SLD Calculator: %s" % (sys.exc_value)
                 wx.PostEvent(self.base, StatusEvent(status=msg))
         if event is not None:
             event.Skip()
-            
+
     def clear_outputs(self):
         """
@@ -462,11 +462,11 @@
         self.neutron_inc_ctl.SetValue("")
         self.neutron_length_ctl.SetValue("")
-        
-        
+
+
 class SldWindow(widget.CHILD_FRAME):
     """
     """
     def __init__(self, parent=None, title="SLD Calculator",
-                  base=None, manager=None, 
+                  base=None, manager=None,
                   size=(PANEL_SIZE, PANEL_SIZE), *args, **kwds):
         """
@@ -484,5 +484,5 @@
         self.SetPosition((20, 10))
         self.Show(True)
-    
+
     def on_close(self, event):
         """
@@ -492,6 +492,6 @@
             self.manager.sld_frame = None
         self.Destroy()
-        
-        
+
+
 class ViewApp(wx.App):
     """
@@ -501,11 +501,11 @@
         """
         widget.CHILD_FRAME = wx.Frame
-        frame = SldWindow(None, title='SLD Calculator')    
+        frame = SldWindow(None, title='SLD Calculator')
         frame.Show(True)
         self.SetTopWindow(frame)
         return True
-        
-
-if __name__ == "__main__": 
+
+
+if __name__ == "__main__":
     app = ViewApp(0)
-    app.MainLoop()     
+    app.MainLoop()
