Changeset 235f514 in sasview for src/sas/sasgui/plottools
- Timestamp:
- Apr 9, 2017 5:46:10 AM (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:
- ac07a3a
- Parents:
- 5b2b04d
- Location:
- src/sas/sasgui/plottools
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/plottools/PlotPanel.py
r959eb01 r235f514 418 418 """ 419 419 ax = event.inaxes 420 if ax ==None:420 if ax is None: 421 421 return 422 422 # Event occurred inside a plotting area … … 479 479 self.xFinal, self.yFinal = event.xdata, event.ydata 480 480 # Check whether this is the first point 481 if self.xInit ==None:481 if self.xInit is None: 482 482 self.xInit = self.xFinal 483 483 self.yInit = self.yFinal … … 1367 1367 if dy != None and type(dy) == type(()): 1368 1368 dy = nx.vstack((y - dy[0], dy[1] - y)).transpose() 1369 if dx == None and dy ==None:1369 if dx is None and dy is None: 1370 1370 self.subplot.plot(x, y, color=self._color(color), 1371 1371 marker=self._symbol(symbol), … … 1443 1443 c = self._color(color) 1444 1444 # If we don't have any data, skip. 1445 if self.data ==None:1445 if self.data is None: 1446 1446 return 1447 1447 if self.data.ndim == 1: … … 1519 1519 self.subplot.set_axis_off() 1520 1520 1521 if cbax ==None:1521 if cbax is None: 1522 1522 ax.set_frame_on(False) 1523 1523 cb = self.subplot.figure.colorbar(im, shrink=0.8, aspect=20) … … 1541 1541 """ 1542 1542 # No qx or qy given in a vector format 1543 if self.qx_data == None or self.qy_data ==None \1543 if self.qx_data is None or self.qy_data is None \ 1544 1544 or self.qx_data.ndim != 1 or self.qy_data.ndim != 1: 1545 1545 # do we need deepcopy here? … … 1601 1601 """ 1602 1602 # No qx or qy given in a vector format 1603 if self.qx_data == None or self.qy_data ==None \1603 if self.qx_data is None or self.qy_data is None \ 1604 1604 or self.qx_data.ndim != 1 or self.qy_data.ndim != 1: 1605 1605 # do we need deepcopy here? … … 1652 1652 """ 1653 1653 # No image matrix given 1654 if image ==None or np.ndim(image) != 2 \1654 if image is None or np.ndim(image) != 2 \ 1655 1655 or np.isfinite(image).all() \ 1656 or weights ==None:1656 or weights is None: 1657 1657 return image 1658 1658 # Get bin size in y and x directions … … 1940 1940 """ 1941 1941 """ 1942 if self.parent ==None:1942 if self.parent is None: 1943 1943 return 1944 1944 # get current caption -
src/sas/sasgui/plottools/fitDialog.py
r959eb01 r235f514 95 95 96 96 # Set default value of parameter in the dialog panel 97 if self.Avalue ==None:97 if self.Avalue is None: 98 98 self.tcA.SetValue(format_number(self.default_A)) 99 99 else: 100 100 self.tcA.SetLabel(format_number(self.Avalue)) 101 if self.Bvalue ==None:101 if self.Bvalue is None: 102 102 self.tcB.SetValue(format_number(self.default_B)) 103 103 else: 104 104 self.tcB.SetLabel(format_number(self.Bvalue)) 105 if self.ErrAvalue ==None:105 if self.ErrAvalue is None: 106 106 self.tcErrA.SetLabel(format_number(0.0)) 107 107 else: 108 108 self.tcErrA.SetLabel(format_number(self.ErrAvalue)) 109 if self.ErrBvalue ==None:109 if self.ErrBvalue is None: 110 110 self.tcErrB.SetLabel(format_number(0.0)) 111 111 else: 112 112 self.tcErrB.SetLabel(format_number(self.ErrBvalue)) 113 if self.Chivalue ==None:113 if self.Chivalue is None: 114 114 self.tcChi.SetLabel(format_number(0.0)) 115 115 else: … … 502 502 503 503 # Check that cov and out are iterable before displaying them 504 if cov ==None:504 if cov is None: 505 505 errA = 0.0 506 506 errB = 0.0 … … 508 508 errA = math.sqrt(cov[0][0]) 509 509 errB = math.sqrt(cov[1][1]) 510 if out ==None:510 if out is None: 511 511 cstA = 0.0 512 512 cstB = 0.0 -
src/sas/sasgui/plottools/fittings.py
r959eb01 r235f514 25 25 self.model = model 26 26 self.name = name 27 if not value ==None:27 if not value is None: 28 28 self.model.setParam(self.name, value) 29 29 -
src/sas/sasgui/plottools/plottable_interactor.py
r959eb01 r235f514 50 50 l_width = markersize * 0.4 51 51 return self.step(x=x, y=y, color=color, label=label, width=l_width) 52 if not self.marker ==None:52 if not self.marker is None: 53 53 self.base.connect.clear([self.marker]) 54 54 self.color = self._color(color) … … 61 61 dy = nx.vstack((y - dy[0], dy[1] - y)).transpose() 62 62 63 if dx == None and dy ==None:63 if dx is None and dy is None: 64 64 # zorder = 1 65 65 self.marker = self.axes.plot(x, y, color=self.color, … … 100 100 """ 101 101 """ 102 if not self.marker ==None:102 if not self.marker is None: 103 103 self.base.connect.clear([self.marker]) 104 104 self.color = self._color(color) … … 115 115 """ 116 116 """ 117 if not self.marker ==None:117 if not self.marker is None: 118 118 self.base.connect.clear([self.marker]) 119 119 self.color = self._color(color) … … 133 133 """ 134 134 """ 135 if not self.marker ==None:135 if not self.marker is None: 136 136 self.base.connect.clear([self.marker]) 137 137 self.color = self._color(color) -
src/sas/sasgui/plottools/plottables.py
r9c0f3c17 r235f514 229 229 if p.hidden == True: 230 230 continue 231 if not p.x ==None:231 if not p.x is None: 232 232 for x_i in p.x: 233 if min_value ==None or x_i < min_value:233 if min_value is None or x_i < min_value: 234 234 min_value = x_i 235 if max_value ==None or x_i > max_value:235 if max_value is None or x_i > max_value: 236 236 max_value = x_i 237 237 return min_value, max_value … … 562 562 Returns True if there is no data stored in the plottable 563 563 """ 564 if not self.x ==None and len(self.x) == 0 \565 and not self.y ==None and len(self.y) == 0:564 if not self.x is None and len(self.x) == 0 \ 565 and not self.y is None and len(self.y) == 0: 566 566 return True 567 567 return False … … 679 679 # Sanity check 680 680 # Do the transofrmation only when x and y are empty 681 has_err_x = not (dx ==None or len(dx) == 0)682 has_err_y = not (dy ==None or len(dy) == 0)681 has_err_x = not (dx is None or len(dx) == 0) 682 has_err_y = not (dy is None or len(dy) == 0) 683 683 684 684 if(x != None) and (y != None): 685 if not dx ==None and not len(dx) == 0 and not len(x) == len(dx):685 if not dx is None and not len(dx) == 0 and not len(x) == len(dx): 686 686 msg = "Plottable.View: Given x and dx are not" 687 687 msg += " of the same length" … … 693 693 raise ValueError, msg 694 694 695 if not dy ==None and not len(dy) == 0 and not len(y) == len(dy):695 if not dy is 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)) … … 797 797 tempy = [] 798 798 tempdy = [] 799 if self.dx ==None:799 if self.dx is None: 800 800 self.dx = np.zeros(len(self.x)) 801 if self.dy ==None:801 if self.dy is None: 802 802 self.dy = np.zeros(len(self.y)) 803 803 if self.xLabel == "log10(x)": … … 827 827 tempy = [] 828 828 tempdy = [] 829 if self.dx ==None:829 if self.dx is None: 830 830 self.dx = np.zeros(len(self.x)) 831 if self.dy ==None:831 if self.dy is None: 832 832 self.dy = np.zeros(len(self.y)) 833 833 if self.yLabel == "log10(y)": … … 860 860 tempy = [] 861 861 tempdy = [] 862 if self.dx ==None:862 if self.dx is None: 863 863 self.dx = np.zeros(len(self.x)) 864 if self.dy ==None:864 if self.dy is None: 865 865 self.dy = np.zeros(len(self.y)) 866 866 if xmin != None and xmax != None: … … 1206 1206 """ 1207 1207 """ 1208 if self._chisq ==None:1208 if self._chisq is None: 1209 1209 chisqTxt = r'$\chi^2=$' 1210 1210 else: -
src/sas/sasgui/plottools/transform.py
r959eb01 r235f514 162 162 163 163 """ 164 if dx ==None:164 if dx is None: 165 165 dx = 0 166 166 return dx … … 175 175 176 176 """ 177 if dx ==None:177 if dx is None: 178 178 dx = 0 179 179 return dx … … 256 256 257 257 """ 258 if dx ==None:258 if dx is None: 259 259 dx = 0 260 260 … … 280 280 281 281 """ 282 if dx ==None:282 if dx is None: 283 283 dx = 0 284 284 … … 294 294 """ 295 295 """ 296 if dx ==None:297 dx = 0 298 if dy ==None:296 if dx is None: 297 dx = 0 298 if dy is None: 299 299 dy = 0 300 300 err = math.sqrt((2 * x * y * dx) ** 2 + ((x ** 2) * dy) ** 2) … … 314 314 raise ValueError, msg 315 315 if x != 0 and y != 0: 316 if dx ==None:316 if dx is None: 317 317 dx = 0 318 if dy ==None:318 if dy is None: 319 319 dy = 0 320 320 err = (dx / x) ** 2 + (dy / y) ** 2 … … 337 337 raise ValueError, msg 338 338 if x > 0 and y > 0: 339 if dx ==None:339 if dx is None: 340 340 dx = 0 341 if dy ==None:341 if dy is None: 342 342 dy = 0 343 343 err = (2.0 * dx / x) ** 2 + (dy / y) ** 2 … … 353 353 """ 354 354 if x != 0: 355 if dx ==None:355 if dx is None: 356 356 dx = 0 357 357 err = dx / x ** 2 … … 367 367 """ 368 368 if x > 0: 369 if dx ==None:369 if dx is None: 370 370 dx = 0 371 371 err = -1 / 2 * math.pow(x, -3.0 / 2.0) * dx … … 388 388 msg += " that are consistent with zero." 389 389 raise ValueError, msg 390 if dx ==None:391 dx = 0 392 if dy ==None:390 if dx is None: 391 dx = 0 392 if dy is None: 393 393 dy = 0 394 394 err = math.sqrt((4.0 * dx / x) ** 2 + (dy / y) ** 2) … … 406 406 # within errors 407 407 408 if dx ==None:409 dx = 0 410 if dy ==None:408 if dx is None: 409 dx = 0 410 if dy is None: 411 411 dy = 0 412 412 err = math.sqrt((dy * pow(x, 4)) ** 2 + (4 * y * dx * math.pow(x, 3)) ** 2)
Note: See TracChangeset
for help on using the changeset viewer.