Changeset 7432acb in sasview for src/sas/sasgui/plottools
- Timestamp:
- Apr 9, 2017 6:11:31 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:
- 45dffa69
- Parents:
- ac07a3a
- Location:
- src/sas/sasgui/plottools
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/plottools/PlotPanel.py
r235f514 r7432acb 154 154 self.selectedText = None 155 155 #User scale 156 if xtransform !=None:156 if xtransform is not None: 157 157 self.xLabel = xtransform 158 158 else: 159 159 self.xLabel = "log10(x)" 160 if ytransform !=None:160 if ytransform is not None: 161 161 self.yLabel = ytransform 162 162 else: … … 360 360 return 361 361 362 if ax !=None:362 if ax is not None: 363 363 self.xInit, self.yInit = event.xdata, event.ydata 364 364 try: … … 392 392 Set legend alpha 393 393 """ 394 if self.legend !=None:394 if self.legend is not None: 395 395 self.legend.legendPatch.set_alpha(alpha) 396 396 … … 461 461 # User has clicked on text and is dragging 462 462 ax = event.inaxes 463 if ax !=None:463 if ax is not None: 464 464 # Only move text if mouse is within axes 465 465 self.selectedText.set_position((event.xdata, event.ydata)) … … 476 476 if self.leftdown == True and self.mousemotion == True: 477 477 ax = event.inaxes 478 if ax !=None: # the dragging is perform inside the figure478 if ax is not None: # the dragging is perform inside the figure 479 479 self.xFinal, self.yFinal = event.xdata, event.ydata 480 480 # Check whether this is the first point … … 576 576 step = event.step 577 577 578 if ax !=None:578 if ax is not None: 579 579 # Event occurred inside a plotting area 580 580 lo, hi = ax.get_xlim() … … 935 935 # reset postion 936 936 self.position = None 937 if self.graph.selected_plottable !=None:937 if self.graph.selected_plottable is not None: 938 938 self.graph.selected_plottable = None 939 939 … … 959 959 prop=FontProperties(size=10), 960 960 loc=self.legendLoc) 961 if self.legend !=None:961 if self.legend is not None: 962 962 self.legend.set_picker(self.legend_picker) 963 963 self.legend.set_axes(self.subplot) … … 989 989 prop=FontProperties(size=10), 990 990 loc=self.legendLoc) 991 if self.legend !=None:991 if self.legend is not None: 992 992 self.legend.set_picker(self.legend_picker) 993 993 self.legend.set_axes(self.subplot) … … 1010 1010 pos_x = 0 1011 1011 pos_y = 0 1012 if self.position !=None:1012 if self.position is not None: 1013 1013 pos_x, pos_y = self.position 1014 1014 else: … … 1035 1035 self.subplot.figure.canvas.draw_idle() 1036 1036 except: 1037 if self.parent !=None:1037 if self.parent is not None: 1038 1038 msg = "Add Text: Error. Check your property values..." 1039 1039 wx.PostEvent(self.parent, StatusEvent(status=msg)) … … 1069 1069 self.xaxis_tick = xaxis_font 1070 1070 1071 if self.data !=None:1071 if self.data is not None: 1072 1072 # 2D 1073 1073 self.xaxis(self.xaxis_label, self.xaxis_unit, \ … … 1116 1116 self.yaxis_tick = yaxis_font 1117 1117 1118 if self.data !=None:1118 if self.data is not None: 1119 1119 # 2D 1120 1120 self.yaxis(self.yaxis_label, self.yaxis_unit, \ … … 1155 1155 label_temp = textdial.getText() 1156 1156 if label_temp.count("\%s" % "\\") > 0: 1157 if self.parent !=None:1157 if self.parent is not None: 1158 1158 msg = "Add Label: Error. Can not use double '\\' " 1159 1159 msg += "characters..." … … 1162 1162 label = label_temp 1163 1163 except: 1164 if self.parent !=None:1164 if self.parent is not None: 1165 1165 msg = "Add Label: Error. Check your property values..." 1166 1166 wx.PostEvent(self.parent, StatusEvent(status=msg)) … … 1180 1180 num_text = len(self.textList) 1181 1181 if num_text < 1: 1182 if self.parent !=None:1182 if self.parent is not None: 1183 1183 msg = "Remove Text: Nothing to remove. " 1184 1184 wx.PostEvent(self.parent, StatusEvent(status=msg)) … … 1190 1190 text_remove = txt.get_text() 1191 1191 txt.remove() 1192 if self.parent !=None:1192 if self.parent is not None: 1193 1193 msg = "Removed Text: '%s'. " % text_remove 1194 1194 wx.PostEvent(self.parent, StatusEvent(status=msg)) 1195 1195 except: 1196 if self.parent !=None:1196 if self.parent is not None: 1197 1197 msg = "Remove Text: Error occurred. " 1198 1198 wx.PostEvent(self.parent, StatusEvent(status=msg)) … … 1250 1250 prop=FontProperties(size=10), 1251 1251 loc=self.legendLoc) 1252 if self.legend !=None:1252 if self.legend is not None: 1253 1253 self.legend.set_picker(self.legend_picker) 1254 1254 self.legend.set_axes(self.subplot) … … 1279 1279 if font: 1280 1280 self.subplot.set_xlabel(label, fontproperties=font, color=color) 1281 if t_font !=None:1281 if t_font is not None: 1282 1282 for tick in self.subplot.xaxis.get_major_ticks(): 1283 1283 tick.label.set_fontproperties(t_font) … … 1300 1300 if font: 1301 1301 self.subplot.set_ylabel(label, fontproperties=font, color=color) 1302 if t_font !=None:1302 if t_font is not None: 1303 1303 for tick_label in self.subplot.get_yticklabels(): 1304 1304 tick_label.set_fontproperties(t_font) … … 1327 1327 from plottable_interactor import PointInteractor 1328 1328 p = PointInteractor(self, self.subplot, zorder=zorder, id=id) 1329 if p.markersize !=None:1329 if p.markersize is not None: 1330 1330 markersize = p.markersize 1331 1331 p.points(x, y, dx=dx, dy=dy, color=color, symbol=symbol, zorder=zorder, … … 1363 1363 1364 1364 # Convert tuple (lo,hi) to array [(x-lo),(hi-x)] 1365 if dx !=None and type(dx) == type(()):1365 if dx is not None and type(dx) == type(()): 1366 1366 dx = nx.vstack((x - dx[0], dx[1] - x)).transpose() 1367 if dy !=None and type(dy) == type(()):1367 if dy is not None and type(dy) == type(()): 1368 1368 dy = nx.vstack((y - dy[0], dy[1] - y)).transpose() 1369 1369 if dx is None and dy is None: … … 1772 1772 # control axis labels from the panel itself 1773 1773 yname, yunits = item.get_yaxis() 1774 if self.yaxis_label !=None:1774 if self.yaxis_label is not None: 1775 1775 yname = self.yaxis_label 1776 1776 yunits = self.yaxis_unit … … 1779 1779 self.yaxis_unit = yunits 1780 1780 xname, xunits = item.get_xaxis() 1781 if self.xaxis_label !=None:1781 if self.xaxis_label is not None: 1782 1782 xname = self.xaxis_label 1783 1783 xunits = self.xaxis_unit -
src/sas/sasgui/plottools/TextDialog.py
r959eb01 r7432acb 41 41 style_box = wx.BoxSizer(wx.HORIZONTAL) 42 42 # tcA 43 if unit !=None:43 if unit is not None: 44 44 styles = wx.TAB_TRAVERSAL 45 45 height = -1 … … 130 130 0, wx.TOP, 5) 131 131 family_box.Add(self.font_size, 0, 0) 132 if unit_box !=None:132 if unit_box is not None: 133 133 family_box.Add((_BOX_WIDTH / 2, -1)) 134 134 family_box.Add(tick_label_text, 0, 0) … … 159 159 text_box.Add(self.text_string) 160 160 vbox.Add(text_box, 0, wx.EXPAND, 15) 161 if unit_box !=None:161 if unit_box is not None: 162 162 unit_box.Add(unit_text, 0, 0) 163 163 unit_box.Add(self.unit_ctrl, 0, 0) -
src/sas/sasgui/plottools/arrow3d.py
r959eb01 r7432acb 29 29 self.base = base 30 30 31 if base !=None:31 if base is not None: 32 32 # To turn the updating off during dragging 33 33 base.canvas.mpl_connect('button_press_event', self.on_left_down) -
src/sas/sasgui/plottools/canvas.py
r463e7ffc r7432acb 153 153 """ 154 154 self.panel.subplot.grid(self.panel.grid_on) 155 if self.panel.legend !=None and self.panel.legend_pos_loc:155 if self.panel.legend is not None and self.panel.legend_pos_loc: 156 156 self.panel.legend._loc = self.panel.legend_pos_loc 157 157 self.idletimer.Restart(5, *args, **kwargs) # Delay by 5 ms -
src/sas/sasgui/plottools/fitDialog.py
r235f514 r7432acb 579 579 self.I0_tctr.SetValue(format_number(val)) 580 580 if self.Rgerr_tctr.IsShown(): 581 if rg !=None and rg != 0:581 if rg is not None and rg != 0: 582 582 value = format_number(3 * float(errA) / (2 * rg)) 583 583 else: … … 593 593 self.Diameter_tctr.SetValue(value) 594 594 if self.Diametererr_tctr.IsShown(): 595 if rg !=None and rg != 0:595 if rg is not None and rg != 0: 596 596 value = format_number(8 * float(errA) / _diam) 597 597 else: -
src/sas/sasgui/plottools/plottable_interactor.py
rac07a3a r7432acb 56 56 markersize = self.markersize 57 57 # Convert tuple (lo,hi) to array [(x-lo),(hi-x)] 58 if dx !=None and type(dx) == type(()):58 if dx is not None and type(dx) == type(()): 59 59 dx = nx.vstack((x - dx[0], dx[1] - x)).transpose() 60 if dy !=None and type(dy) == type(()):60 if dy is not None and type(dy) == type(()): 61 61 dy = nx.vstack((y - dy[0], dy[1] - y)).transpose() 62 62 -
src/sas/sasgui/plottools/plottables.py
rac07a3a r7432acb 682 682 has_err_y = not (dy is None or len(dy) == 0) 683 683 684 if(x != None) and (y !=None):684 if(x is not None) and (y is not None): 685 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" … … 864 864 if self.dy is None: 865 865 self.dy = np.zeros(len(self.y)) 866 if xmin != None and xmax !=None:866 if xmin is not None and xmax is not None: 867 867 for i in range(len(self.x)): 868 868 if self.x[i] >= xmin and self.x[i] <= xmax: -
src/sas/sasgui/plottools/transform.py
r235f514 r7432acb 188 188 189 189 """ 190 if dx !=None:190 if dx is not None: 191 191 err = 2 * x * dx 192 192 return math.fabs(err) … … 204 204 """ 205 205 if x > 0: 206 if dx !=None:206 if dx is not None: 207 207 err = dx / (2 * math.sqrt(x)) 208 208 else: … … 222 222 223 223 """ 224 if dx !=None:224 if dx is not None: 225 225 err = 4 * math.pow(x, 3) * dx 226 226 return math.fabs(err) … … 238 238 """ 239 239 if x > 0: 240 if dx !=None:240 if dx is not None: 241 241 err = dx / (4 * math.pow(x, 3 / 4)) 242 242 else:
Note: See TracChangeset
for help on using the changeset viewer.