Index: src/sas/calculator/instrument.py
===================================================================
--- src/sas/calculator/instrument.py	(revision 26500ec46b24611311438633773e4d24a4df0fc5)
+++ src/sas/calculator/instrument.py	(revision b6627d95d435a7f25f17862e4ac78ae26bdb6393)
@@ -85,7 +85,7 @@
         """
         if len(size) == 0:
-            self.sample_size = 0.0
-        else:
-            self.sample_size = size
+            self.size = 0.0
+        else:
+            self.size = size
             validate(size[0])
 
Index: src/sas/calculator/resolution_calculator.py
===================================================================
--- src/sas/calculator/resolution_calculator.py	(revision 6bd3a8d1ff8ae5d31daee4cf6f10dfaeb0d72131)
+++ src/sas/calculator/resolution_calculator.py	(revision b6627d95d435a7f25f17862e4ac78ae26bdb6393)
@@ -13,4 +13,6 @@
 import math
 import numpy
+import sys
+import logging
 
 #Plank's constant in cgs unit
@@ -77,8 +79,4 @@
         self.detector_pix_size = []
         self.detector_size = []
-        # get all the values of the instrumental parameters
-        #self.intensity = self.get_intensity()
-        #self.wavelength = self.get_wavelength()
-        #self.wavelength_spread = self.get_wavelength_spread()
         self.get_all_instrument_params()
         # max q range for all lambdas
@@ -87,5 +85,5 @@
 
     def compute_and_plot(self, qx_value, qy_value, qx_min, qx_max,
-                          qy_min, qy_max, coord='cartesian'):
+                         qy_min, qy_max, coord='cartesian'):
         """
         Compute the resolution
@@ -120,6 +118,6 @@
             # make image
             image = self.get_image(qx_value, qy_value, sigma_1, sigma_2,
-                            sigma_r, qx_min, qx_max, qy_min, qy_max,
-                            coord, False)
+                                   sigma_r, qx_min, qx_max, qy_min, qy_max,
+                                   coord, False)
             if qx_min > self.qx_min:
                 qx_min = self.qx_min
@@ -150,6 +148,6 @@
             intens = self.setup_tof(lam, dlam)
             out = self.get_image(qx_value, qy_value, sig1_list[ind],
-                                   sig2_list[ind], sigr_list[ind],
-                                   qx_min, qx_max, qy_min, qy_max, coord)
+                                 sig2_list[ind], sigr_list[ind],
+                                 qx_min, qx_max, qy_min, qy_max, coord)
             # this is the case of q being outside the detector
             #if numpy.all(out==0.0):
@@ -272,5 +270,5 @@
         # sigma in the radial/x direction
         # for source aperture
-        sigma_1  = self.get_variance(rone, l1_cor, phi, comp1)
+        sigma_1 = self.get_variance(rone, l1_cor, phi, comp1)
         # for sample apperture
         sigma_1 += self.get_variance(rtwo, lp_cor, phi, comp1)
@@ -279,11 +277,11 @@
         # for gravity term for 1d
         sigma_1grav1d = self.get_variance_gravity(l_ssa, l_sad, lamb,
-                            lamb_spread, phi, comp1, 'on') / tof_factor
+                                                  lamb_spread, phi, comp1, 'on') / tof_factor
         # for wavelength spread
         # reserve for 1d calculation
         A_value = self._cal_A_value(lamb, l_ssa, l_sad)
         sigma_wave_1, sigma_wave_1_1d = self.get_variance_wave(A_value,
-                                          radius, l_two, lamb_spread,
-                                          phi, 'radial', 'on')
+                                                               radius, l_two, lamb_spread,
+                                                               phi, 'radial', 'on')
         sigma_wave_1 /= tof_factor
         sigma_wave_1_1d /= tof_factor
@@ -300,5 +298,5 @@
         # sigma in the phi/y direction
         # for source apperture
