Changeset b9d74f3 in sasview for src/sas/sascalc/calculator/sas_gen.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/calculator/sas_gen.py
r7432acb rb9d74f3 32 32 factor = MFACTOR_MT 33 33 else: 34 raise ValueError , "Invalid valueunit"34 raise ValueError("Invalid valueunit") 35 35 sld_m = factor * mag 36 36 return sld_m … … 172 172 if len(x[1]) > 0: 173 173 msg = "Not a 1D." 174 raise ValueError , msg174 raise ValueError(msg) 175 175 i_out = np.zeros_like(x[0]) 176 176 # 1D I is found at y =0 in the 2D pattern … … 179 179 else: 180 180 msg = "Q must be given as list of qx's and qy's" 181 raise ValueError , msg181 raise ValueError(msg) 182 182 183 183 def runXY(self, x=0.0): … … 194 194 else: 195 195 msg = "Q must be given as list of qx's and qy's" 196 raise ValueError , msg196 raise ValueError(msg) 197 197 198 198 def evalDistribution(self, qdist): … … 212 212 mesg = "evalDistribution is expecting an ndarray of " 213 213 mesg += "a list [qx,qy] where qx,qy are arrays." 214 raise RuntimeError , mesg214 raise RuntimeError(mesg) 215 215 216 216 class OMF2SLD(object): … … 313 313 msg = "Error: Inconsistent data length." 314 314 if len(self.pos_x) != length: 315 raise ValueError , msg315 raise ValueError(msg) 316 316 if len(self.pos_y) != length: 317 raise ValueError , msg317 raise ValueError(msg) 318 318 if len(self.pos_z) != length: 319 raise ValueError , msg319 raise ValueError(msg) 320 320 if len(self.mx) != length: 321 raise ValueError , msg321 raise ValueError(msg) 322 322 if len(self.my) != length: 323 raise ValueError , msg323 raise ValueError(msg) 324 324 if len(self.mz) != length: 325 raise ValueError , msg325 raise ValueError(msg) 326 326 327 327 def remove_null_points(self, remove=False, recenter=False): … … 413 413 msg = "Error: \n" 414 414 msg += "We accept only m as meshunit" 415 raise ValueError , msg415 raise ValueError(msg) 416 416 if s_line[0].lower().count("xbase") > 0: 417 417 xbase = s_line[1].lstrip() … … 483 483 msg = "%s is not supported: \n" % path 484 484 msg += "We accept only Text format OMF file." 485 raise RuntimeError , msg485 raise RuntimeError(msg) 486 486 487 487 class PDBReader(object): … … 603 603 return output 604 604 except: 605 raise RuntimeError , "%s is not a sld file" % path605 raise RuntimeError("%s is not a sld file" % path) 606 606 607 607 def write(self, path, data): … … 695 695 return output 696 696 except: 697 raise RuntimeError , "%s is not a sld file" % path697 raise RuntimeError("%s is not a sld file" % path) 698 698 699 699 def write(self, path, data): … … 704 704 """ 705 705 if path is None: 706 raise ValueError , "Missing the file path."706 raise ValueError("Missing the file path.") 707 707 if data is None: 708 raise ValueError , "Missing the data to save."708 raise ValueError("Missing the data to save.") 709 709 x_val = data.pos_x 710 710 y_val = data.pos_y
Note: See TracChangeset
for help on using the changeset viewer.