Changes in / [4b402a1:131791e] in sasview
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
setup.py
r27109e5 rf3bf622 53 53 # os.remove(file_path) 54 54 if os.path.exists(SASVIEW_BUILD): 55 print "Removing existing build directory", SASVIEW_BUILD, "for a clean build"55 print("Removing existing build directory", SASVIEW_BUILD, "for a clean build") 56 56 shutil.rmtree(SASVIEW_BUILD) 57 57 … … 74 74 enable_openmp = False 75 75 except: 76 print "PROBLEM determining Darwin version"76 print("PROBLEM determining Darwin version") 77 77 78 78 # Options to enable OpenMP … … 95 95 platform_copt = {'unix' : ['-Wno-error=unused-command-line-argument-hard-error-in-future']} 96 96 except: 97 print "PROBLEM determining Darwin version"97 print("PROBLEM determining Darwin version") 98 98 99 99 class DisableOpenMPCommand(Command): … … 118 118 # Get 64-bitness 119 119 c = self.compiler.compiler_type 120 print "Compiling with %s (64bit=%s)" % (c, str(is_64bits))120 print("Compiling with %s (64bit=%s)" % (c, str(is_64bits))) 121 121 122 122 # OpenMP build options 123 123 if enable_openmp: 124 if c opt.has_key(c):124 if c in copt: 125 125 for e in self.extensions: 126 126 e.extra_compile_args = copt[ c ] 127 if lopt.has_key(c):127 if c in lopt: 128 128 for e in self.extensions: 129 129 e.extra_link_args = lopt[ c ] 130 130 131 131 # Platform-specific build options 132 if platform_lopt.has_key(c):132 if c in platform_lopt: 133 133 for e in self.extensions: 134 134 e.extra_link_args = platform_lopt[ c ] 135 135 136 if platform_copt.has_key(c):136 if c in platform_copt: 137 137 for e in self.extensions: 138 138 e.extra_compile_args = platform_copt[ c ] -
src/sas/sascalc/realspace/VolumeCanvas.py
rd85c194 r6435594 303 303 self.shapecount += 1 304 304 305 # model changed, need to recalculate P(r)305 # model changed, need to recalculate P(r) 306 306 self._model_changed() 307 307 … … 328 328 id = "shape"+str(self.shapecount) 329 329 330 # shapeDesc = ShapeDescriptor(shape.lower())330 # shapeDesc = ShapeDescriptor(shape.lower()) 331 331 if shape.lower() in shape_dict: 332 332 shapeDesc = shape_dict[shape.lower()]() … … 335 335 shapeDesc = PDBDescriptor(shape) 336 336 else: 337 raise ValueError , "VolumeCanvas.add: Unknown shape %s" % shape337 raise ValueError("VolumeCanvas.add: Unknown shape %s" % shape) 338 338 339 339 return self.addObject(shapeDesc, id) … … 345 345 """ 346 346 347 if self.shapes.has_key(id):347 if id in self.shapes: 348 348 del self.shapes[id] 349 349 else: 350 raise KeyError , "VolumeCanvas.delete: could not find shape ID"351 352 # model changed, need to recalculate P(r)350 raise KeyError("VolumeCanvas.delete: could not find shape ID") 351 352 # model changed, need to recalculate P(r) 353 353 self._model_changed() 354 354 … … 379 379 # If a shape identifier was given, look the shape up 380 380 # in the dictionary 381 if len(toks) >1:382 if toks[0] in self.shapes .keys():381 if len(toks): 382 if toks[0] in self.shapes: 383 383 # The shape was found, now look for the parameter 384 384 if toks[1] in self.shapes[toks[0]].params: … … 387 387 self._model_changed() 388 388 else: 389 raise ValueError , "Could not find parameter %s" % name389 raise ValueError("Could not find parameter %s" % name) 390 390 else: 391 raise ValueError , "Could not find shape %s" % toks[0]391 raise ValueError("Could not find shape %s" % toks[0]) 392 392 393 393 else: … … 410 410 if len(toks) == 1: 411 411 try: 412 self.params.has_key(toks[0])412 value = self.params[toks[0]] 413 413 except KeyError: 414 raise ValueError, \ 415 "VolumeCanvas.getParam: Could not find %s" % name 416 417 value = self.params[toks[0]] 414 raise ValueError("VolumeCanvas.getParam: Could not find" 415 " %s" % name) 418 416 if isinstance(value, ShapeDescriptor): 419 raise ValueError , \420 "VolumeCanvas.getParam: Cannot get parameter value."417 raise ValueError("VolumeCanvas.getParam: Cannot get parameter" 418 " value.") 421 419 else: 422 420 return value … … 424 422 elif len(toks) == 2: 425 423 try: 426 s elf.shapes.has_key(toks[0])424 shapeinstance = self.shapes[toks[0]] 427 425 except KeyError: 428 raise ValueError, \ 429 "VolumeCanvas.getParam: Could not find %s" % name 430 431 shapeinstance = self.shapes[toks[0]] 432 433 try: 434 shapeinstance.params.has_key(toks[1]) 435 except KeyError: 436 raise ValueError, \ 437 "VolumeCanvas.getParam: Could not find %s" % name 426 raise ValueError("VolumeCanvas.getParam: Could not find " 427 "%s" % name) 428 429 if not toks[1] in shapeinstance.params: 430 raise ValueError("VolumeCanvas.getParam: Could not find " 431 "%s" % name) 438 432 439 433 return shapeinstance.params[toks[1]] 440 434 441 435 else: 442 raise ValueError, \ 443 "VolumeCanvas.getParam: Could not find %s" % name 444 445 def getParamList(self, shapeid = None): 436 raise ValueError("VolumeCanvas.getParam: Could not find %s" % name) 437 438 def getParamList(self, shapeid=None): 446 439 """ 447 440 return a full list of all available parameters from … … 455 448 456 449 param_list = [] 457 if shapeid == None:458 for key1 in self.params .keys():450 if shapeid is None: 451 for key1 in self.params: 459 452 #value1 = self.params[key1] 460 453 param_list.append(key1) 461 for key2 in self.shapes .keys():454 for key2 in self.shapes: 462 455 value2 = self.shapes[key2] 463 456 header = key2 + '.' 464 for key3 in value2.params .keys():457 for key3 in value2.params: 465 458 fullname = header + key3 466 459 param_list.append(fullname) 467 460 468 461 else: 469 try: 470 self.shapes.has_key(shapeid) 471 except KeyError: 472 raise ValueError, \ 473 "VolumeCanvas: getParamList: Could not find %s" % shapeid 462 if not shapeid in self.shapes: 463 raise ValueError("VolumeCanvas: getParamList: Could not find " 464 "%s" % shapeid) 465 474 466 header = shapeid + '.' 475 param_list = self.shapes[shapeid].params.keys() 476 for i in range(len(param_list)): 477 param_list[i] = header + param_list[i] 478 467 param_list = [header + param for param in self.shapes[shapeid].params] 479 468 return param_list 480 469 … … 490 479 @param shapeDesc: shape description 491 480 """ 492 # Create the object model481 # Create the object model 493 482 shapeDesc.create() 494 483 … … 605 594 # type we recognize 606 595 else: 607 raise ValueError , "run(q): bad type for q"596 raise ValueError("run(q): bad type for q") 608 597 609 598 def runXY(self, q = 0): … … 625 614 # type we recognize 626 615 else: 627 raise ValueError , "runXY(q): bad type for q"616 raise ValueError("runXY(q): bad type for q") 628 617 629 618 def _create_modelObject(self): -
src/sas/sasgui/guiframe/gui_manager.py
r64ca561 r49165488 2122 2122 """ 2123 2123 if custom_config is not None: 2124 sas_opencl = os.environ.get("SAS_OPENCL" ,None)2124 sas_opencl = os.environ.get("SAS_OPENCL") 2125 2125 new_config_lines = [] 2126 2126 config_file = open(custom_config.__file__) -
src/sas/sasgui/guiframe/local_perspectives/data_loader/data_loader.py
r463e7ffc rc1d5aea 92 92 if dlg.ShowModal() == wx.ID_OK: 93 93 file_list = dlg.GetPaths() 94 if len(file_list) >= 0 and not file_list[0] isNone:94 if len(file_list) >= 0 and file_list[0] is not None: 95 95 self._default_save_location = os.path.dirname(file_list[0]) 96 96 path = self._default_save_location -
src/sas/sasgui/guiframe/media/data_formats_help.rst
r98c44f3 r76c4469 86 86 87 87 - Spin echo length (z, in Angstroms) 88 - depolarization (:math:`log(P/P_0)/(lambda^2 * thickness)`, in Angstrom ^-1 cm^-1)88 - depolarization (:math:`log(P/P_0)/(lambda^2 * thickness)`, in Angstrom :sup:`-1` cm :sup:`-1`\ ) 89 89 - depolarization error in the same unit) (measurement error) 90 90 - Spin echo length error (:math:`\Delta`\ z, in Angstroms) (experimental resolution) -
src/sas/sasgui/perspectives/calculator/image_viewer.py
r25b9707a rc1d5aea 42 42 """ 43 43 parent = self.parent 44 if parent ==None:44 if parent is None: 45 45 location = os.getcwd() 46 46 else: 47 47 location = parent._default_save_location 48 48 path_list = self.choose_data_file(location=location) 49 if path_list ==None:49 if path_list is None: 50 50 return 51 if len(path_list) >= 0 and not(path_list[0]is None):52 if parent !=None:51 if len(path_list) >= 0 and path_list[0] is not None: 52 if parent is not None: 53 53 parent._default_save_location = os.path.dirname(path_list[0]) 54 54 err_msg = '' -
src/sas/sasgui/perspectives/pr/explore_dialog.py
r463e7ffc rf3bf622 269 269 # Note: by design, the output type should always be part of the 270 270 # results object. 271 if self.results.outputs.has_key(output_type):271 if output_type in self.results.outputs: 272 272 self.plotpanel.plot.x = self.results.d_max 273 273 self.plotpanel.plot.y = self.results.outputs[output_type][2] -
src/sas/sasgui/perspectives/pr/inversion_panel.py
r463e7ffc rc1d5aea 940 940 Choose a new input file for I(q) 941 941 """ 942 if not self._manager isNone:942 if self._manager is not None: 943 943 self.plot_data.SetValue(str(data.name)) 944 944 try: -
src/sas/sasgui/perspectives/pr/pr.py
r463e7ffc rc1d5aea 329 329 330 330 # If we have a group ID, use it 331 if pr.info.has_key("plot_group_id"):331 if 'plot_group_id' in pr.info: 332 332 new_plot.group_id = pr.info["plot_group_id"] 333 333 new_plot.id = IQ_FIT_LABEL … … 348 348 except: 349 349 err[i] = 1.0 350 print "Error getting error", value, x[i]350 print("Error getting error", value, x[i]) 351 351 352 352 new_plot = Data1D(x, y) … … 356 356 new_plot.yaxis("\\rm{Intensity} ", "cm^{-1}") 357 357 # If we have a group ID, use it 358 if pr.info.has_key("plot_group_id"):358 if 'plot_group_id' in pr.info: 359 359 new_plot.group_id = pr.info["plot_group_id"] 360 360 new_plot.id = IQ_SMEARED_LABEL … … 1047 1047 try: 1048 1048 pr = self._create_file_pr(data) 1049 if not pr isNone:1049 if pr is not None: 1050 1050 self.pr = pr 1051 1051 self.perform_estimate() -
src/sas/sasgui/plottools/LineModel.py
rdd5bf63 rec8886e 8 8 function should disappear in a future iteration (see notes in fitDialog) 9 9 10 -PDB July 10, 2016 10 PDB July 10, 2016 11 11 12 """ 12 13 … … 70 71 runXY is when the if statement is true. I however cannot see what that 71 72 function is for. It needs to be documented here or removed. 72 -PDB 7/10/1673 PDB 7/10/16 73 74 74 75 :param x: simple value … … 92 93 but the only difference between this and run is when the if 93 94 statement is true. I however cannot see what that function 94 is for. It needs to be documented here or removed. -PDB 7/10/1695 is for. It needs to be documented here or removed. PDB 7/10/16 95 96 96 97 :param x: simple value -
src/sas/sasgui/plottools/PlotPanel.py
r463e7ffc rc1d5aea 1403 1403 if self.scale == 'log_{10}': 1404 1404 self.scale = 'linear' 1405 if not self.zmin_2D isNone:1405 if self.zmin_2D is not None: 1406 1406 zmin_2D_temp = math.pow(10, self.zmin_2D) 1407 if not self.zmax_2D isNone:1407 if self.zmax_2D is not None: 1408 1408 zmax_2D_temp = math.pow(10, self.zmax_2D) 1409 1409 else: 1410 1410 self.scale = 'log_{10}' 1411 if not self.zmin_2D isNone:1411 if self.zmin_2D is not None: 1412 1412 # min log value: no log(negative) 1413 1413 if self.zmin_2D <= 0: … … 1415 1415 else: 1416 1416 zmin_2D_temp = math.log10(self.zmin_2D) 1417 if not self.zmax_2D isNone:1417 if self.zmax_2D is not None: 1418 1418 zmax_2D_temp = math.log10(self.zmax_2D) 1419 1419 -
test/sasdataloader/test/testplugings.py
rb699768 rf3bf622 32 32 output = self.L.load('test_data.test') 33 33 self.assertEqual(output.x[0], 1234.) 34 self.assertTrue( self.L.loaders.has_key('.test'))34 self.assertTrue('.test' in self.L.loaders) 35 35 36 36 class testZip(unittest.TestCase): … … 61 61 output = self.L.load('test_data.test') 62 62 self.assertEqual(output.x[0], 1234.) 63 self.assertTrue( self.L.loaders.has_key('.test'))63 self.assertTrue('.test' in self.L.loaders) 64 64 65 65
Note: See TracChangeset
for help on using the changeset viewer.