Index: docs/sphinx-docs/source/_extensions/dollarmath.py
===================================================================
--- docs/sphinx-docs/source/_extensions/dollarmath.py	(revision eddf6af5bcc4640826d67df071f3e5da5dd092a8)
+++ docs/sphinx-docs/source/_extensions/dollarmath.py	(revision 2a2fb0936f077a24a3d2740fedf8d38a3e8a606f)
@@ -11,5 +11,5 @@
 
 import re
-_dollar = re.compile(r"(?:^|(?<=\s))[$]([^\n]*?)(?<![\\])[$](?:$|(?=\s|[.,;:?\\()]))")
+_dollar = re.compile(r"(?:^|(?<=\s|[-(]))[$]([^\n]*?)(?<![\\])[$](?:$|(?=\s|[-.,;:?\\)]))")
 _notdollar = re.compile(r"\\[$]")
 
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/MultiplicationModel.py
===================================================================
--- src/sas/sascalc/fit/MultiplicationModel.py	(revision 574adc767a9e86744546f8edd6a23dc4f81914ad)
+++ src/sas/sascalc/fit/MultiplicationModel.py	(revision 0a9cbc3034036bdedd033f655d9fb37abb45d1f3)
@@ -68,5 +68,5 @@
         try:
             multiplicity = p_model.multiplicity
-        except:
+        except AttributeError:
             multiplicity = 1
         ## functional multiplicity of the model
@@ -76,5 +76,5 @@
         self.non_fittable = p_model.non_fittable
         self.multiplicity_info = []
-        self.fun_list = {}
+        self.fun_list = []
         if self.non_fittable > 1:
             try:
@@ -82,5 +82,5 @@
                 self.fun_list = p_model.fun_list
                 self.is_multiplicity_model = True
