Changeset b9d74f3 in sasview for src/sas/sascalc/dataloader/readers/abs_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/abs_reader.py
r959eb01 rb9d74f3 50 50 input_f = open(path,'r') 51 51 except: 52 raise RuntimeError , "abs_reader: cannot open %s" % path52 raise RuntimeError("abs_reader: cannot open %s" % path) 53 53 buff = input_f.read() 54 54 lines = buff.split('\n') … … 99 99 #goes to ASC reader 100 100 msg = "abs_reader: cannot open %s" % path 101 raise RuntimeError , msg101 raise RuntimeError(msg) 102 102 103 103 # Distance in meters … … 114 114 #goes to ASC reader 115 115 msg = "abs_reader: cannot open %s" % path 116 raise RuntimeError , msg116 raise RuntimeError(msg) 117 117 # Transmission 118 118 try: … … 223 223 if not len(y) == len(dy): 224 224 msg = "abs_reader: y and dy have different length" 225 raise ValueError , msg225 raise ValueError(msg) 226 226 # If the data length is zero, consider this as 227 227 # though we were not able to read the file. 228 228 if len(x) == 0: 229 raise ValueError , "ascii_reader: could not load file"229 raise ValueError("ascii_reader: could not load file") 230 230 231 231 output.x = x[x != 0] … … 246 246 return output 247 247 else: 248 raise RuntimeError , "%s is not a file" % path248 raise RuntimeError("%s is not a file" % path) 249 249 return None
Note: See TracChangeset
for help on using the changeset viewer.