Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/dataloader/data_info.py

    r749b715 rdeaa0c6  
    716716                self.y_unit = '1/cm' 
    717717        except: # the data is not recognized/supported, and the user is notified 
    718             raise TypeError('data not recognized, check documentation for supported 1D data formats') 
     718            raise(TypeError, 'data not recognized, check documentation for supported 1D data formats') 
    719719 
    720720    def __str__(self): 
     
    775775        clone.meta_data = deepcopy(self.meta_data) 
    776776        clone.errors = deepcopy(self.errors) 
    777         clone.isSesans = self.isSesans 
    778777 
    779778        return clone 
     
    797796                len(self.y) != len(other.y): 
    798797                msg = "Unable to perform operation: data length are not equal" 
    799                 raise ValueError(msg) 
     798                raise ValueError, msg 
    800799            # Here we could also extrapolate between data points 
    801800            TOLERANCE = 0.01 
     
    803802                if math.fabs((self.x[i] - other.x[i])/self.x[i]) > TOLERANCE: 
    804803                    msg = "Incompatible data sets: x-values do not match" 
    805                     raise ValueError(msg) 
     804                    raise ValueError, msg 
    806805 
    807806            # Check that the other data set has errors, otherwise 
     
    877876        if not isinstance(other, Data1D): 
    878877            msg = "Unable to perform operation: different types of data set" 
    879             raise ValueError(msg) 
     878            raise ValueError, msg 
    880879        return True 
    881880 
     
    949948 
    950949        if len(self.detector) > 0: 
    951             raise RuntimeError("Data2D: Detector bank already filled at init") 
     950            raise RuntimeError, "Data2D: Detector bank already filled at init" 
    952951 
    953952    def __str__(self): 
     
    10211020                len(self.qy_data) != len(other.qy_data): 
    10221021                msg = "Unable to perform operation: data length are not equal" 
    1023                 raise ValueError(msg) 
     1022                raise ValueError, msg 
    10241023            for ind in range(len(self.data)): 
    10251024                if math.fabs((self.qx_data[ind] - other.qx_data[ind])/self.qx_data[ind]) > TOLERANCE: 
    10261025                    msg = "Incompatible data sets: qx-values do not match: %s %s" % (self.qx_data[ind], other.qx_data[ind]) 
    1027                     raise ValueError(msg) 
     1026                    raise ValueError, msg 
    10281027                if math.fabs((self.qy_data[ind] - other.qy_data[ind])/self.qy_data[ind]) > TOLERANCE: 
    10291028                    msg = "Incompatible data sets: qy-values do not match: %s %s" % (self.qy_data[ind], other.qy_data[ind]) 
    1030                     raise ValueError(msg) 
     1029                    raise ValueError, msg 
    10311030 
    10321031            # Check that the scales match 
     
    11091108        if not isinstance(other, Data2D): 
    11101109            msg = "Unable to perform operation: different types of data set" 
    1111             raise ValueError(msg) 
     1110            raise ValueError, msg 
    11121111        return True 
    11131112 
Note: See TracChangeset for help on using the changeset viewer.