-            except:
+            except AttributeError:
                 pass
         else:
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: c/sas/sasgui/perspectives/calculator/media/gen_sas_help.html
===================================================================
--- src/sas/sasgui/perspectives/calculator/media/gen_sas_help.html	(revision 6aad2e8b144e92be94b299c8ae7f4f418c094f1d)
+++ 	(revision )
@@ -1,147 +1,0 @@
-<body>
-<h4>Generic Scattering Calculator:</h4>
-Polarization and Magnetic Scattering
-<br>
-<br>
-<ul>
-<li><a href="#theory">Theory:</a></li>
-<li><a href="#gui">GUI</a></li>
-<li><a href="#pdb">PDB Data</a></li>
-</ul>
-<br>
-<br>
-<b>1. <a name="theory">Theory</a> </b>
-<br>
-In general, a particle with a volume V can be described by an ensemble containing N 
-3-dimensional rectangular pixels where each pixels are much smaller than V. 
-Assuming that
-all the pixel sizes are same, the elastic scattering intensity 
-by the particle 
-<p>
-<img src="gen_i.png"/>
-</p>
-<br>
-where &#946;<sub>j</sub> and r<sub>j</sub> are the scattering 
-length density and the position 
-of the j'th pixel respectively. And the total volume
-<p>
-<img src="v_j.png"/>
-</p>
-<br>
-for &#946;<sub>j</sub> &#8800; 0 where v<sub>j</sub> is the volume of the j'th pixel 
-(or the j'th natural atomic volume (= atomic mass/natural molar density/Avogadro number) 
- for the atomic structures). The total volume V can be corrected by users. 
-This correction is useful especially for an atomic structure (taken from a pdb file) to get the right 
-normalization. Note that the  &#946;<sub>j</sub> displayed in GUI may be incorrect but will not 
-affect the scattering computation if the correction of the total volume is made.
-<br>
-The scattering length density (SLD) of each pixel where the SLD is uniform, is a combination of the nuclear and magnetic SLDs 
-and depends on the spin states of the neutrons as follows:
-<br>
-<br>
-For magnetic scattering, only the magnetization component, <b>M</b><sub>perp</sub>, 
-perpendicular to the scattering vector <b>Q</b> contributes to the the magnetic 
-scattering length. (Figure below).
-<p>
-<img src="mag_vector.png"/>
-</p>
-<br>
-The magnetic scattering length density is then
-<p>
-<img src="dm_eq.png"/>
-</p>
-<br>
-where &#947; = -1.913 the gyromagnetic ratio,  	&#956;<sub>B</sub> is the Bohr magneton, 
-r<sub>0</sub> is the classical radius of electron, 
-and <b>&#963;</b> is the Pauli spin.
-<br>
-For polarized neutron, the magnetic scattering is depending on the spin states.
-Let's consider that the incident neutrons are polarized parallel (+)/anti-parallel 
-(&#8211;) to the x' axis (See both Figures above).
-The possible out-coming states then are + and - states for both incident states.
-<br>
- - Non-spin-flips:  	(+ +) and  	(- -)
-<br>
- - Spin-flips:  	(+ -) and  	(- +)
-<br>
-<p>
-<img src="gen_mag_pic.png"/>
-</p>
-<br>
-<br>
-Now, let's assume that the angles of the <b>Q</b> vector and the spin-axis (x') from x-axis 
-are &#966; and  &#952;<sub>up</sub>, respectively (See Figure above).
-Then, depending upon the polarization (spin) state of neutrons, the scattering length
-densities , including the nuclear scattering length density (&#946; <sub>N</sub>) are given as, for non-spin-flips,
-<p>
-<img src="sld1.png"/>
-</p>
-<br>
-<br>
-for spin-flips,
-<p>
-<img src="sld2.png"/>
-</p>
-<br>
-<br>
-where
-<p>
-<img src="mxp.png"/>
-</p>
-<p>
-<img src="myp.png"/>
-</p>
-<p>
-<img src="mzp.png"/>
-</p>
-<p>
-<img src="mqx.png"/>
-</p>
-<p>
-<img src="mqy.png"/>
-</p>
-<br>
-<br>
-Here, the M<sub>0x</sub>, M<sub>0y</sub> and M<sub>0z</sub> are the x, y and z 
-components of the magnetization vector given in the xyz lab frame.
-<br>
-<br>
-<b>2. <a name="gui">GUI</a> </b>
-<br>
-<p>
-<img src="gen_gui_help.png"/>
-</p>
-<br>
-<p>
-After the computation, the result will be listed in the 'Theory' box 
-in the data explorer panel on the main window.
-<br>
-The 'Up_frac_in' and 'Up_frac_out' are the ratio, (spin up) /(spin up + spin down) neutrons 
-before the sample and at the analyzer, respectively.
-</p>
-<br>
-*Note I: The values of 'Up_frac_in' and 'Up_frac_out' must be in the range between 0 and 1.
-For example, both values are 0.5 for unpolarized neutrons.
-<br>
-*Note II: This computation is totally based on the pixel (or atomic) data fixed
-in the xyz coordinates. Thus no angular orientational averaging is considered.
-<br>
-*Note III: For the nuclear scattering length density, only the real component is taken account.
-<br>
-<br>
-<b>3. <a name="pdb">PDB Data</a> </b>
-<br>
-This Generic scattering calculator also supports some pdb files without considering polarized/magnetic scattering
- so that the related parameters such as Up_*** will be ignored (see the Picture below). The calculation for fixed orientation uses (the first) Equation above resulting 
-in a 2D output, whileas the scattering calculation averaged over all the orientations uses the Debye equation providing a 1D output:
- <p>
-<img src="gen_debye_eq.png"/>
-</p>
-<br>
-where v<sub>j</sub>&#946;<sub>j</sub> &#8801; b<sub>j</sub> is the scattering length of the j'th atom.
-The resultant outputs will be displayed in the DataExporer for further uses. 
-<br>
- <p>
-<img src="pdb_combo.jpg"/>
-</p>
-</body>
Index: src/sas/sasgui/perspectives/calculator/media/sas_calculator_help.rst
===================================================================
--- src/sas/sasgui/perspectives/calculator/media/sas_calculator_help.rst	(revision 5ed76f8390eac56ff5d3779fd9c454d0c8fe1dc0)
+++ src/sas/sasgui/perspectives/calculator/media/sas_calculator_help.rst	(revision 1b67f3e34016e1f2e1d667e4f207ab670abdd1d5)
@@ -26,5 +26,8 @@
 intensity from the particle is
 
-.. image:: gen_i.png
+.. math::
+
+    I(\vec Q) = \frac{1}{V}\left|
+        \sum_j^N v_j \beta_j \exp(i\vec Q \cdot \vec r_j)\right|^2
 
 Equation 1.
@@ -46,5 +49,5 @@
 atomic structure (such as taken from a PDB file) to get the right normalization.
 
-*NOTE! $\beta_j$ displayed in the GUI may be incorrect but this will not
+*NOTE!* $\beta_j$ *displayed in the GUI may be incorrect but this will not
 affect the scattering computation if the correction of the total volume V is made.*
 
@@ -56,6 +59,6 @@
 ^^^^^^^^^^^^^^^^^^^
 
-For magnetic scattering, only the magnetization component, $M_\perp$,
-perpendicular to the scattering vector $Q$ contributes to the magnetic
+For magnetic scattering, only the magnetization component, $\mathbf{M}_\perp$,
+perpendicular to the scattering vector $\vec Q$ contributes to the magnetic
 scattering length.
 
@@ -64,5 +67,8 @@
 The magnetic scattering length density is then
 
-.. image:: dm_eq.png
+.. math::
+
+    \beta_M = \frac{\gamma r_0}{2 \mu_B}\sigma \cdot \mathbf{M}_\perp
+        = D_M\sigma \cdot \mathbf{M}_\perp
 
 where the gyromagnetic ratio is $\gamma = -1.913$, $\mu_B$ is the Bohr
@@ -81,6 +87,6 @@
 .. image:: gen_mag_pic.png
 
-Now let us assume that the angles of the *Q* vector and the spin-axis (x')
-to the x-axis are $\phi$ and $\theta_\text{up}$ respectively (see above). Then,
+Now let us assume that the angles of the $\vec Q$ vector and the spin-axis ($x'$)
+to the $x$-axis are $\phi$ and $\theta_\text{up}$ respectively (see above). Then,
 depending upon the polarization (spin) state of neutrons, the scattering
 length densities, including the nuclear scattering length density ($\beta_N$)
@@ -89,24 +95,25 @@
 *  for non-spin-flips
 
-   .. image:: sld1.png
+.. math::
+    \beta_{\pm\pm} = \beta_N \mp D_M M_{\perp x'}
 
 *  for spin-flips
 
-   .. image:: sld2.png
+.. math::
+    \beta_{\pm\mp} = - D_M(M_{\perp y'} \pm i M_{\perp z'})
 
 where
 
-.. image:: mxp.png
+.. math::
 
-.. image:: myp.png
+    M_{\perp x'} &= M_{0q_x}\cos\theta_\text{up} + M_{0q_y}\sin\theta_\text{up} \\
+    M_{\perp y'} &= M_{0q_y}\cos\theta_\text{up} - M_{0q_x}\sin\theta_\text{up} \\
+    M_{\perp z'} &= M_{0z} \\
+    M_{0q_x} &= (M_{0x}\cos\phi - M_{0y}\sin\phi)\cos\phi \\
+    M_{0q_y} &= (M_{0y}\sin\phi - M_{0y}\cos\phi)\sin\phi
 
-.. image:: mzp.png
-
-.. image:: mqx.png
-
-.. image:: mqy.png
-
-Here the $M0_x$, $M0_y$ and $M0_z$ are the $x$, $y$ and $z$
-components of the magnetisation vector in the laboratory $xyz$ frame.
+Here the $M_{0x}$, $M_{0y}$ and $M_{0z}$ are
+the $x$, $y$ and $z$ components of the magnetisation vector in the
+laboratory $x$-$y$-$z$ frame.
 
 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
@@ -148,5 +155,8 @@
 uses the Debye equation below providing a 1D output
 
-.. image:: gen_debye_eq.png
+.. math::
+
+    I(|\vec Q|) = \frac{1}{V}\sum_j^N v_j\beta_j \sum_k^N v_k \beta_k
+        \frac{\sin(|\vec Q||\vec r_j - \vec r_k|)}{|\vec Q||\vec r_j - \vec r_k|}
 
 where $v_j \beta_j \equiv b_j$ is the scattering
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/fitting/basepage.py
===================================================================
--- src/sas/sasgui/perspectives/fitting/basepage.py	(revision df4af9b201bb6e7ad7c295993873c92368617701)
+++ src/sas/sasgui/perspectives/fitting/basepage.py	(revision eee94bf769d38056d1475e9f6e901e058d6687a3)
@@ -1643,5 +1643,5 @@
                         if item_page[2].__class__.__name__ == "ComboBox":
                             if item_page_info[2] in self.model.fun_list:
-                                fun_val = self.model.fun_list[item_page_info[2]]
+                                fun_val = self.model.fun_list.index(item_page_info[2])
                                 self.model.setParam(item_page_info[1], fun_val)
                     if item_page[3] is not None:
@@ -1687,5 +1687,5 @@
                 selection = value
                 if value in self.model.fun_list:
-                    selection = self.model.fun_list[value]
+                    selection = self.model.fun_list.index(value)
                 item_page[2].SetValue(selection)
                 self.model.setParam(param_name, selection)
@@ -3365,5 +3365,5 @@
                     if item[2].__class__.__name__ == "ComboBox":
                         if content[name][1] in self.model.fun_list:
-                            fun_val = self.model.fun_list[content[name][1]]
+                            fun_val = self.model.fun_list.index(content[name][1])
                             self.model.setParam(name, fun_val)
                     try:
@@ -3415,5 +3415,5 @@
                         if item[2].__class__.__name__ == "ComboBox":
                             if value[0] in self.model.fun_list:
-                                fun_val = self.model.fun_list[value[0]]
+                                fun_val = self.model.fun_list.index(value[0])
                                 self.model.setParam(name, fun_val)
                                 # save state
Index: src/sas/sasgui/perspectives/fitting/fitpage.py
===================================================================
--- src/sas/sasgui/perspectives/fitting/fitpage.py	(revision df4af9b201bb6e7ad7c295993873c92368617701)
+++ src/sas/sasgui/perspectives/fitting/fitpage.py	(revision bfeb823d6565a781d46f2b3a96dce997cb3fab28)
@@ -1726,16 +1726,6 @@
                 and not self.temp_multi_functional:
             return None
-        # Get the func name list
-        list = self.model.fun_list
-        if len(list) == 0:
-            return None
-        # build function (combo)box
-        ind = 0
-        while(ind < len(list)):
-            for key, val in list.items():
-                if val == ind:
-                    fun_box.Append(key, val)
-                    break
-            ind += 1
+        for index, choice in enumerate(self.model.fun_list):
+            fun_box.Append(choice, index)
 
     def _on_select_accuracy(self, event):
@@ -1765,5 +1755,5 @@
         value = fun_box.GetValue()
         if value in self.model.fun_list:
-            fun_val = self.model.fun_list[value]
+            fun_val = self.model.fun_list.index(value)
 
         self.model.setParam(name, fun_val)
Index: src/sas/sasgui/perspectives/fitting/media/fitting.rst
===================================================================
--- src/sas/sasgui/perspectives/fitting/media/fitting.rst	(revision 3bd677bda9477bbd07235d9fba448f09ae1b3932)
+++ src/sas/sasgui/perspectives/fitting/media/fitting.rst	(revision c926a9787e05478bd241a391873fc259e32825d6)
@@ -18,4 +18,6 @@
 
    Polarisation/Magnetic Scattering <magnetism/magnetism>
+   
+   Oriented Particles <orientation/orientation>
 
    Information on the SasView Optimisers <optimizer>
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
