Changes in src/sas/sascalc/dataloader/data_info.py [749b715:deaa0c6] in sasview
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/dataloader/data_info.py
r749b715 rdeaa0c6 716 716 self.y_unit = '1/cm' 717 717 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') 719 719 720 720 def __str__(self): … … 775 775 clone.meta_data = deepcopy(self.meta_data) 776 776 clone.errors = deepcopy(self.errors) 777 clone.isSesans = self.isSesans778 777 779 778 return clone … … 797 796 len(self.y) != len(other.y): 798 797 msg = "Unable to perform operation: data length are not equal" 799 raise ValueError (msg)798 raise ValueError, msg 800 799 # Here we could also extrapolate between data points 801 800 TOLERANCE = 0.01 … … 803 802 if math.fabs((self.x[i] - other.x[i])/self.x[i]) > TOLERANCE: 804 803 msg = "Incompatible data sets: x-values do not match" 805 raise ValueError (msg)804 raise ValueError, msg 806 805 807 806 # Check that the other data set has errors, otherwise … … 877 876 if not isinstance(other, Data1D): 878 877 msg = "Unable to perform operation: different types of data set" 879 raise ValueError (msg)878 raise ValueError, msg 880 879 return True 881 880 … … 949 948 950 949 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" 952 951 953 952 def __str__(self): … … 1021 1020 len(self.qy_data) != len(other.qy_data): 1022 1021 msg = "Unable to perform operation: data length are not equal" 1023 raise ValueError (msg)1022 raise ValueError, msg 1024 1023 for ind in range(len(self.data)): 1025 1024 if math.fabs((self.qx_data[ind] - other.qx_data[ind])/self.qx_data[ind]) > TOLERANCE: 1026 1025 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 1028 1027 if math.fabs((self.qy_data[ind] - other.qy_data[ind])/self.qy_data[ind]) > TOLERANCE: 1029 1028 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 1031 1030 1032 1031 # Check that the scales match … … 1109 1108 if not isinstance(other, Data2D): 1110 1109 msg = "Unable to perform operation: different types of data set" 1111 raise ValueError (msg)1110 raise ValueError, msg 1112 1111 return True 1113 1112
Note: See TracChangeset
for help on using the changeset viewer.