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