Index: src/sas/dataloader/data_info.py
===================================================================
--- src/sas/dataloader/data_info.py	(revision 5e326a64f3587643c6a4cb468b4e95e5c900be9b)
+++ src/sas/dataloader/data_info.py	(revision e4f421c0a34d70fd2c819d6a21a0b6b3e207cae5)
@@ -2,8 +2,8 @@
     Module that contains classes to hold information read from
     reduced data files.
-    
+
     A good description of the data members can be found in
     the CanSAS 1D XML data format:
-    
+
     http://www.smallangles.net/wgwiki/index.php/cansas1d_documentation
 """
@@ -26,8 +26,8 @@
 import math
 
-class plottable_sesans1D:
+class plottable_sesans1D(object):
     """
     SESANS is a place holder for 1D SESANS plottables.
-    
+
     #TODO: This was directly copied from the plottables_1D. Modified Somewhat.
     #Class has been updated.
@@ -45,5 +45,5 @@
     ## Slit smearing width
     dxw = None
-    
+
     # Units
     _xaxis = ''
@@ -51,5 +51,5 @@
     _yaxis = ''
     _yunit = ''
-    
+
     def __init__(self, x, y, lam, dx=None, dy=None, dlam=None):
 #        print "SESANS plottable working"
@@ -63,9 +63,5 @@
         if dlam is not None:
             self.dlam = numpy.asarray(dlam)
-#        if dxl is not None:
-#            self.dxl = numpy.asarray(dxl)
-#        if dxw is not None: 
-#            self.dxw = numpy.asarray(dxw)
-#        print "SESANS plottable init fin"
+
     def xaxis(self, label, unit):
         """
@@ -74,20 +70,14 @@
         self._xaxis = label
         self._xunit = unit
-        print "xaxis active"
-        print label
-        print unit
+
     def yaxis(self, label, unit):
         """
         set the y axis label and unit
         """
-        print "yaxis active"
-        print label
-        print unit
-        
         self._yaxis = label
         self._yunit = unit
 
 
-class plottable_1D:
+class plottable_1D(object):
     """
     Data1D is a place holder for 1D plottables.
@@ -103,5 +93,5 @@
     ## Slit smearing width
     dxw = None
-    
+
     # Units
     _xaxis = ''
@@ -109,5 +99,5 @@
     _yaxis = ''
     _yunit = ''
-    
+
     def __init__(self, x, y, dx=None, dy=None, dxl=None, dxw=None):
         self.x = numpy.asarray(x)
@@ -119,5 +109,5 @@
         if dxl is not None:
             self.dxl = numpy.asarray(dxl)
-        if dxw is not None: 
+        if dxw is not None:
             self.dxw = numpy.asarray(dxw)
 
@@ -128,5 +118,5 @@
         self._xaxis = label
         self._xunit = unit
-        
+
     def yaxis(self, label, unit):
         """
@@ -137,5 +127,5 @@
 
 
-class plottable_2D:
+class plottable_2D(object):
     """
     Data2D is a place holder for 2D plottables.
@@ -153,5 +143,5 @@
     dqy_data = None
     mask = None
-    
+
     # Units
     _xaxis = ''
@@ -161,5 +151,5 @@
     _zaxis = ''
     _zunit = ''
