Changeset b9d74f3 in sasview for src/sas/sascalc/dataloader/readers/ascii_reader.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/readers/ascii_reader.py
r235f514 rb9d74f3 64 64 input_f = open(path,'rb') 65 65 except: 66 raise RuntimeError , "ascii_reader: cannot open %s" % path66 raise RuntimeError("ascii_reader: cannot open %s" % path) 67 67 buff = input_f.read() 68 68 lines = buff.splitlines() … … 173 173 if not is_data: 174 174 msg = "ascii_reader: x has no data" 175 raise RuntimeError , msg175 raise RuntimeError(msg) 176 176 # Sanity check 177 177 if has_error_dy == True and not len(ty) == len(tdy): 178 178 msg = "ascii_reader: y and dy have different length" 179 raise RuntimeError , msg179 raise RuntimeError(msg) 180 180 if has_error_dx == True and not len(tx) == len(tdx): 181 181 msg = "ascii_reader: y and dy have different length" 182 raise RuntimeError , msg182 raise RuntimeError(msg) 183 183 # If the data length is zero, consider this as 184 184 # though we were not able to read the file. 185 185 if len(tx) == 0: 186 raise RuntimeError , "ascii_reader: could not load file"186 raise RuntimeError("ascii_reader: could not load file") 187 187 188 188 #Let's re-order the data to make cal. … … 222 222 output.meta_data['loader'] = self.type_name 223 223 if len(output.x) < 1: 224 raise RuntimeError , "%s is empty" % path224 raise RuntimeError("%s is empty" % path) 225 225 return output 226 226 227 227 else: 228 raise RuntimeError , "%s is not a file" % path228 raise RuntimeError("%s is not a file" % path) 229 229 return None 230 230
Note: See TracChangeset
for help on using the changeset viewer.