Index: src/sas/sascalc/dataloader/readers/cansas_reader.py
===================================================================
--- src/sas/sascalc/dataloader/readers/cansas_reader.py	(revision 61f329f00cdb8b300656d1c1feb4e78f35e59745)
+++ src/sas/sascalc/dataloader/readers/cansas_reader.py	(revision 2469df7fc9ffa047115c5bffe589ed307b12c363)
@@ -82,5 +82,5 @@
 
     def read(self, xml_file, schema_path="", invalid=True):
-        if schema_path != "" or invalid != True:
+        if schema_path != "" or not invalid:
             # read has been called from self.get_file_contents because xml file doens't conform to schema
             _, self.extension = os.path.splitext(os.path.basename(xml_file))
@@ -942,5 +942,5 @@
             pos, "z", datainfo.sample.position.z,
             {"unit": datainfo.sample.position_unit})
-        if written == True:
+        if written:
             self.append(pos, sample)
 
@@ -955,5 +955,5 @@
             ori, "yaw", datainfo.sample.orientation.z,
             {"unit": datainfo.sample.orientation_unit})
-        if written == True:
+        if written:
             self.append(ori, sample)
 
@@ -1002,5 +1002,5 @@
             size, "z", datainfo.source.beam_size.z,
             {"unit": datainfo.source.beam_size_unit})
-        if written == True:
+        if written:
             self.append(size, source)
 
@@ -1058,5 +1058,5 @@
                     size, "z", aperture.size.z,
                     {"unit": aperture.size_unit})
-                if written == True:
+                if written:
                     self.append(size, apert)
 
@@ -1081,5 +1081,5 @@
             written = written | self.write_node(det, "SDD", item.distance,
                                                 {"unit": item.distance_unit})
-            if written == True:
+            if written:
                 self.append(det, instr)
 
@@ -1091,5 +1091,5 @@
             written = written | self.write_node(off, "z", item.offset.z,
                                                 {"unit": item.offset_unit})
-            if written == True:
+            if written:
                 self.append(off, det)
 
@@ -1103,5 +1103,5 @@
                                                 item.orientation.z,
                                                 {"unit": item.orientation_unit})
-            if written == True:
+            if written:
                 self.append(ori, det)
 
@@ -1115,5 +1115,5 @@
                                                 item.beam_center.z,
                                                 {"unit": item.beam_center_unit})
-            if written == True:
+            if written:
                 self.append(center, det)
 
@@ -1125,5 +1125,5 @@
             written = written | self.write_node(pix, "z", item.pixel_size.z,
                                                 {"unit": item.pixel_size_unit})