-    
+
     def __init__(self, data=None, err_data=None, qx_data=None,
                  qy_data=None, q_data=None, mask=None,
@@ -172,8 +162,8 @@
         self.err_data = numpy.asarray(err_data)
         if dqx_data is not None:
-            self.dqx_data = numpy.asarray(dqx_data) 
+            self.dqx_data = numpy.asarray(dqx_data)
         if dqy_data is not None:
-            self.dqy_data = numpy.asarray(dqy_data) 
-               
+            self.dqy_data = numpy.asarray(dqy_data)
+
     def xaxis(self, label, unit):
         """
@@ -182,5 +172,5 @@
         self._xaxis = label
         self._xunit = unit
-        
+
     def yaxis(self, label, unit):
         """
@@ -189,5 +179,5 @@
         self._yaxis = label
         self._yunit = unit
-            
+
     def zaxis(self, label, unit):
         """
@@ -197,6 +187,6 @@
         self._zunit = unit
 
-            
-class Vector:
+
+class Vector(object):
     """
     Vector class to hold multi-dimensional objects
@@ -208,25 +198,24 @@
     ## z component
     z = None
-    
+
     def __init__(self, x=None, y=None, z=None):
         """
         Initialization. Components that are not
         set a set to None by default.
-        
+
         :param x: x component
         :param y: y component
         :param z: z component
-        
         """
         self.x = x
         self.y = y
         self.z = z
-        
+
     def __str__(self):
         msg = "x = %s\ty = %s\tz = %s" % (str(self.x), str(self.y), str(self.z))
         return msg
-        
-
-class Detector:
+
+
+class Detector(object):
     """
     Class to hold detector information
@@ -255,18 +244,16 @@
     slit_length = None
     slit_length_unit = 'mm'
-    
+
     def __init__(self):
         """
-        
         Initialize class attribute that are objects...
-        
-        """
-        self.offset      = Vector()
+        """
+        self.offset = Vector()
         self.orientation = Vector()
         self.beam_center = Vector()
-        self.pixel_size  = Vector()
-        
+        self.pixel_size = Vector()
+
     def __str__(self):
-        _str  = "Detector:\n"
+        _str = "Detector:\n"
         _str += "   Name:         %s\n" % self.name
         _str += "   Distance:     %s [%s]\n" % \
@@ -285,5 +272,5 @@
 
 
-class Aperture:
+class Aperture(object):
     ## Name
     name = None
@@ -298,10 +285,10 @@
     distance = None
     distance_unit = 'mm'
-    
+
     def __init__(self):
         self.size = Vector()
-    
-    
-class Collimation:
+
+
+class Collimation(object):
     """
     Class to hold collimation information
@@ -314,8 +301,8 @@
     ## Aperture
     aperture = None
-    
+
     def __init__(self):
         self.aperture = []
-    
+
     def __str__(self):
         _str = "Collimation:\n"
@@ -330,5 +317,5 @@
 
 
-class Source:
+class Source(object):
     """
     Class to hold source information
@@ -357,10 +344,10 @@
     wavelength_spread = None
     wavelength_spread_unit = 'percent'
-    
+
     def __init__(self):
         self.beam_size = Vector()
-        
+
     def __str__(self):
-        _str  = "Source:\n"
+        _str = "Source:\n"
         _str += "   Radiation:    %s\n" % str(self.radiation)
         _str += "   Shape:        %s\n" % str(self.beam_shape)
@@ -376,16 +363,16 @@
             (str(self.beam_size), str(self.beam_size_unit))
         return _str
-    
-    
+
+
 """
 Definitions of radiation types
 """
-NEUTRON  = 'neutron'
-XRAY     = 'x-ray'
-MUON     = 'muon'
+NEUTRON = 'neutron'
+XRAY = 'x-ray'
+MUON = 'muon'
 ELECTRON = 'electron'
-    
-    
-class Sample:
+
+
+class Sample(object):
     """
     Class to hold the sample description
@@ -411,12 +398,12 @@
     ## Details
     details = None
-    
+
     def __init__(self):
-        self.position    = Vector()
+        self.position = Vector()
         self.orientation = Vector()
-        self.details     = []
-    
+        self.details = []
+
     def __str__(self):
-        _str  = "Sample:\n"
+        _str = "Sample:\n"
         _str += "   ID:           %s\n" % str(self.ID)
         _str += "   Transmission: %s\n" % str(self.transmission)
@@ -429,13 +416,13 @@
         _str += "   Orientation:  %s [%s]\n" % \
             (str(self.orientation), str(self.orientation_unit))
-        
+
         _str += "   Details:\n"
         for item in self.details:
             _str += "      %s\n" % item
-            
+
         return _str
-  
-  
-class Process:
+
+
+class Process(object):
     """
     Class that holds information about the processes
@@ -447,11 +434,11 @@
     term = None
     notes = None
-    
+
     def __init__(self):
         self.term = []
         self.notes = []
-    
+
     def __str__(self):
-        _str  = "Process:\n"
+        _str = "Process:\n"
         _str += "   Name:         %s\n" % self.name
         _str += "   Date:         %s\n" % self.date
@@ -462,6 +449,7 @@
             _str += "   Note:         %s\n" % item
         return _str
-    
-class TransmissionSpectrum:
+
+
+class TransmissionSpectrum(object):
     """
     Class that holds information about transmission spectrum
@@ -479,12 +467,12 @@
     transmission_deviation = None
     transmission_deviation_unit = ''
-    
+
     def __init__(self):
         self.wavelength = []
         self.transmission = []
         self.transmission_deviation = []
-    
+
     def __str__(self):
-        _str  = "Transmission Spectrum:\n"
+        _str = "Transmission Spectrum:\n"
         _str += "   Name:             \t{0}\n".format(self.name)
         _str += "   Timestamp:        \t{0}\n".format(self.timestamp)
@@ -497,7 +485,7 @@
         _str += "   Number of Pts:    \t{0}\n".format(max(length_list))
         return _str
-    
-  
-class DataInfo:
+
+
+class DataInfo(object):
     """
     Class to hold the data read from a file.
@@ -507,23 +495,23 @@
     """
     ## Title
-    title      = ''
+    title = ''
     ## Run number
-    run        = None
+    run = None
     ## Run name
-    run_name   = None
+    run_name = None
     ## File name
-    filename   = ''
+    filename = ''
     ## Notes
-    notes      = None
+    notes = None
     ## Processes (Action on the data)
-    process    = None
+    process = None
     ## Instrument name
     instrument = ''
     ## Detector information
-    detector   = None
+    detector = None
     ## Sample information
-    sample     = None
+    sample = None
     ## Source information
-    source     = None
+    source = None
     ## Collimation information
     collimation = None
@@ -531,31 +519,31 @@
     trans_spectrum = None
     ## Additional meta-data
-    meta_data  = None
+    meta_data = None
     ## Loading errors
     errors = None
-            
+
     def __init__(self):
         """
         Initialization
         """
-        ## Title 
-        self.title      = ''
+        ## Title
+        self.title = ''
         ## Run number
-        self.run        = []
-        self.run_name   = {}
+        self.run = []
+        self.run_name = {}
         ## File name
-        self.filename   = ''
+        self.filename = ''
         ## Notes
-        self.notes      = []
+        self.notes = []
         ## Processes (Action on the data)
-        self.process    = []
+        self.process = []
         ## Instrument name
         self.instrument = ''
         ## Detector information
-        self.detector   = []
+        self.detector = []
         ## Sample information
-        self.sample     = Sample()
+        self.sample = Sample()
         ## Source information
-        self.source     = Source()
+        self.source = Source()
         ## Collimation information
         self.collimation = []
@@ -563,13 +551,13 @@
         self.trans_spectrum = []
         ## Additional meta-data
-        self.meta_data  = {}
+        self.meta_data = {}
         ## Loading errors
         self.errors = []
-        
+
     def append_empty_process(self):
         """
         """
         self.process.append(Process())
-        
+
     def add_notes(self, message=""):
         """
@@ -577,10 +565,10 @@
         """
         self.notes.append(message)
-        
+
     def __str__(self):
         """
         Nice printout
         """
-        _str =  "File:            %s\n" % self.filename
+        _str = "File:            %s\n" % self.filename
         _str += "Title:           %s\n" % self.title
         _str += "Run:             %s\n" % str(self.run)
@@ -599,5 +587,5 @@
             _str += "%s\n" % str(item)
         return _str
-            
+
     # Private method to perform operation. Not implemented for DataInfo,
     # but should be implemented for each data class inherited from DataInfo
@@ -610,5 +598,5 @@
         """
         return NotImplemented
-    
+
     def _perform_union(self, other):
         """
@@ -622,5 +610,5 @@
         """
         Add two data sets
-        
+
         :param other: data set to add to the current one
         :return: new data set
@@ -630,73 +618,59 @@
             return a + b
         return self._perform_operation(other, operation)
-        
+
     def __radd__(self, other):
         """
         Add two data sets
-        
+
         :param other: data set to add to the current one
-        
         :return: new data set
-        
         :raise ValueError: raised when two data sets are incompatible
-        
         """
         def operation(a, b):
             return b + a
         return self._perform_operation(other, operation)
-        
+
     def __sub__(self, other):
         """
         Subtract two data sets
-        
+
         :param other: data set to subtract from the current one
-        
         :return: new data set
-        
         :raise ValueError: raised when two data sets are incompatible
-        
         """
         def operation(a, b):
             return a - b
         return self._perform_operation(other, operation)
-        
+
     def __rsub__(self, other):
         """
         Subtract two data sets
-        
+
         :param other: data set to subtract from the current one
-        
         :return: new data set
-        
         :raise ValueError: raised when two data sets are incompatible
-        
         """
         def operation(a, b):
             return b - a
         return self._perform_operation(other, operation)
-        
+
     def __mul__(self, other):
         """
         Multiply two data sets
-        
+
         :param other: data set to subtract from the current one
-        
         :return: new data set
-        
         :raise ValueError: raised when two data sets are incompatible
-        
         """
         def operation(a, b):
             return a * b
         return self._perform_operation(other, operation)
-        
+
     def __rmul__(self, other):
         """
         Multiply two data sets
-        
+
         :param other: data set to subtract from the current one
-        
         :return: new data set
-        
         :raise ValueError: raised when two data sets are incompatible
         """
@@ -704,62 +678,49 @@
             return b * a
         return self._perform_operation(other, operation)
-        
+
     def __div__(self, other):
         """
         Divided a data set by another
-        
+
         :param other: data set that the current one is divided by
-        
         :return: new data set
-        
         :raise ValueError: raised when two data sets are incompatible
-        
         """
         def operation(a, b):
             return a/b
         return self._perform_operation(other, operation)
-        
+
     def __rdiv__(self, other):
         """
         Divided a data set by another
-        
+
         :param other: data set that the current one is divided by
-        
         :return: new data set
-        
         :raise ValueError: raised when two data sets are incompatible
-        
         """
         def operation(a, b):
             return b/a
         return self._perform_operation(other, operation)
-            
-        
+
     def __or__(self, other):
         """
         Union a data set with another
-        
+
         :param other: data set to be unified
-        
         :return: new data set
-        
         :raise ValueError: raised when two data sets are incompatible
-        
         """
         return self._perform_union(other)
-        
+
     def __ror__(self, other):
         """
         Union a data set with another
-        
+
         :param other: data set to be unified
-        
         :return: new data set
-        
         :raise ValueError: raised when two data sets are incompatible
-        
         """
         return self._perform_union(other)
-  
+
 class SESANSData1D(plottable_sesans1D, DataInfo):
     """
@@ -768,18 +729,14 @@
     x_unit = 'nm'
     y_unit = 'a.u.'
-    
+
     def __init__(self, x=None, y=None, lam=None, dy=None, dx=None, dlam=None):
-#        print "dat init"
         DataInfo.__init__(self)
-#        print "dat init fin"
         plottable_sesans1D.__init__(self, x, y, lam, dx, dy, dlam)
-#        print "SESANSdata1D init"
+
     def __str__(self):
         """
         Nice printout
         """
-#        print "string printer active"
-        _str =  "%s\n" % DataInfo.__str__(self)
-    
+        _str = "%s\n" % DataInfo.__str__(self)
         _str += "Data:\n"
         _str += "   Type:         %s\n" % self.__class__.__name__
@@ -787,23 +744,6 @@
         _str += "   Y-axis:       %s\t[%s]\n" % (self._yaxis, self._yunit)
         _str += "   Length:       %g\n" % len(self.x)
-#        print _str
         return _str
-#
-#    def is_slit_smeared(self):
-#        """
-#        Check whether the data has slit smearing information
-#        
-#        :return: True is slit smearing info is present, False otherwise
-#        
-#        """
-#        def _check(v):
-#            if (v.__class__ == list or v.__class__ == numpy.ndarray) \
-#                and len(v) > 0 and min(v) > 0:
-#                return True
-#            
-#            return False
-#        
-#        return _check(self.dxl) or _check(self.dxw)
-        
+
     def clone_without_data(self, length=0, clone=None):
         """
@@ -811,35 +751,32 @@
         will be filled out by a subsequent operation).
         The data arrays will be initialized to zero.
-        
+
         :param length: length of the data array to be initialized
         :param clone: if provided, the data will be copied to clone
         """
         from copy import deepcopy
-#        print " SESANS data 1D clone active"
         if clone is None or not issubclass(clone.__class__, Data1D):
-            x  = numpy.zeros(length)
+            x = numpy.zeros(length)
             dx = numpy.zeros(length)
-            lam  = numpy.zeros(length)
-            dlam = numpy.zeros(length)
-            y  = numpy.zeros(length)
+            y = numpy.zeros(length)
             dy = numpy.zeros(length)
             clone = Data1D(x, y, dx=dx, dy=dy)
-        
-        clone.title          = self.title
-        clone.run            = self.run
-        clone.filename       = self.filename
-        clone.instrument     = self.instrument
-        clone.notes          = deepcopy(self.notes)
-        clone.process        = deepcopy(self.process)
-        clone.detector       = deepcopy(self.detector)
-        clone.sample         = deepcopy(self.sample)
-        clone.source         = deepcopy(self.source)
-        clone.collimation    = deepcopy(self.collimation)
+
+        clone.title = self.title
+        clone.run = self.run
+        clone.filename = self.filename
+        clone.instrument = self.instrument
+        clone.notes = deepcopy(self.notes)
+        clone.process = deepcopy(self.process)
+        clone.detector = deepcopy(self.detector)
+        clone.sample = deepcopy(self.sample)
+        clone.source = deepcopy(self.source)
+        clone.collimation = deepcopy(self.collimation)
         clone.trans_spectrum = deepcopy(self.trans_spectrum)
-        clone.meta_data      = deepcopy(self.meta_data)
-        clone.errors         = deepcopy(self.errors)
-#        print "SESANS Data 1Dclone done"
+        clone.meta_data = deepcopy(self.meta_data)
+        clone.errors = deepcopy(self.errors)
+
         return clone
-              
+
 class Data1D(plottable_1D, DataInfo):
     """
@@ -848,15 +785,14 @@
     x_unit = '1/A'
     y_unit = '1/cm'
-    
+
     def __init__(self, x, y, dx=None, dy=None):
         DataInfo.__init__(self)
         plottable_1D.__init__(self, x, y, dx, dy)
-        
+
     def __str__(self):
         """
         Nice printout
         """
-        _str =  "%s\n" % DataInfo.__str__(self)
-    
+        _str = "%s\n" % DataInfo.__str__(self)
         _str += "Data:\n"
         _str += "   Type:         %s\n" % self.__class__.__name__
@@ -864,5 +800,4 @@
         _str += "   Y-axis:       %s\t[%s]\n" % (self._yaxis, self._yunit)
         _str += "   Length:       %g\n" % len(self.x)
-
         return _str
 
@@ -870,7 +805,5 @@
         """
         Check whether the data has slit smearing information
-        
         :return: True is slit smearing info is present, False otherwise
-        
         """
         def _check(v):
@@ -878,9 +811,7 @@
                 and len(v) > 0 and min(v) > 0:
                 return True
-            
             return False
-        
         return _check(self.dxl) or _check(self.dxw)
-        
+
     def clone_without_data(self, length=0, clone=None):
         """
@@ -888,31 +819,31 @@
         will be filled out by a subsequent operation).
         The data arrays will be initialized to zero.
