Changeset 6435594 in sasview for src/sas/sascalc
- Timestamp:
- Apr 6, 2017 10:03:53 PM (8 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 7b15990
- Parents:
- f3bf622
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/realspace/VolumeCanvas.py
rf3bf622 r6435594 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 a= self.params[toks[0]]412 value = self.params[toks[0]] 413 413 except KeyError: 414 414 raise ValueError("VolumeCanvas.getParam: Could not find" 415 415 " %s" % name) 416 417 value = self.params[toks[0]]418 416 if isinstance(value, ShapeDescriptor): 419 417 raise ValueError("VolumeCanvas.getParam: Cannot get parameter" … … 424 422 elif len(toks) == 2: 425 423 try: 426 a= self.shapes[toks[0]]424 shapeinstance = self.shapes[toks[0]] 427 425 except KeyError: 428 426 raise ValueError("VolumeCanvas.getParam: Could not find " 429 427 "%s" % name) 430 428 431 shapeinstance = self.shapes[toks[0]] 432 433 try: 434 a = shapeinstance.params[toks[1]] 435 except KeyError: 429 if not toks[1] in shapeinstance.params: 436 430 raise ValueError("VolumeCanvas.getParam: Could not find " 437 431 "%s" % name) … … 442 436 raise ValueError("VolumeCanvas.getParam: Could not find %s" % name) 443 437 444 def getParamList(self, shapeid =None):438 def getParamList(self, shapeid=None): 445 439 """ 446 440 return a full list of all available parameters from … … 455 449 param_list = [] 456 450 if shapeid is None: 457 for key1 in self.params .keys():451 for key1 in self.params: 458 452 #value1 = self.params[key1] 459 453 param_list.append(key1) 460 for key2 in self.shapes .keys():454 for key2 in self.shapes: 461 455 value2 = self.shapes[key2] 462 456 header = key2 + '.' 463 for key3 in value2.params .keys():457 for key3 in value2.params: 464 458 fullname = header + key3 465 459 param_list.append(fullname) 466 460 467 461 else: 468 try: 469 a = self.shapes[shapeid] 470 except KeyError: 462 if not shapeid in self.shapes: 471 463 raise ValueError("VolumeCanvas: getParamList: Could not find " 472 464 "%s" % shapeid) … … 487 479 @param shapeDesc: shape description 488 480 """ 489 # Create the object model481 # Create the object model 490 482 shapeDesc.create() 491 483 … … 602 594 # type we recognize 603 595 else: 604 raise ValueError , "run(q): bad type for q"596 raise ValueError("run(q): bad type for q") 605 597 606 598 def runXY(self, q = 0): … … 622 614 # type we recognize 623 615 else: 624 raise ValueError , "runXY(q): bad type for q"616 raise ValueError("runXY(q): bad type for q") 625 617 626 618 def _create_modelObject(self):
Note: See TracChangeset
for help on using the changeset viewer.