-            if written == True:
+            if written:
                 self.append(pix, det)
             self.write_node(det, "slit_length", item.slit_length,
Index: src/sas/sascalc/dataloader/readers/danse_reader.py
===================================================================
--- src/sas/sascalc/dataloader/readers/danse_reader.py	(revision af3e9f590874286ad2be3a1e5be489d605e8a9a0)
+++ src/sas/sascalc/dataloader/readers/danse_reader.py	(revision 2469df7fc9ffa047115c5bffe589ed307b12c363)
@@ -157,5 +157,5 @@
         # Store all data
         # Store wavelength
-        if has_converter == True and self.current_datainfo.source.wavelength_unit != 'A':
+        if has_converter and self.current_datainfo.source.wavelength_unit != 'A':
             conv = Converter('A')
             wavelength = conv(wavelength,
@@ -164,5 +164,5 @@
 
         # Store distance
-        if has_converter == True and detector.distance_unit != 'm':
+        if has_converter and detector.distance_unit != 'm':
             conv = Converter('m')
             distance = conv(distance, units=detector.distance_unit)
@@ -170,5 +170,5 @@
 
         # Store pixel size
-        if has_converter == True and detector.pixel_size_unit != 'mm':
+        if has_converter and detector.pixel_size_unit != 'mm':
             conv = Converter('mm')
             pixel = conv(pixel, units=detector.pixel_size_unit)
Index: src/sas/sascalc/fit/qsmearing.py
===================================================================
--- src/sas/sascalc/fit/qsmearing.py	(revision 50fcb09b3ee47cf23c26b90d9c291f41415c0aa5)
+++ src/sas/sascalc/fit/qsmearing.py	(revision 2469df7fc9ffa047115c5bffe589ed307b12c363)
@@ -90,5 +90,5 @@
             #print "data1D.dx[0]",data1D.dx[0],data1D.dxl[0]
     # If we found resolution smearing data, return a QSmearer
-    if _found_resolution == True:
+    if _found_resolution:
          return pinhole_smear(data, model)
 
@@ -113,5 +113,5 @@
                 break
     # If we found slit smearing data, return a slit smearer
-    if _found_slit == True:
+    if _found_slit:
         return slit_smear(data, model)
     return None
Index: src/sas/sascalc/pr/invertor.py
===================================================================
--- src/sas/sascalc/pr/invertor.py	(revision d04ac056c476a91de374975fdb618e1cf1d27ca1)
+++ src/sas/sascalc/pr/invertor.py	(revision 2469df7fc9ffa047115c5bffe589ed307b12c363)
@@ -222,8 +222,5 @@
         elif name == 'est_bck':
             value = self.get_est_bck()
-            if value == 1:
-                return True
-            else:
-                return False
+            return value == 1
         elif name in self.__dict__:
             return self.__dict__[name]
@@ -460,5 +457,5 @@
 
         # If we need to fit the background, add a term
-        if self.est_bck == True:
+        if self.est_bck:
             nfunc_0 = nfunc
             nfunc += 1
@@ -506,5 +503,5 @@
 
         # Keep a copy of the last output
-        if self.est_bck == False:
+        if not self.est_bck:
             self.out = c
             self.cov = err
@@ -658,5 +655,5 @@
         file.write("#slit_width=%g\n" % self.slit_width)
         file.write("#background=%g\n" % self.background)
-        if self.est_bck == True:
+        if self.est_bck:
             file.write("#has_bck=1\n")
         else:
@@ -738,8 +735,5 @@
                     elif line.startswith('#has_bck='):
                         toks = line.split('=')
-                        if int(toks[1]) == 1:
-                            self.est_bck = True
-                        else:
-                            self.est_bck = False
+                        self.est_bck = int(toks[1]) == 1
 
                     # Now read in the parameters
Index: src/sas/sascalc/pr/num_term.py
===================================================================
--- src/sas/sascalc/pr/num_term.py	(revision a1b8fee73528559155793dd74cda07d0c32e9d72)
+++ src/sas/sascalc/pr/num_term.py	(revision 2469df7fc9ffa047115c5bffe589ed307b12c363)
@@ -55,5 +55,5 @@
         medi = 0
         for i in range(dv):
-            if odd == True:
+            if odd:
                 medi = osc[int(med)]
             else:
@@ -98,7 +98,7 @@
                 new_osc3.append(self.osc_list[i])
 
-        if flag9 == True:
+        if flag9:
             self.dataset = new_osc1
-        elif flag8 == True:
+        elif flag8:
             self.dataset = new_osc2
         else:
@@ -141,6 +141,5 @@
             div = len(nts)
             tem = float(div) / 2.0
-            odd = self.is_odd(div)
-            if odd == True:
+            if self.is_odd(div):
                 nt = nts[int(tem)]
             else:
@@ -148,5 +147,5 @@
             return nt, self.alpha_list[nt - 10], self.mess_list[nt - 10]
         except:
-            #TODO: check the logic above and make sure it doesn't 
+            #TODO: check the logic above and make sure it doesn't
             # rely on the try-except.
             return self.nterm_min, self.invertor.alpha, ''
Index: src/sas/sasgui/guiframe/local_perspectives/plotting/Plotter1D.py
===================================================================
--- src/sas/sasgui/guiframe/local_perspectives/plotting/Plotter1D.py	(revision 7432acb919f4013119ca918a73350297e0d4c93f)
+++ src/sas/sasgui/guiframe/local_perspectives/plotting/Plotter1D.py	(revision 2469df7fc9ffa047115c5bffe589ed307b12c363)
@@ -827,5 +827,5 @@
         on_Modify Plot Property_close
         """
-        if self.appD.okay_clicked == True:
+        if self.appD.okay_clicked:
             info = self.appD.get_current_values()
             self.appearance_selected_plot.custom_color = \
Index: src/sas/sasgui/perspectives/calculator/model_editor.py
===================================================================
--- src/sas/sasgui/perspectives/calculator/model_editor.py	(revision 1c206d94dab82318f2d920e76f993de04aaa2435)
+++ src/sas/sasgui/perspectives/calculator/model_editor.py	(revision 2469df7fc9ffa047115c5bffe589ed307b12c363)
@@ -332,5 +332,5 @@
             msg = ("%s is not a valid Python name. Only alphanumeric \n" \
                    "and underscore allowed" % self.name)
-        
+
         #Now check if the name already exists
         if not self.overwrite_name and self.good_name:
@@ -344,5 +344,5 @@
                 msg = "Name exists already."
 
-        if self.good_name == False:
+        if not self.good_name:
             self.name_tcl.SetBackgroundColour('pink')
             info = 'Error'
Index: src/sas/sasgui/perspectives/invariant/invariant_panel.py
===================================================================
--- src/sas/sasgui/perspectives/invariant/invariant_panel.py	(revision 7432acb919f4013119ca918a73350297e0d4c93f)
+++ src/sas/sasgui/perspectives/invariant/invariant_panel.py	(revision 2469df7fc9ffa047115c5bffe589ed307b12c363)
@@ -707,5 +707,5 @@
 
         # reset power_out to default to get ready for another '_on_text'
-        if self.is_power_out == True:
+        if self.is_power_out:
             self.state.container = copy.deepcopy(self.inv_container)
             self.state.timestamp = self._get_time_stamp()
Index: src/sas/sasgui/perspectives/invariant/invariant_state.py
===================================================================
--- src/sas/sasgui/perspectives/invariant/invariant_state.py	(revision 1fa4f7368e26981352615cbfb337a581ed97031f)
+++ src/sas/sasgui/perspectives/invariant/invariant_state.py	(revision 2469df7fc9ffa047115c5bffe589ed307b12c363)
@@ -655,5 +655,5 @@
         : return: None
         """
-        if self.cansas == True:
+        if self.cansas:
             return self._read_cansas(path)
         else:
@@ -763,5 +763,5 @@
         """
         # Sanity check
-        if self.cansas == True:
+        if self.cansas:
             doc = self.write_toXML(datainfo, invstate)
             # Write the XML document
Index: src/sas/sasgui/perspectives/pr/inversion_state.py
===================================================================
--- src/sas/sasgui/perspectives/pr/inversion_state.py	(revision 1fa4f7368e26981352615cbfb337a581ed97031f)
+++ src/sas/sasgui/perspectives/pr/inversion_state.py	(revision 2469df7fc9ffa047115c5bffe589ed307b12c363)
@@ -389,5 +389,5 @@
 
         """
-        if self.cansas == True:
+        if self.cansas:
             return self._read_cansas(path)
         else:
@@ -505,5 +505,5 @@
         """
         # Sanity check
-        if self.cansas == True:
+        if self.cansas:
             doc = self.write_toXML(datainfo, prstate)
             # Write the XML document
Index: src/sas/sasgui/perspectives/pr/pr.py
===================================================================
--- src/sas/sasgui/perspectives/pr/pr.py	(revision cb62bd55ae79395ac6e01d8b2077f4d496625c41)
+++ src/sas/sasgui/perspectives/pr/pr.py	(revision 2469df7fc9ffa047115c5bffe589ed307b12c363)
@@ -407,8 +407,8 @@
             y[i] = value
 
-        if self._normalize_output == True:
+        if self._normalize_output:
             y = y / total
             dy = dy / total
-        elif self._scale_output_unity == True:
+        elif self._scale_output_unity:
             y = y / pmax
             dy = dy / pmax
@@ -544,5 +544,5 @@
             lines = buff.split('\n')
             for line in lines:
-                if data_started == True:
+                if data_started:
                     try:
                         toks = line.split()
Index: src/sas/sasgui/plottools/PlotPanel.py
===================================================================
--- src/sas/sasgui/plottools/PlotPanel.py	(revision a1b8fee73528559155793dd74cda07d0c32e9d72)
+++ src/sas/sasgui/plottools/PlotPanel.py	(revision 2469df7fc9ffa047115c5bffe589ed307b12c363)
@@ -476,5 +476,5 @@
             return
         self.mousemotion = True
-        if self.leftdown == True and self.mousemotion == True:
+        if self.leftdown and self.mousemotion:
             ax = event.inaxes
             if ax is not None:  # the dragging is perform inside the figure
Index: src/sas/sasgui/plottools/fitDialog.py
===================================================================
--- src/sas/sasgui/plottools/fitDialog.py	(revision 7432acb919f4013119ca918a73350297e0d4c93f)
+++ src/sas/sasgui/plottools/fitDialog.py	(revision 2469df7fc9ffa047115c5bffe589ed307b12c363)
@@ -44,5 +44,5 @@
         fitting and derives and displays specialized output parameters based
         on the scale choice of the plot calling it.
-        
+
         :note1: The fitting is currently a bit convoluted as besides using
         plottools.transform.py to handle all the conversions, it uses
@@ -55,5 +55,5 @@
         This would considerably simplify the code and remove the need I think
         for LineModel.py and possibly fittins.py altogether.   -PDB 7/10/16
-        
+
         :note2: The linearized fits do not take resolution into account. This
         means that for poor resolution such as slit smearing the answers will
@@ -142,5 +142,5 @@
         """
 
-        # set up sizers first. 
+        # set up sizers first.
         # vbox is the panel sizer and is a vertical sizer
         # The first element of the panel is sizer which is a gridbagsizer
@@ -151,5 +151,5 @@
         sizer = wx.GridBagSizer(5, 5)
         sizer_button = wx.BoxSizer(wx.HORIZONTAL)
-        
+
         #size of string boxes in pixels
         _BOX_WIDTH = 100
@@ -395,7 +395,7 @@
         sizer_button.Add(self.btClose, 0,
                          wx.LEFT | wx.RIGHT | wx.ADJUST_MINSIZE, 10)
-        
+
         vbox.Add(sizer)
-        self.static_line_1 = wx.StaticLine(self, -1)        
+        self.static_line_1 = wx.StaticLine(self, -1)
         vbox.Add(self.static_line_1, 0, wx.EXPAND, 0)
         vbox.Add(sizer_button, 0, wx.EXPAND | wx.BOTTOM | wx.TOP, 10)
@@ -439,5 +439,5 @@
         # makes transformation for y as a line to fit
         if self.x != []:
-            if self.checkFitValues(self.xminFit) == True:
+            if self.checkFitValues(self.xminFit):
                 # Check if the field of Fit Dialog contain values
                 # and use the x max and min of the user
Index: src/sas/sasgui/plottools/plottable_interactor.py
===================================================================
--- src/sas/sasgui/plottools/plottable_interactor.py	(revision a1b8fee73528559155793dd74cda07d0c32e9d72)
+++ src/sas/sasgui/plottools/plottable_interactor.py	(revision 2469df7fc9ffa047115c5bffe589ed307b12c363)
@@ -166,5 +166,5 @@
         from within the boundaries of an artist.
         """
-        if self._context_menu == True:
+        if self._context_menu:
             self._context_menu = False
             evt.artist = self.marker
@@ -216,5 +216,5 @@
         """
         if not evt.artist.__class__.__name__ == "AxesSubplot":
-            if self._context_menu == False:
+            if not self._context_menu:
                 self.base.plottable_selected(None)
                 try:
Index: src/sas/sasgui/plottools/plottables.py
===================================================================
--- src/sas/sasgui/plottools/plottables.py	(revision 2d9526dfda3bdfe3c9159ab7d9db8399b4a00848)
+++ src/sas/sasgui/plottools/plottables.py	(revision 2469df7fc9ffa047115c5bffe589ed307b12c363)
@@ -227,5 +227,5 @@
         max_value = None
         for p in self.plottables:
-            if p.hidden == True:
+            if p.hidden:
                 continue
             if p.x is not None:
@@ -1062,5 +1062,5 @@
         Renders the plottable on the graph
         """
-        if self.interactive == True:
+        if self.interactive:
             kw['symbol'] = self.symbol
             kw['id'] = self.id