-        
+
         :param length: length of the data array to be initialized
         :param clone: if provided, the data will be copied to clone
         """
         from copy import deepcopy
-        
+
         if clone is None or not issubclass(clone.__class__, Data1D):
-            x  = numpy.zeros(length)
+            x = numpy.zeros(length)
             dx = numpy.zeros(length)
-            y  = numpy.zeros(length)
+            y = numpy.zeros(length)
             dy = numpy.zeros(length)
             clone = Data1D(x, y, dx=dx, dy=dy)
-        
-        clone.title          = self.title
-        clone.run            = self.run
-        clone.filename       = self.filename
-        clone.instrument     = self.instrument
-        clone.notes          = deepcopy(self.notes)
-        clone.process        = deepcopy(self.process)
-        clone.detector       = deepcopy(self.detector)
-        clone.sample         = deepcopy(self.sample)
-        clone.source         = deepcopy(self.source)
-        clone.collimation    = deepcopy(self.collimation)
+
+        clone.title = self.title
+        clone.run = self.run
+        clone.filename = self.filename
+        clone.instrument = self.instrument
+        clone.notes = deepcopy(self.notes)
+        clone.process = deepcopy(self.process)
+        clone.detector = deepcopy(self.detector)
+        clone.sample = deepcopy(self.sample)
+        clone.source = deepcopy(self.source)
+        clone.collimation = deepcopy(self.collimation)
         clone.trans_spectrum = deepcopy(self.trans_spectrum)
-        clone.meta_data      = deepcopy(self.meta_data)
-        clone.errors         = deepcopy(self.errors)
-        
+        clone.meta_data = deepcopy(self.meta_data)
+        clone.errors = deepcopy(self.errors)
+
         return clone
 
@@ -924,11 +855,8 @@
         errors vectors if they were present or vectors
         of zeros when none was found.
-        
+
         :param other: other data set for operation
-        
         :return: dy for self, dy for other [numpy arrays]
-        
         :raise ValueError: when lengths are not compatible
-        
         """
         dy_other = None
