Changeset b9d74f3 in sasview for src/sas/sascalc/dataloader/readers/hfir1d_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/hfir1d_reader.py
r959eb01 rb9d74f3 49 49 input_f = open(path,'r') 50 50 except: 51 raise RuntimeError , "hfir1d_reader: cannot open %s" % path51 raise RuntimeError("hfir1d_reader: cannot open %s" % path) 52 52 buff = input_f.read() 53 53 lines = buff.split('\n') … … 99 99 if not len(y) == len(dy): 100 100 msg = "hfir1d_reader: y and dy have different length" 101 raise RuntimeError , msg101 raise RuntimeError(msg) 102 102 if not len(x) == len(dx): 103 103 msg = "hfir1d_reader: x and dx have different length" 104 raise RuntimeError , msg104 raise RuntimeError(msg) 105 105 106 106 # If the data length is zero, consider this as 107 107 # though we were not able to read the file. 108 108 if len(x) == 0: 109 raise RuntimeError , "hfir1d_reader: could not load file"109 raise RuntimeError("hfir1d_reader: could not load file") 110 110 111 111 output.x = x … … 126 126 return output 127 127 else: 128 raise RuntimeError , "%s is not a file" % path128 raise RuntimeError("%s is not a file" % path) 129 129 return None
Note: See TracChangeset
for help on using the changeset viewer.