-        sigma_2  = self.get_variance(rone, l1_cor, phi, comp2)
+        sigma_2 = self.get_variance(rone, l1_cor, phi, comp2)
 
         # for sample apperture
@@ -310,11 +308,11 @@
         # for gravity term for 1d
         sigma_2grav1d = self.get_variance_gravity(l_ssa, l_sad, lamb,
-                                lamb_spread, phi, comp2, 'on') / tof_factor
+                                                  lamb_spread, phi, comp2, 'on') / tof_factor
 
         # for wavelength spread
         # reserve for 1d calculation
         sigma_wave_2, sigma_wave_2_1d = self.get_variance_wave(A_value,
-                                          radius, l_two, lamb_spread,
-                                          phi, 'phi', 'on')
+                                                               radius, l_two, lamb_spread,
+                                                               phi, 'phi', 'on')
         sigma_wave_2 /= tof_factor
         sigma_wave_2_1d /= tof_factor
@@ -377,5 +375,4 @@
 
         # Check whether the q value is within the detector range
-        #msg = "Invalid input: Q value out of the detector range..."
         if qx_min < self.qx_min:
             self.qx_min = qx_min
@@ -409,5 +406,5 @@
             # Calculate the 2D Gaussian distribution image
             image = self._gaussian2d_polar(q_1, q_2, qc_1, qc_2,
-                                 sigma_1, sigma_2, sigma_r)
+                                           sigma_1, sigma_2, sigma_r)
         else:
             # catesian coordinate
@@ -452,5 +449,5 @@
         # Image
         im = plt.imshow(image,
-                extent=[qx_min, qx_max, qy_min, qy_max])
+                        extent=[qx_min, qx_max, qy_min, qy_max])
 
         # bilinear interpolation to make it smoother
@@ -506,5 +503,5 @@
             raise ValueError, " Improper input..."
         # get them squared
-        sigma  = x_comp * x_comp
+        sigma = x_comp * x_comp
         sigma += y_comp * y_comp
         # normalize by distance
@@ -918,5 +915,5 @@
 
     def _gaussian2d_polar(self, x_val, y_val, x0_val, y0_val,
-                        sigma_x, sigma_y, sigma_r):
+                          sigma_x, sigma_y, sigma_r):
         """
         Calculate 2D Gaussian distribution for polar coodinate
@@ -933,5 +930,5 @@
         sigma_x = sqrt(sigma_x * sigma_x + sigma_r * sigma_r)
         # call gaussian1d
-        gaussian  = self._gaussian1d(x_val, x0_val, sigma_x)
+        gaussian = self._gaussian1d(x_val, x0_val, sigma_x)
         gaussian *= self._gaussian1d(y_val, y0_val, sigma_y)
 
@@ -974,21 +971,4 @@
         phi = math.atan2(qy_value, qx_value)
         return phi
-        # default
-        phi = 0
-        # ToDo: This is misterious - sign???
-        #qy_value = -qy_value
-        # Take care of the singular point
-        if qx_value == 0:
-            if qy_value > 0:
-                phi = pi / 2
-            elif qy_value < 0:
-                phi = -pi / 2
-            else:
-                phi = 0
-        else:
-            # the angle
-            phi = math.atan2(qy_value, qx_value)
-
-        return phi
 
     def _get_detector_qxqy_pixels(self):
@@ -1026,5 +1006,5 @@
             detector_offset = self.sample2detector_distance[1]
         except:
-            pass
+            logging.error(sys.exc_value)
 
         # detector size in [no of pix_x,no of pix_y]
@@ -1043,5 +1023,6 @@
         # beam center position in pix number (start from 0)
         center_x, center_y = self._get_beamcenter_position(detector_pix_nums_x,
-                                    detector_pix_nums_y, offset_x, offset_y)
+                                                           detector_pix_nums_y,
+                                                           offset_x, offset_y)
         # distance [cm] from the beam center on detector plane
         detector_ind_x = numpy.arange(detector_pix_nums_x)
@@ -1088,10 +1069,10 @@
         # i.e., edges of the last pixels.
         self.qy_min += self._get_qx(-0.5 * pix_y_size,
-                                sample2detector_distance, wavelength)
+                                    sample2detector_distance, wavelength)
         self.qy_max += self._get_qx(0.5 * pix_y_size,
-                                sample2detector_distance, wavelength)
+                                    sample2detector_distance, wavelength)
         #if self.qx_min == self.qx_max:
         self.qx_min += self._get_qx(-0.5 * pix_x_size,
-                                sample2detector_distance, wavelength)
+                                    sample2detector_distance, wavelength)
         self.qx_max += self._get_qx(0.5 * pix_x_size,
                                     sample2detector_distance, wavelength)
@@ -1108,9 +1089,9 @@
             output = Data2D()
             inten = numpy.zeros_like(qx_value)
-            output.data    = inten
+            output.data = inten
             output.qx_data = qx_value
             output.qy_data = qy_value
         except:
-            pass
+            logging.error(sys.exc_value)
 
         return output
Index: src/sas/calculator/sas_gen.py
===================================================================
--- src/sas/calculator/sas_gen.py	(revision e3f77d8b34c4c57adc9d718e8b1ace18d3a4b793)
+++ src/sas/calculator/sas_gen.py	(revision b6627d95d435a7f25f17862e4ac78ae26bdb6393)
@@ -1,2 +1,3 @@
+# pylint: disable=invalid-name
 """
 SAS generic computation and sld file readers