@@ -939,5 +867,4 @@
                 msg = "Unable to perform operation: data length are not equal"
                 raise ValueError, msg
-            
             # Here we could also extrapolate between data points
             ZERO = 1.0e-12
@@ -946,18 +873,5 @@
                     msg = "Incompatible data sets: x-values do not match"
                     raise ValueError, msg
-                """
-                if self.dxl != None and other.dxl == None:
-                    msg = "Incompatible data sets: dxl-values do not match"
-                    raise ValueError, msg
-                if self.dxl == None and other.dxl != None:
-                    msg = "Incompatible data sets: dxl-values do not match"
-                    raise ValueError, msg
-                if self.dxw != None and other.dxw == None:
-                    msg = "Incompatible data sets: dxw-values do not match"
-                    raise ValueError, msg
-                if self.dxw == None and other.dxw != None:
-                    msg = "Incompatible data sets: dxw-values do not match"
-                    raise ValueError, msg
-                """
+
             # Check that the other data set has errors, otherwise
             # create zero vector
@@ -965,10 +879,10 @@
             if other.dy == None or (len(other.dy) != len(other.y)):
                 dy_other = numpy.zeros(len(other.y))
-            
+
         # Check that we have errors, otherwise create zero vector
         dy = self.dy
         if self.dy == None or (len(self.dy) != len(self.y)):
             dy = numpy.zeros(len(self.y))
