Changeset 574adc7 in sasview for src/sas/sascalc/dataloader/data_info.py
- Timestamp:
- Sep 22, 2017 2:01:32 PM (7 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 34d7b35
- Parents:
- 9706d88
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/dataloader/data_info.py
r17e257b5 r574adc7 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): … … 796 796 len(self.y) != len(other.y): 797 797 msg = "Unable to perform operation: data length are not equal" 798 raise ValueError , msg798 raise ValueError(msg) 799 799 # Here we could also extrapolate between data points 800 800 TOLERANCE = 0.01 … … 802 802 if math.fabs((self.x[i] - other.x[i])/self.x[i]) > TOLERANCE: 803 803 msg = "Incompatible data sets: x-values do not match" 804 raise ValueError , msg804 raise ValueError(msg) 805 805 806 806 # Check that the other data set has errors, otherwise … … 876 876 if not isinstance(other, Data1D): 877 877 msg = "Unable to perform operation: different types of data set" 878 raise ValueError , msg878 raise ValueError(msg) 879 879 return True 880 880 … … 948 948 949 949 if len(self.detector) > 0: 950 raise RuntimeError , "Data2D: Detector bank already filled at init"950 raise RuntimeError("Data2D: Detector bank already filled at init") 951 951 952 952 def __str__(self): … … 1020 1020 len(self.qy_data) != len(other.qy_data): 1021 1021 msg = "Unable to perform operation: data length are not equal" 1022 raise ValueError , msg1022 raise ValueError(msg) 1023 1023 for ind in range(len(self.data)): 1024 1024 if math.fabs((self.qx_data[ind] - other.qx_data[ind])/self.qx_data[ind]) > TOLERANCE: 1025 1025 msg = "Incompatible data sets: qx-values do not match: %s %s" % (self.qx_data[ind], other.qx_data[ind]) 1026 raise ValueError , msg1026 raise ValueError(msg) 1027 1027 if math.fabs((self.qy_data[ind] - other.qy_data[ind])/self.qy_data[ind]) > TOLERANCE: 1028 1028 msg = "Incompatible data sets: qy-values do not match: %s %s" % (self.qy_data[ind], other.qy_data[ind]) 1029 raise ValueError , msg1029 raise ValueError(msg) 1030 1030 1031 1031 # Check that the scales match … … 1108 1108 if not isinstance(other, Data2D): 1109 1109 msg = "Unable to perform operation: different types of data set" 1110 raise ValueError , msg1110 raise ValueError(msg) 1111 1111 return True 1112 1112
Note: See TracChangeset
for help on using the changeset viewer.