Changeset b9d74f3 in sasview for src/sas/sasgui
- 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)
- Location:
- src/sas/sasgui
- Files:
-
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/guiframe/data_processor.py
r7432acb rb9d74f3 907 907 msg = "Edit axis doesn't understand this selection.\n" 908 908 msg += "Please select only one column" 909 raise ValueError , msg909 raise ValueError(msg) 910 910 for (_, cell_col) in grid.selected_cells: 911 911 if cell_col != col: … … 913 913 msg += "this operation.\n" 914 914 msg += "Please select elements of the same col.\n" 915 raise ValueError , msg915 raise ValueError(msg) 916 916 917 917 # Finally check the highlighted cell if any cells missing … … 920 920 msg = "No item selected.\n" 921 921 msg += "Please select only one column or one cell" 922 raise ValueError , msg922 raise ValueError(msg) 923 923 return grid.selected_cells 924 924 … … 1324 1324 if sentence.strip() == "": 1325 1325 msg = "Select column values for x axis" 1326 raise ValueError , msg1326 raise ValueError(msg) 1327 1327 except: 1328 1328 msg = "X axis value error." … … 1343 1343 if sentence.strip() == "": 1344 1344 msg = "select value for y axis" 1345 raise ValueError , msg1345 raise ValueError(msg) 1346 1346 except: 1347 1347 msg = "Y axis value error." -
src/sas/sasgui/guiframe/gui_manager.py
r2f22db9 rb9d74f3 2613 2613 wx.PostEvent(self, StatusEvent(status=msg, 2614 2614 info="error")) 2615 raise ValueError , msg2615 raise ValueError(msg) 2616 2616 # text = str(data) 2617 2617 text = data.__str__() -
src/sas/sasgui/guiframe/local_perspectives/plotting/SectorSlicer.py
r7432acb rb9d74f3 235 235 msg = "Phi left and phi right are different" 236 236 msg += " %f, %f" % (self.left_line.phi, self.right_line.phi) 237 raise ValueError , msg237 raise ValueError(msg) 238 238 params["Phi [deg]"] = self.main_line.theta * 180 / math.pi 239 239 params["Delta_Phi [deg]"] = math.fabs(self.left_line.phi * 180 / math.pi) -
src/sas/sasgui/guiframe/local_perspectives/plotting/binder.py
r463e7ffc rb9d74f3 187 187 # Check that the trigger is valid 188 188 if trigger not in self._actions: 189 raise ValueError ,"%s invalid --- valid triggers are %s" \190 % (trigger, ", ".join(self.events)) 189 raise ValueError("%s invalid --- valid triggers are %s" \ 190 % (trigger, ", ".join(self.events))) 191 191 # Register the trigger callback 192 192 self._actions[trigger][artist] = action … … 203 203 """ 204 204 if action not in self.events: 205 raise ValueError , "Trigger expects " + ", ".join(self.events)205 raise ValueError("Trigger expects " + ", ".join(self.events)) 206 206 # Tag the event with modifiers 207 207 for mod in ('alt', 'control', 'shift', 'meta'): -
src/sas/sasgui/guiframe/local_perspectives/plotting/boxSlicer.py
r7432acb rb9d74f3 152 152 if new_slab is None: 153 153 msg = "post data:cannot average , averager is empty" 154 raise ValueError , msg154 raise ValueError(msg) 155 155 self.averager = new_slab 156 156 if self.direction == "X": … … 168 168 else: 169 169 msg = "post data:no Box Average direction was supplied" 170 raise ValueError , msg170 raise ValueError(msg) 171 171 # # Average data2D given Qx or Qy 172 172 box = self.averager(x_min=x_min, x_max=x_max, y_min=y_min, y_max=y_max, -
src/sas/sasgui/guiframe/local_perspectives/plotting/plotting.py
r235f514 rb9d74f3 199 199 200 200 msg = "1D Panel of group ID %s could not be created" % str(group_id) 201 raise ValueError , msg201 raise ValueError(msg) 202 202 203 203 def create_2d_panel(self, data, group_id): … … 217 217 return new_panel 218 218 msg = "2D Panel of group ID %s could not be created" % str(group_id) 219 raise ValueError , msg219 raise ValueError(msg) 220 220 221 221 def update_panel(self, data, panel): … … 237 237 msg += " to panel %s\n" % str(panel.window_caption) 238 238 msg += "Please edit %s's units, labels" % str(data.name) 239 raise ValueError , msg239 raise ValueError(msg) 240 240 else: 241 241 if panel.group_id not in data.list_group_id: -
src/sas/sasgui/guiframe/local_perspectives/plotting/sector_mask.py
r7432acb rb9d74f3 175 175 msg += "different %f, %f" % (self.left_line.phi, 176 176 self.right_line.phi) 177 raise ValueError , msg177 raise ValueError(msg) 178 178 params["Phi"] = self.main_line.theta 179 179 params["Delta_Phi"] = math.fabs(self.left_line.phi) -
src/sas/sasgui/guiframe/plugin_base.py
r7432acb rb9d74f3 277 277 """ 278 278 msg = "%s plugin: does not support import theory" % str(self.sub_menu) 279 raise ValueError , msg279 raise ValueError(msg) 280 280 281 281 def on_set_state_helper(self, event): -
src/sas/sasgui/perspectives/calculator/resolution_calculator_panel.py
r7432acb rb9d74f3 1082 1082 msg = "The numbers must be one or two (separated by ',')..." 1083 1083 self._status_info(msg, 'stop') 1084 raise RuntimeError , msg1084 raise RuntimeError(msg) 1085 1085 1086 1086 return new_string -
src/sas/sasgui/perspectives/calculator/slit_length_calculator_panel.py
r7432acb rb9d74f3 262 262 if x == [] or x is None or y == [] or y is None: 263 263 msg = "The current data is empty please check x and y" 264 raise ValueError , msg264 raise ValueError(msg) 265 265 slit_length_calculator = SlitlengthCalculator() 266 266 slit_length_calculator.set_data(x=x, y=y) -
src/sas/sasgui/perspectives/corfunc/corfunc_state.py
r7432acb rb9d74f3 284 284 root, ext = os.path.splitext(basename) 285 285 if not ext.lower() in self.ext: 286 raise IOError , "{} is not a supported file type".format(ext)286 raise IOError("{} is not a supported file type".format(ext)) 287 287 tree = etree.parse(path, parser=etree.ETCompatXMLParser()) 288 288 root = tree.getroot() … … 300 300 # File not found 301 301 msg = "{} is not a valid file path or doesn't exist".format(path) 302 raise IOError , msg302 raise IOError(msg) 303 303 304 304 if len(output) == 0: … … 324 324 msg = ("The CanSAS writer expects a Data1D instance. {} was " 325 325 "provided").format(datainfo.__class__.__name__) 326 raise RuntimeError , msg326 raise RuntimeError(msg) 327 327 if datainfo.title is None or datainfo.title == '': 328 328 datainfo.title = datainfo.name -
src/sas/sasgui/perspectives/fitting/fit_thread.py
r959eb01 rb9d74f3 54 54 except KeyboardInterrupt: 55 55 msg = "Fitting: terminated by the user." 56 raise KeyboardInterrupt , msg56 raise KeyboardInterrupt(msg) 57 57 58 58 def compute(self): -
src/sas/sasgui/perspectives/fitting/fitpage.py
red2276f rb9d74f3 1847 1847 wx.PostEvent(self._manager.parent, StatusEvent(status=msg, 1848 1848 info="error")) 1849 raise ValueError , msg1849 raise ValueError(msg) 1850 1850 1851 1851 else: … … 1859 1859 wx.PostEvent(self._manager.parent, StatusEvent(status=msg, 1860 1860 info="error")) 1861 raise ValueError , msg1861 raise ValueError(msg) 1862 1862 # Maximum value of data 1863 1863 qmax = math.sqrt(x * x + y * y) … … 2098 2098 self._on_fit_complete() 2099 2099 if out is None or not np.isfinite(chisqr): 2100 raise ValueError , "Fit error occured..."2100 raise ValueError("Fit error occured...") 2101 2101 2102 2102 is_modified = False … … 2173 2173 i += 1 2174 2174 else: 2175 raise ValueError , "onsetValues: Invalid parameters..."2175 raise ValueError("onsetValues: Invalid parameters...") 2176 2176 # Show error title when any errors displayed 2177 2177 if has_error: -
src/sas/sasgui/perspectives/fitting/fitpanel.py
r67b0a99 rb9d74f3 125 125 if uid not in self.opened_pages: 126 126 msg = "Fitpanel cannot find ID: %s in self.opened_pages" % str(uid) 127 raise ValueError , msg127 raise ValueError(msg) 128 128 else: 129 129 return self.opened_pages[uid] … … 389 389 """ 390 390 if data.__class__.__name__ != "list": 391 raise ValueError , "Fitpanel delete_data expect list of id"391 raise ValueError("Fitpanel delete_data expect list of id") 392 392 else: 393 393 for page in self.opened_pages.values(): -
src/sas/sasgui/perspectives/fitting/fitting.py
r7432acb rb9d74f3 1232 1232 panel = self.plot_panel 1233 1233 if panel is None: 1234 raise ValueError , "Fitting:_onSelect: NonType panel"1234 raise ValueError("Fitting:_onSelect: NonType panel") 1235 1235 Plugin.on_perspective(self, event=event) 1236 1236 self.select_data(panel) -
src/sas/sasgui/perspectives/fitting/model_thread.py
r7432acb rb9d74f3 65 65 if self.data is None: 66 66 msg = "Compute Calc2D receive data = %s.\n" % str(self.data) 67 raise ValueError , msg67 raise ValueError(msg) 68 68 69 69 # Define matrix where data will be plotted -
src/sas/sasgui/perspectives/fitting/models.py
r463e7ffc rb9d74f3 142 142 if type is not None and issubclass(type, py_compile.PyCompileError): 143 143 print "Problem with", repr(value) 144 raise type , value, tb144 raise type(value).with_traceback(tb) 145 145 return 1 146 146 -
src/sas/sasgui/perspectives/fitting/pagestate.py
r959eb01 rb9d74f3 1014 1014 msg = "PageState no longer supports non-CanSAS" 1015 1015 msg += " format for fitting files" 1016 raise RuntimeError , msg1016 raise RuntimeError(msg) 1017 1017 1018 1018 if node.get('version'): … … 1310 1310 else: 1311 1311 self.call_back(format=ext) 1312 raise RuntimeError , "%s is not a file" % path1312 raise RuntimeError("%s is not a file" % path) 1313 1313 1314 1314 # Return output consistent with the loader's api -
src/sas/sasgui/perspectives/invariant/invariant.py
r7432acb rb9d74f3 133 133 name = data.__class__.__name__ 134 134 msg = "Invariant use only Data1D got: [%s] " % str(name) 135 raise ValueError , msg135 raise ValueError(msg) 136 136 self.compute_helper(data=data) 137 137 … … 240 240 msg = "invariant.save_file: the data being saved is" 241 241 msg += " not a sas.sascalc.dataloader.data_info.Data1D object" 242 raise RuntimeError , msg242 raise RuntimeError(msg) 243 243 244 244 def set_state(self, state=None, datainfo=None): … … 258 258 msg = "invariant.set_state: datainfo parameter cannot" 259 259 msg += " be None in standalone mode" 260 raise RuntimeError , msg260 raise RuntimeError(msg) 261 261 # Make sure the user sees the invariant panel after loading 262 262 # self.parent.set_perspective(self.perspective) … … 320 320 else: 321 321 msg = "Scale can not be zero." 322 raise ValueError , msg322 raise ValueError(msg) 323 323 if len(new_plot.x) == 0: 324 324 return -
src/sas/sasgui/perspectives/invariant/invariant_panel.py
r7432acb rb9d74f3 318 318 background = self.background_tcl.GetValue().lstrip().rstrip() 319 319 if background == "": 320 raise ValueError , "Need a background"320 raise ValueError("Need a background") 321 321 if check_float(self.background_tcl): 322 322 return float(background) 323 323 else: 324 324 msg = "Receive invalid value for background : %s" % (background) 325 raise ValueError , msg325 raise ValueError(msg) 326 326 327 327 def get_scale(self): … … 331 331 scale = self.scale_tcl.GetValue().lstrip().rstrip() 332 332 if scale == "": 333 raise ValueError , "Need a background"333 raise ValueError("Need a background") 334 334 if check_float(self.scale_tcl): 335 335 if float(scale) <= 0.0: … … 337 337 self.scale_tcl.Refresh() 338 338 msg = "Receive invalid value for scale: %s" % (scale) 339 raise ValueError , msg339 raise ValueError(msg) 340 340 return float(scale) 341 341 else: 342 raise ValueError , "Receive invalid value for scale : %s" % (scale)342 raise ValueError("Receive invalid value for scale : %s" % (scale)) 343 343 344 344 def get_contrast(self): … … 865 865 except: 866 866 logger.error(sys.exc_value) 867 raise ValueError , "No such bookmark exists"867 raise ValueError("No such bookmark exists") 868 868 869 869 # set the parameters -
src/sas/sasgui/perspectives/invariant/invariant_state.py
r7432acb rb9d74f3 365 365 msg = "InvariantSate no longer supports non-CanSAS" 366 366 msg += " format for invariant files" 367 raise RuntimeError , msg367 raise RuntimeError(msg) 368 368 369 369 if node.get('version')\ … … 739 739 output.append(sas_entry) 740 740 else: 741 raise RuntimeError , "%s is not a file" % path741 raise RuntimeError("%s is not a file" % path) 742 742 743 743 # Return output consistent with the loader's api … … 785 785 msg = "The cansas writer expects a Data1D" 786 786 msg += " instance: %s" % str(datainfo.__class__.__name__) 787 raise RuntimeError , msg787 raise RuntimeError(msg) 788 788 # make sure title and data run is filled up. 789 789 if datainfo.title is None or datainfo.title == '': -
src/sas/sasgui/perspectives/pr/inversion_panel.py
r7432acb rb9d74f3 854 854 message += "than the number of points" 855 855 wx.PostEvent(self._manager.parent, StatusEvent(status=message)) 856 raise ValueError , message856 raise ValueError(message) 857 857 self.nfunc_ctl.SetBackgroundColour(wx.WHITE) 858 858 self.nfunc_ctl.Refresh() -
src/sas/sasgui/perspectives/pr/inversion_state.py
r7432acb rb9d74f3 235 235 msg = "InversionState no longer supports non-CanSAS" 236 236 msg += " format for P(r) files" 237 raise RuntimeError , msg237 raise RuntimeError(msg) 238 238 239 239 if node.get('version') and node.get('version') == '1.0': … … 478 478 output.append(sas_entry) 479 479 else: 480 raise RuntimeError , "%s is not a file" % path480 raise RuntimeError("%s is not a file" % path) 481 481 482 482 # Return output consistent with the loader's api … … 522 522 msg = "The cansas writer expects a Data1D " 523 523 msg += "instance: %s" % str(datainfo.__class__.__name__) 524 raise RuntimeError , msg524 raise RuntimeError(msg) 525 525 526 526 # Create basic XML document -
src/sas/sasgui/perspectives/pr/pr.py
r7432acb rb9d74f3 149 149 msg = "Pr.set_state: datainfo parameter cannot " 150 150 msg += "be None in standalone mode" 151 raise RuntimeError , msg151 raise RuntimeError(msg) 152 152 153 153 # Ensuring that plots are coordinated correctly … … 450 450 # Notify the user if we could not read the file 451 451 if dataread is None: 452 raise RuntimeError , "Invalid data"452 raise RuntimeError("Invalid data") 453 453 454 454 x = None … … 470 470 if dataread is None: 471 471 return x, y, err 472 raise RuntimeError , "This tool can only read 1D data"472 raise RuntimeError("This tool can only read 1D data") 473 473 474 474 self._current_file_data.x = x … … 849 849 status = "Problem reading data: %s" % sys.exc_value 850 850 wx.PostEvent(self.parent, StatusEvent(status=status)) 851 raise RuntimeError , status851 raise RuntimeError(status) 852 852 853 853 # If the file contains nothing, just return 854 854 if pr is None: 855 raise RuntimeError , "Loaded data is invalid"855 raise RuntimeError("Loaded data is invalid") 856 856 857 857 self.pr = pr … … 903 903 msg = "pr.save_data: the data being saved is not a" 904 904 msg += " sas.data_info.Data1D object" 905 raise RuntimeError , msg905 raise RuntimeError(msg) 906 906 907 907 def setup_plot_inversion(self, alpha, nfunc, d_max, q_min=None, q_max=None, -
src/sas/sasgui/perspectives/simulation/ShapeAdapter.py
r959eb01 rb9d74f3 87 87 self.sim_canvas._model_changed() 88 88 else: 89 raise ValueError , "SimShapeVisitor: Wrong class for visited object"89 raise ValueError("SimShapeVisitor: Wrong class for visited object") 90 90 91 91 … … 115 115 self.sim_canvas._model_changed() 116 116 else: 117 raise ValueError , "SimShapeVisitor: Wrong class for visited object"117 raise ValueError("SimShapeVisitor: Wrong class for visited object") 118 118 119 119 … … 130 130 shape.accept_update(self) 131 131 else: 132 raise ValueError , "ShapeAdapter: Shape [%s] not in list" % shape.name132 raise ValueError("ShapeAdapter: Shape [%s] not in list" % shape.name) 133 133 -
src/sas/sasgui/plottools/LineModel.py
r959eb01 rb9d74f3 82 82 elif x.__class__.__name__ == 'tuple': 83 83 msg = "Tuples are not allowed as input to BaseComponent models" 84 raise ValueError , msg84 raise ValueError(msg) 85 85 else: 86 86 return self._line(x) … … 104 104 elif x.__class__.__name__ == 'tuple': 105 105 msg = "Tuples are not allowed as input to BaseComponent models" 106 raise ValueError , msg106 raise ValueError(msg) 107 107 else: 108 108 return self._line(x) -
src/sas/sasgui/plottools/binder.py
r463e7ffc rb9d74f3 187 187 # Check that the trigger is valid 188 188 if trigger not in self._actions: 189 raise ValueError ,"%s invalid --- valid triggers are %s"\190 % (trigger, ", ".join(self.events)) 189 raise ValueError("%s invalid --- valid triggers are %s"\ 190 % (trigger, ", ".join(self.events))) 191 191 192 192 # Register the trigger callback … … 203 203 """ 204 204 if action not in self.events: 205 raise ValueError , "Trigger expects " + ", ".join(self.events)205 raise ValueError("Trigger expects " + ", ".join(self.events)) 206 206 207 207 # Tag the event with modifiers -
src/sas/sasgui/plottools/convert_units.py
r959eb01 rb9d74f3 42 42 unit = toks[0] + "^{" + str(powerer) + "}" 43 43 else: 44 raise ValueError , "missing } in unit expression"44 raise ValueError("missing } in unit expression") 45 45 else: # no powerer 46 46 if power != 1: 47 47 unit = "(" + unit + ")" + "^{" + str(power) + "}" 48 48 else: 49 raise ValueError , "empty unit ,enter a powerer different from zero"49 raise ValueError("empty unit ,enter a powerer different from zero") 50 50 return unit 51 51 -
src/sas/sasgui/plottools/fitDialog.py
r7432acb rb9d74f3 671 671 return x 672 672 else: 673 raise ValueError , "cannot compute log of a negative number"673 raise ValueError("cannot compute log of a negative number") 674 674 675 675 def floatInvTransform(self, x): … … 734 734 except: 735 735 msg = "LinearFit.set_fit_region: fit range must be floats" 736 raise ValueError , msg736 raise ValueError(msg) 737 737 self.xminFit.SetValue(format_number(xmin)) 738 738 self.xmaxFit.SetValue(format_number(xmax)) -
src/sas/sasgui/plottools/plottables.py
r45dffa69 rb9d74f3 386 386 387 387 """ 388 raise NotImplemented , "Not a valid transform"388 raise NotImplemented("Not a valid transform") 389 389 390 390 # Related issues … … 686 686 msg = "Plottable.View: Given x and dx are not" 687 687 msg += " of the same length" 688 raise ValueError , msg688 raise ValueError(msg) 689 689 # Check length of y array 690 690 if not len(y) == len(x): 691 691 msg = "Plottable.View: Given y " 692 692 msg += "and x are not of the same length" 693 raise ValueError , msg693 raise ValueError(msg) 694 694 695 695 if dy is not None and not len(dy) == 0 and not len(y) == len(dy): 696 696 msg = "Plottable.View: Given y and dy are not of the same " 697 697 msg += "length: len(y)=%s, len(dy)=%s" % (len(y), len(dy)) 698 raise ValueError , msg698 raise ValueError(msg) 699 699 self.x = [] 700 700 self.y = [] … … 731 731 msg = "Plottable.View: transformed x " 732 732 msg += "and y are not of the same length" 733 raise ValueError , msg733 raise ValueError(msg) 734 734 if has_err_x and not (len(self.x) == len(self.dx)): 735 735 msg = "Plottable.View: transformed x and dx" 736 736 msg += " are not of the same length" 737 raise ValueError , msg737 raise ValueError(msg) 738 738 if has_err_y and not (len(self.y) == len(self.dy)): 739 739 msg = "Plottable.View: transformed y" 740 740 msg += " and dy are not of the same length" 741 raise ValueError , msg741 raise ValueError(msg) 742 742 # Check that negative values are not plot on x and y axis for 743 743 # log10 transformation … … 1105 1105 Plottable.__init__(self) 1106 1106 msg = "Theory1D is no longer supported, please use Data1D and change symbol.\n" 1107 raise DeprecationWarning , msg1107 raise DeprecationWarning(msg) 1108 1108 1109 1109 class Fit1D(Plottable): -
src/sas/sasgui/plottools/transform.py
r7432acb rb9d74f3 24 24 """ 25 25 if not x > 0: 26 raise ValueError , "Transformation only accepts positive values."26 raise ValueError("Transformation only accepts positive values.") 27 27 else: 28 28 return x … … 50 50 """ 51 51 if not x >= 0: 52 raise ValueError , "square root of a negative value "52 raise ValueError("square root of a negative value ") 53 53 else: 54 54 return math.sqrt(x) … … 76 76 """ 77 77 if not x >= 0: 78 raise ValueError , "double square root of a negative value "78 raise ValueError("double square root of a negative value ") 79 79 else: 80 80 return math.sqrt(math.sqrt(x)) … … 90 90 """ 91 91 if not x > 0: 92 raise ValueError , "Log(x)of a negative value "92 raise ValueError("Log(x)of a negative value ") 93 93 else: 94 94 return math.log(x) … … 100 100 return 1 / x 101 101 else: 102 raise ValueError , "cannot divide by zero"102 raise ValueError("cannot divide by zero") 103 103 104 104 … … 109 109 return 1 / math.sqrt(y) 110 110 else: 111 raise ValueError , "transform.toOneOverSqrtX: cannot be computed"111 raise ValueError("transform.toOneOverSqrtX: cannot be computed") 112 112 113 113 … … 118 118 return math.log(y * (x ** 2)) 119 119 else: 120 raise ValueError , "transform.toLogYX2: cannot be computed"120 raise ValueError("transform.toLogYX2: cannot be computed") 121 121 122 122 … … 127 127 return math.log(math.pow(x, 4) * y) 128 128 else: 129 raise ValueError , "transform.toLogYX4: input error"129 raise ValueError("transform.toLogYX4: input error") 130 130 131 131 … … 149 149 """ 150 150 if not (x * y) > 0: 151 raise ValueError , "Log(X*Y)of a negative value "151 raise ValueError("Log(X*Y)of a negative value ") 152 152 else: 153 153 return math.log(x * y) … … 211 211 else: 212 212 msg = "transform.errFromX2: can't compute error of negative x" 213 raise ValueError , msg213 raise ValueError(msg) 214 214 215 215 … … 245 245 else: 246 246 msg = "transform.errFromX4: can't compute error of negative x" 247 raise ValueError , msg247 raise ValueError(msg) 248 248 249 249 … … 264 264 msg = "Transformation does not accept" 265 265 msg += " point that are consistent with zero." 266 raise ValueError , msg266 raise ValueError(msg) 267 267 if x != 0: 268 268 dx = dx / (x * math.log(10)) 269 269 else: 270 raise ValueError , "errToLogX: divide by zero"270 raise ValueError("errToLogX: divide by zero") 271 271 return dx 272 272 … … 287 287 dx = dx / x 288 288 else: 289 raise ValueError , "errToLogX: divide by zero"289 raise ValueError("errToLogX: divide by zero") 290 290 return dx 291 291 … … 312 312 msg = "Transformation does not accept point " 313 313 msg += " that are consistent with zero." 314 raise ValueError , msg314 raise ValueError(msg) 315 315 if x != 0 and y != 0: 316 316 if dx is None: … … 320 320 err = (dx / x) ** 2 + (dy / y) ** 2 321 321 else: 322 raise ValueError , "cannot compute this error"322 raise ValueError("cannot compute this error") 323 323 324 324 return math.sqrt(math.fabs(err)) … … 335 335 msg = "Transformation does not accept point" 336 336 msg += " that are consistent with zero." 337 raise ValueError , msg337 raise ValueError(msg) 338 338 if x > 0 and y > 0: 339 339 if dx is None: … … 343 343 err = (2.0 * dx / x) ** 2 + (dy / y) ** 2 344 344 else: 345 raise ValueError , "cannot compute this error"345 raise ValueError("cannot compute this error") 346 346 return math.sqrt(math.fabs(err)) 347 347 … … 357 357 err = dx / x ** 2 358 358 else: 359 raise ValueError , "Cannot compute this error"359 raise ValueError("Cannot compute this error") 360 360 return math.fabs(err) 361 361 … … 371 371 err = -1 / 2 * math.pow(x, -3.0 / 2.0) * dx 372 372 else: 373 raise ValueError , "Cannot compute this error"373 raise ValueError("Cannot compute this error") 374 374 return math.fabs(err) 375 375 … … 387 387 msg = "Transformation does not accept point " 388 388 msg += " that are consistent with zero." 389 raise ValueError , msg389 raise ValueError(msg) 390 390 if dx is None: 391 391 dx = 0
Note: See TracChangeset
for help on using the changeset viewer.