-            
+
         return dy, dy_other
 
@@ -996,5 +910,5 @@
             if self.dxl is not None and len(self.x) == len(self.dxl):
                 result.dxl[i] = self.dxl[i]
-            
+
             a = Uncertainty(self.y[i], dy[i]**2)
             if isinstance(other, Data1D):
@@ -1012,10 +926,10 @@
             else:
                 b = other
-            
+
             output = operation(a, b)
             result.y[i] = output.x
             result.dy[i] = math.sqrt(math.fabs(output.variance))
         return result
-    
+
     def _validity_check_union(self, other):
         """
@@ -1025,15 +939,12 @@
         errors vectors if they were present or vectors
         of zeros when none was found.
-        
+
         :param other: other data set for operation
-        
         :return: bool
-        
         :raise ValueError: when data types are not compatible
-        
         """
         if not isinstance(other, Data1D):
             msg = "Unable to perform operation: different types of data set"
-            raise ValueError, msg   
+            raise ValueError, msg
         return True
 
@@ -1080,6 +991,6 @@
             result.dxl = result.dxl[ind]
         return result
-        
-        
+
+
 class Data2D(plottable_2D, DataInfo):
     """
@@ -1088,14 +999,11 @@
     ## Units for Q-values
     Q_unit = '1/A'
-    
     ## Units for I(Q) values
     I_unit = '1/cm'
-    
     ## Vector of Q-values at the center of each bin in x
     x_bins = None
-    
     ## Vector of Q-values at the center of each bin in y
     y_bins = None
-    
+
     def __init__(self, data=None, err_data=None, qx_data=None,
                  qy_data=None, q_data=None, mask=None,
@@ -1111,16 +1019,11 @@
     def __str__(self):
         _str = "%s\n" % DataInfo.__str__(self)
-        
         _str += "Data:\n"
         _str += "   Type:         %s\n" % self.__class__.__name__
         _str += "   X- & Y-axis:  %s\t[%s]\n" % (self._yaxis, self._yunit)
         _str += "   Z-axis:       %s\t[%s]\n" % (self._zaxis, self._zunit)
-        #leny = 0
-        #if len(self.data) > 0:
-        #    leny = len(self.data)
         _str += "   Length:       %g \n" % (len(self.data))
-        
         return _str
-  
+
     def clone_without_data(self, length=0, clone=None):
         """