@@ -9,4 +10,6 @@
 import os
 import copy
+import sys
+import logging
 
 MFACTOR_AM = 2.853E-12
@@ -285,5 +288,5 @@
                 mask = (x_dir2 + y_dir2 + z_dir2) <= 1.0
             except:
-                pass
+                logging.error(sys.exc_value)
         self.output = MagSLD(self.pos_x[mask], self.pos_y[mask],
                              self.pos_z[mask], self.sld_n[mask],
@@ -394,5 +397,5 @@
                 except:
                     # Skip non-data lines
-                    pass
+                    logging.error(sys.exc_value)
                 #Reading Header; Segment count ignored
                 s_line = line.split(":", 1)
@@ -589,5 +592,5 @@
                         z_lines.append(z_line)
                 except:
-                    pass
+                    logging.error(sys.exc_value)
 
             output = MagSLD(pos_x, pos_y, pos_z, sld_n, sld_mx, sld_my, sld_mz)
@@ -683,5 +686,5 @@
                     except:
                         # Skip non-data lines
-                        pass
+                        logging.error(sys.exc_value)
             output = MagSLD(pos_x, pos_y, pos_z, sld_n,
                             sld_mx, sld_my, sld_mz)
@@ -1037,4 +1040,7 @@
 
 def test_load():
+    """
+        Test code
+    """
     from sas.plottools.arrow3d import Arrow3D
     current_dir = os.path.abspath(os.path.curdir)
@@ -1083,5 +1089,9 @@
     ax.add_artist(a)
     plt.show()
+
 def test():
+    """
+        Test code
+    """
     current_dir = os.path.abspath(os.path.curdir)
     for i in range(3):
Index: src/sas/calculator/slit_length_calculator.py
===================================================================
--- src/sas/calculator/slit_length_calculator.py	(revision 6bd3a8d1ff8ae5d31daee4cf6f10dfaeb0d72131)
+++ src/sas/calculator/slit_length_calculator.py	(revision b6627d95d435a7f25f17862e4ac78ae26bdb6393)
@@ -57,5 +57,5 @@
 
         # sum 10 or more y values until getting max_y,
-        while (True):
+        while True:
             if ind >= 10 and y_max == max_y:
                 break
@@ -72,5 +72,5 @@
         ind = 0.0
         # find indices where it crosses y = y_half.
-        while (True):
+        while True:
             # no need to check when ind == 0
             ind += 1
