Ignore:
Timestamp:
Apr 20, 2017 6:29:34 AM (8 years ago)
Author:
andyfaff
Children:
0cc77d8
Parents:
b636dfc5
git-author:
Andrew Nelson <andyfaff@…> (04/20/17 06:25:57)
git-committer:
Andrew Nelson <andyfaff@…> (04/20/17 06:29:34)
Message:

MAINT: use raise Exception() not raise Exception

File:
1 edited

Legend:

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

    r7432acb rb9d74f3  
    715715                self.y_unit = '1/cm' 
    716716        except: # the data is not recognized/supported, and the user is notified 
    717             raise(TypeError, 'data not recognized, check documentation for supported 1D data formats') 
     717            raise TypeError 
    718718 
    719719    def __str__(self): 
     
    795795                len(self.y) != len(other.y): 
    796796                msg = "Unable to perform operation: data length are not equal" 
    797                 raise ValueError, msg 
     797                raise ValueError(msg) 
    798798            # Here we could also extrapolate between data points 
    799799            TOLERANCE = 0.01 
     
    801801                if math.fabs((self.x[i] - other.x[i])/self.x[i]) > TOLERANCE: 
    802802                    msg = "Incompatible data sets: x-values do not match" 
    803                     raise ValueError, msg 
     803                    raise ValueError(msg) 
    804804 
    805805            # Check that the other data set has errors, otherwise 
     
    875875        if not isinstance(other, Data1D): 
    876876            msg = "Unable to perform operation: different types of data set" 
    877             raise ValueError, msg 
     877            raise ValueError(msg) 
    878878        return True 
    879879 
     
    947947 
    948948        if len(self.detector) > 0: 
    949             raise RuntimeError, "Data2D: Detector bank already filled at init" 
     949            raise RuntimeError("Data2D: Detector bank already filled at init") 
    950950 
    951951    def __str__(self): 
     
    10191019                len(self.qy_data) != len(other.qy_data): 
    10201020                msg = "Unable to perform operation: data length are not equal" 
    1021                 raise ValueError, msg 
     1021                raise ValueError(msg) 
    10221022            for ind in range(len(self.data)): 
    10231023                if math.fabs((self.qx_data[ind] - other.qx_data[ind])/self.qx_data[ind]) > TOLERANCE: 
    10241024                    msg = "Incompatible data sets: qx-values do not match: %s %s" % (self.qx_data[ind], other.qx_data[ind]) 
    1025                     raise ValueError, msg 
     1025                    raise ValueError(msg) 
    10261026                if math.fabs((self.qy_data[ind] - other.qy_data[ind])/self.qy_data[ind]) > TOLERANCE: 
    10271027                    msg = "Incompatible data sets: qy-values do not match: %s %s" % (self.qy_data[ind], other.qy_data[ind]) 
    1028                     raise ValueError, msg 
     1028                    raise ValueError(msg) 
    10291029 
    10301030            # Check that the scales match 
     
    11071107        if not isinstance(other, Data2D): 
    11081108            msg = "Unable to perform operation: different types of data set" 
    1109             raise ValueError, msg 
     1109            raise ValueError(msg) 
    11101110        return True 
    11111111 
Note: See TracChangeset for help on using the changeset viewer.