@@ -1128,10 +1031,10 @@
         will be filled out by a subsequent operation).
         The data arrays will be initialized to zero.
-        
+
         :param length: length of the data array to be initialized
         :param clone: if provided, the data will be copied to clone
         """
         from copy import deepcopy
-        
+
         if clone is None or not issubclass(clone.__class__, Data2D):
             data = numpy.zeros(length)
@@ -1143,23 +1046,23 @@
             dqx_data = None
             dqy_data = None
-            clone = Data2D(data=data, err_data=err_data, 
-                           qx_data=qx_data, qy_data=qy_data, 
+            clone = Data2D(data=data, err_data=err_data,
+                           qx_data=qx_data, qy_data=qy_data,
                            q_data=q_data, mask=mask)
 
-        clone.title       = self.title
-        clone.run         = self.run
-        clone.filename    = self.filename
-        clone.instrument  = self.instrument
-        clone.notes       = deepcopy(self.notes)
-        clone.process     = deepcopy(self.process)
-        clone.detector    = deepcopy(self.detector)
-        clone.sample      = deepcopy(self.sample)
-        clone.source      = deepcopy(self.source)
+        clone.title = self.title
+        clone.run = self.run
+        clone.filename = self.filename
+        clone.instrument = self.instrument
+        clone.notes = deepcopy(self.notes)
+        clone.process = deepcopy(self.process)
+        clone.detector = deepcopy(self.detector)
+        clone.sample = deepcopy(self.sample)
+        clone.source = deepcopy(self.source)
         clone.collimation = deepcopy(self.collimation)
-        clone.meta_data   = deepcopy(self.meta_data)
-        clone.errors      = deepcopy(self.errors)
-        
+        clone.meta_data = deepcopy(self.meta_data)
+        clone.errors = deepcopy(self.errors)
+
         return clone
-  
+
     def _validity_check(self, other):
         """
