Changeset b9d74f3 in sasview for src/sas/sascalc/dataloader/data_info.py
- Timestamp:
- Apr 20, 2017 6:29:34 AM (8 years ago)
- 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)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/dataloader/data_info.py
r7432acb rb9d74f3 715 715 self.y_unit = '1/cm' 716 716 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 718 718 719 719 def __str__(self): … … 795 795 len(self.y) != len(other.y): 796 796 msg = "Unable to perform operation: data length are not equal" 797 raise ValueError , msg797 raise ValueError(msg) 798 798 # Here we could also extrapolate between data points 799 799 TOLERANCE = 0.01 … … 801 801 if math.fabs((self.x[i] - other.x[i])/self.x[i]) > TOLERANCE: 802 802 msg = "Incompatible data sets: x-values do not match" 803 raise ValueError , msg803 raise ValueError(msg) 804 804 805 805 # Check that the other data set has errors, otherwise … … 875 875 if not isinstance(other, Data1D): 876 876 msg = "Unable to perform operation: different types of data set" 877 raise ValueError , msg877 raise ValueError(msg) 878 878 return True 879 879 … … 947 947 948 948 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") 950 950 951 951 def __str__(self): … … 1019 1019 len(self.qy_data) != len(other.qy_data): 1020 1020 msg = "Unable to perform operation: data length are not equal" 1021 raise ValueError , msg1021 raise ValueError(msg) 1022 1022 for ind in range(len(self.data)): 1023 1023 if math.fabs((self.qx_data[ind] - other.qx_data[ind])/self.qx_data[ind]) > TOLERANCE: 1024 1024 msg = "Incompatible data sets: qx-values do not match: %s %s" % (self.qx_data[ind], other.qx_data[ind]) 1025 raise ValueError , msg1025 raise ValueError(msg) 1026 1026 if math.fabs((self.qy_data[ind] - other.qy_data[ind])/self.qy_data[ind]) > TOLERANCE: 1027 1027 msg = "Incompatible data sets: qy-values do not match: %s %s" % (self.qy_data[ind], other.qy_data[ind]) 1028 raise ValueError , msg1028 raise ValueError(msg) 1029 1029 1030 1030 # Check that the scales match … … 1107 1107 if not isinstance(other, Data2D): 1108 1108 msg = "Unable to perform operation: different types of data set" 1109 raise ValueError , msg1109 raise ValueError(msg) 1110 1110 return True 1111 1111
Note: See TracChangeset
for help on using the changeset viewer.