@@ -1169,11 +1072,8 @@
         errors vectors if they were present or vectors
         of zeros when none was found.
-        
+
         :param other: other data set for operation
-        
         :return: dy for self, dy for other [numpy arrays]
-        
         :raise ValueError: when lengths are not compatible
-        
         """
         err_other = None
@@ -1185,7 +1085,4 @@
                 msg = "Unable to perform operation: data length are not equal"
                 raise ValueError, msg
-            #if len(self.data) < 1:
-            #    msg = "Incompatible data sets: I-values do not match"
-            #    raise ValueError, msg 
             for ind in range(len(self.data)):
                 if self.qx_data[ind] != other.qx_data[ind]:
@@ -1195,5 +1092,5 @@
                     msg = "Incompatible data sets: qy-values do not match"
                     raise ValueError, msg
-                   
+
             # Check that the scales match
             err_other = other.err_data
@@ -1201,5 +1098,5 @@
                 (len(other.err_data) != len(other.data)):
                 err_other = numpy.zeros(len(other.data))
-            
+
         # Check that we have errors, otherwise create zero vector
         err = self.err_data
@@ -1207,14 +1104,12 @@
             (len(self.err_data) != len(self.data)):
             err = numpy.zeros(len(other.data))
-            
         return err, err_other
-  
+
     def _perform_operation(self, other, operation):
         """
         Perform 2D operations between data sets
-        
+
         :param other: other data set
         :param operation: function defining the operation
-        
         """
         # First, check the data compatibility
@@ -1231,5 +1126,5 @@
             if self.err_data is not None and \
                 numpy.size(self.data) == numpy.size(self.err_data):
-                result.err_data[i] = self.err_data[i]    
+                result.err_data[i] = self.err_data[i]
             if self.dqx_data is not None:
                 result.dqx_data[i] = self.dqx_data[i]
@@ -1240,5 +1135,5 @@
             result.q_data[i] = self.q_data[i]
             result.mask[i] = self.mask[i]
-            
+
             a = Uncertainty(self.data[i], dy[i]**2)
             if isinstance(other, Data2D):
@@ -1249,5 +1144,5 @@
                     result.dqx_data[i] += (other.dqx_data[i]**2)
                     result.dqx_data[i] /= 2
-                    result.dqx_data[i] = math.sqrt(result.dqx_data[i])     
+                    result.dqx_data[i] = math.sqrt(result.dqx_data[i])
                 if other.dqy_data is not None and \
                         result.dqy_data is not None:
@@ -1258,10 +1153,9 @@
             else:
                 b = other
-            
             output = operation(a, b)
             result.data[i] = output.x
             result.err_data[i] = math.sqrt(math.fabs(output.variance))
         return result
-    
+
     def _validity_check_union(self, other):
         """
@@ -1271,24 +1165,20 @@
         errors vectors if they were present or vectors
         of zeros when none was found.
-        
+
         :param other: other data set for operation
-        
         :return: bool
-        
         :raise ValueError: when data types are not compatible
-        
         """
         if not isinstance(other, Data2D):
             msg = "Unable to perform operation: different types of data set"
-            raise ValueError, msg   
+            raise ValueError, msg
         return True
-    
+
     def _perform_union(self, other):
         """
         Perform 2D operations between data sets
-        
+
         :param other: other data set
         :param operation: function defining the operation
-        
         """
         # First, check the data compatibility
@@ -1301,5 +1191,5 @@
         result.ymax = self.ymax
         if self.dqx_data == None or self.dqy_data == None or \
-                other.dqx_data == None or other.dqy_data == None :
+                other.dqx_data == None or other.dqy_data == None:
             result.dqx_data = None
             result.dqy_data = None
@@ -1309,5 +1199,5 @@
             result.dqy_data = numpy.zeros(len(self.data) + \
                                          numpy.size(other.data))
-        
+
         result.data = numpy.append(self.data, other.data)
         result.qx_data = numpy.append(self.qx_data, other.qx_data)
