Changeset 235f514 in sasview for src/sas/sasgui/guiframe
- 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/guiframe
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/guiframe/CategoryInstaller.py
r959eb01 r235f514 132 132 133 133 serialized_file = None 134 if homedir ==None:134 if homedir is None: 135 135 serialized_file = CategoryInstaller.get_user_file() 136 136 else: -
src/sas/sasgui/guiframe/dataFitting.py
r959eb01 r235f514 78 78 result.clone_without_data(length=len(self.x), clone=self) 79 79 result.copy_from_datainfo(data1d=self) 80 if self.dxw ==None:80 if self.dxw is None: 81 81 result.dxw = None 82 82 else: 83 83 result.dxw = np.zeros(len(self.x)) 84 if self.dxl ==None:84 if self.dxl is None: 85 85 result.dxl = None 86 86 else: … … 125 125 tot_length = len(self.x) + len(other.x) 126 126 result = self.clone_without_data(length=tot_length, clone=result) 127 if self.dlam ==None or other.dlam is None:127 if self.dlam is None or other.dlam is None: 128 128 result.dlam = None 129 129 else: 130 130 result.dlam = np.zeros(tot_length) 131 if self.dy ==None or other.dy is None:131 if self.dy is None or other.dy is None: 132 132 result.dy = None 133 133 else: 134 134 result.dy = np.zeros(tot_length) 135 if self.dx ==None or other.dx is None:135 if self.dx is None or other.dx is None: 136 136 result.dx = None 137 137 else: 138 138 result.dx = np.zeros(tot_length) 139 if self.dxw ==None or other.dxw is None:139 if self.dxw is None or other.dxw is None: 140 140 result.dxw = None 141 141 else: 142 142 result.dxw = np.zeros(tot_length) 143 if self.dxl ==None or other.dxl is None:143 if self.dxl is None or other.dxl is None: 144 144 result.dxl = None 145 145 else: … … 227 227 result = self.clone_without_data(len(self.x)) 228 228 result.copy_from_datainfo(data1d=self) 229 if self.dxw ==None:229 if self.dxw is None: 230 230 result.dxw = None 231 231 else: 232 232 result.dxw = np.zeros(len(self.x)) 233 if self.dxl ==None:233 if self.dxl is None: 234 234 result.dxl = None 235 235 else: … … 279 279 tot_length = len(self.x)+len(other.x) 280 280 result.clone_without_data(length=tot_length, clone=self) 281 if self.dlam ==None or other.dlam is None:281 if self.dlam is None or other.dlam is None: 282 282 result.dlam = None 283 283 else: 284 284 result.dlam = np.zeros(tot_length) 285 if self.dy ==None or other.dy is None:285 if self.dy is None or other.dy is None: 286 286 result.dy = None 287 287 else: 288 288 result.dy = np.zeros(tot_length) 289 if self.dx ==None or other.dx is None:289 if self.dx is None or other.dx is None: 290 290 result.dx = None 291 291 else: 292 292 result.dx = np.zeros(tot_length) 293 if self.dxw ==None or other.dxw is None:293 if self.dxw is None or other.dxw is None: 294 294 result.dxw = None 295 295 else: 296 296 result.dxw = np.zeros(tot_length) 297 if self.dxl ==None or other.dxl is None:297 if self.dxl is None or other.dxl is None: 298 298 result.dxl = None 299 299 else: … … 405 405 result.ymin = self.ymin 406 406 result.ymax = self.ymax 407 if self.dqx_data == None or self.dqy_data ==None:407 if self.dqx_data is None or self.dqy_data is None: 408 408 result.dqx_data = None 409 409 result.dqy_data = None … … 468 468 result.ymin = self.ymin 469 469 result.ymax = self.ymax 470 if self.dqx_data == None or self.dqy_data ==None or \471 other.dqx_data == None or other.dqy_data ==None :470 if self.dqx_data is None or self.dqy_data is None or \ 471 other.dqx_data is None or other.dqy_data is None : 472 472 result.dqx_data = None 473 473 result.dqy_data = None -
src/sas/sasgui/guiframe/data_processor.py
re645bbb r235f514 315 315 if row > self.max_row_touse: 316 316 self.max_row_touse = row 317 if self.data ==None:317 if self.data is None: 318 318 self.data = {} 319 319 event.Skip() … … 814 814 """ 815 815 816 if self.data ==None:816 if self.data is None: 817 817 self.data = {} 818 if self.file_name ==None:818 if self.file_name is None: 819 819 self.file_name = 'copied_data' 820 820 self.Paste() … … 1017 1017 if index - 1 >= 0: 1018 1018 new_row, _ = temp_list[index - 1] 1019 if not new_row ==None and new_row != ' ':1019 if not new_row is None and new_row != ' ': 1020 1020 label += create_label(col_name, None, 1021 1021 int(new_row) + 1) … … 1025 1025 if index + 1 < len(temp_list): 1026 1026 new_row, _ = temp_list[index + 1] 1027 if not new_row ==None:1027 if not new_row is None: 1028 1028 label += create_label(col_name, 1029 1029 int(new_row) + 1, None) … … 1085 1085 1086 1086 # Let's re-order the data from the keys in 'Data' name. 1087 if outputs ==None:1087 if outputs is None: 1088 1088 return 1089 1089 try: … … 1380 1380 wx.PostEvent(self.parent.parent, StatusEvent(status=msg, info="error")) 1381 1381 return 1382 if dy ==None:1382 if dy is None: 1383 1383 dy = np.zeros(len(y)) 1384 1384 #plotting … … 1441 1441 col = column_names[col_name] 1442 1442 axis = self.get_plot_axis(col, list) 1443 if axis ==None:1443 if axis is None: 1444 1444 return None 1445 1445 sentence = sentence.replace(tok, "numpy.array(%s)" % str(axis)) -
src/sas/sasgui/guiframe/local_perspectives/data_loader/data_loader.py
rc1d5aea r235f514 75 75 path = None 76 76 self._default_save_location = self.parent._default_save_location 77 if self._default_save_location ==None:77 if self._default_save_location is None: 78 78 self._default_save_location = os.getcwd() 79 79 … … 116 116 path = None 117 117 self._default_save_location = self.parent._default_save_location 118 if self._default_save_location ==None:118 if self._default_save_location is None: 119 119 self._default_save_location = os.getcwd() 120 120 dlg = wx.DirDialog(self.parent, "Choose a directory", -
src/sas/sasgui/guiframe/local_perspectives/plotting/AnnulusSlicer.py
rd85c194 r235f514 122 122 data = self.base.data2D 123 123 # If we have no data, just return 124 if data ==None:124 if data is None: 125 125 return 126 126 … … 132 132 # if the user does not specify the numbers of points to plot 133 133 # the default number will be nbins= 36 134 if nbins ==None:134 if nbins is None: 135 135 self.nbins = 36 136 136 else: … … 521 521 522 522 # If we have no data, just return 523 if data ==None:523 if data is None: 524 524 return 525 525 mask = data.mask -
src/sas/sasgui/guiframe/local_perspectives/plotting/Arc.py
r959eb01 r235f514 81 81 npts = int((self.theta2 - self.theta1) / (math.pi / 120)) 82 82 83 if r ==None:83 if r is None: 84 84 self.radius = math.sqrt(math.pow(self._mouse_x, 2) + \ 85 85 math.pow(self._mouse_y, 2)) -
src/sas/sasgui/guiframe/local_perspectives/plotting/Plotter1D.py
r959eb01 r235f514 212 212 On Qmin Qmax vertical line event 213 213 """ 214 if event ==None:214 if event is None: 215 215 return 216 216 event.Skip() 217 217 active_ctrl = event.active 218 if active_ctrl ==None:218 if active_ctrl is None: 219 219 return 220 220 if hasattr(event, 'is_corfunc'): … … 231 231 colors.append('purple') 232 232 values.append(min(x_data.max(), float(ctrl[2].GetValue()))) 233 if self.ly ==None:233 if self.ly is None: 234 234 self.ly = [] 235 235 for c, v in zip(colors, values): … … 336 336 if hasattr(event, "action"): 337 337 dclick = event.action == 'dclick' 338 if ax ==None or dclick:338 if ax is None or dclick: 339 339 # remove the vline 340 340 self._check_zoom_plot() … … 361 361 Move the cursor line to write Q range 362 362 """ 363 if self.q_ctrl ==None:363 if self.q_ctrl is None: 364 364 return 365 365 # release a q range vline … … 370 370 return 371 371 ax = event.inaxes 372 if ax ==None or not hasattr(event, 'action'):372 if ax is None or not hasattr(event, 'action'): 373 373 return 374 374 end_drag = event.action != 'drag' and event.xdata != None … … 618 618 # add menu of other plugins 619 619 item_list = self.parent.get_current_context_menu(self) 620 if (not item_list ==None) and (not len(item_list) == 0):620 if (not item_list is None) and (not len(item_list) == 0): 621 621 for item, wx_id in zip(item_list, [ids.next() for i in range(len(item_list))]): 622 622 … … 811 811 curr_label = self.appearance_selected_plot.label 812 812 813 if curr_color ==None:813 if curr_color is None: 814 814 curr_color = self._color_labels['Blue'] 815 815 curr_symbol = 13 -
src/sas/sasgui/guiframe/local_perspectives/plotting/Plotter2D.py
r959eb01 r235f514 144 144 """ 145 145 # Not implemented 146 if event ==None:146 if event is None: 147 147 return 148 148 event.Skip() … … 227 227 if self._is_changed_legend_label: 228 228 data.label = self.title_label 229 if data.label ==None:229 if data.label is None: 230 230 data.label = data.name 231 231 if not self.title_font: … … 320 320 if len(self.data2D.detector) <= 1: 321 321 item_list = self.parent.get_current_context_menu(self) 322 if (not item_list ==None) and (not len(item_list) == 0) and\322 if (not item_list is None) and (not len(item_list) == 0) and\ 323 323 self.data2D.name.split(" ")[0] != 'Residuals': 324 324 for item, wx_id in zip(item_list, [ids.next() for i in range(len(item_list))]): … … 533 533 """ 534 534 ## Clear current slicer 535 if not self.slicer ==None:535 if not self.slicer is None: 536 536 self.slicer.clear() 537 537 ## Create a new slicer … … 719 719 Clear the slicer on the plot 720 720 """ 721 if not self.slicer ==None:721 if not self.slicer is None: 722 722 self.slicer.clear() 723 723 self.subplot.figure.canvas.draw() -
src/sas/sasgui/guiframe/local_perspectives/plotting/SectorSlicer.py
r959eb01 r235f514 144 144 data = self.base.data2D 145 145 # If we have no data, just return 146 if data ==None:146 if data is None: 147 147 return 148 148 ## Averaging … … 151 151 phimin = -self.left_line.phi + self.main_line.theta 152 152 phimax = self.left_line.phi + self.main_line.theta 153 if nbins ==None:153 if nbins is None: 154 154 nbins = 20 155 155 sect = SectorQ(r_min=0.0, r_max=radius, … … 364 364 if phi != None: 365 365 self.phi = phi 366 if delta ==None:366 if delta is None: 367 367 delta = 0 368 368 if right: -
src/sas/sasgui/guiframe/local_perspectives/plotting/SlicerParameters.py
rd85c194 r235f514 46 46 """ 47 47 event.Skip() 48 if event.obj_class ==None:48 if event.obj_class is None: 49 49 self.set_slicer(None, None) 50 50 else: … … 57 57 self.bck.Clear(True) 58 58 self.type = type 59 if type ==None:59 if type is None: 60 60 label = "Right-click on 2D plot for slicer options" 61 61 title = wx.StaticText(self, -1, label, style=wx.ALIGN_LEFT) -
src/sas/sasgui/guiframe/local_perspectives/plotting/boxSlicer.py
r959eb01 r235f514 139 139 140 140 """ 141 if self.direction ==None:141 if self.direction is None: 142 142 self.direction = direction 143 143 … … 149 149 if nbins != None: 150 150 self.nbins = nbins 151 if self.averager ==None:152 if new_slab ==None:151 if self.averager is None: 152 if new_slab is None: 153 153 msg = "post data:cannot average , averager is empty" 154 154 raise ValueError, msg -
src/sas/sasgui/guiframe/local_perspectives/plotting/detector_dialog.py
r959eb01 r235f514 90 90 zmin = self.reset_zmin_ctl 91 91 zmax = self.reset_zmax_ctl 92 if zmin ==None:92 if zmin is None: 93 93 zmin = "" 94 if zmax ==None:94 if zmax is None: 95 95 zmax = "" 96 96 self.zmin_ctl.SetValue(str(zmin)) -
src/sas/sasgui/guiframe/local_perspectives/plotting/masking.py
r959eb01 r235f514 249 249 Add new mask to old mask 250 250 """ 251 if not self.slicer ==None:251 if not self.slicer is None: 252 252 data = Data2D() 253 253 data = self.data … … 269 269 Erase new mask from old mask 270 270 """ 271 if not self.slicer ==None:271 if not self.slicer is None: 272 272 self.slicer_mask = self.slicer.update() 273 273 mask = self.data.mask … … 307 307 Clear the slicer on the plot 308 308 """ 309 if not self.slicer ==None:309 if not self.slicer is None: 310 310 self.slicer.clear() 311 311 self.subplot.figure.canvas.draw() -
src/sas/sasgui/guiframe/local_perspectives/plotting/plotting.py
r959eb01 r235f514 88 88 On Qmin Qmax vertical line event 89 89 """ 90 if event ==None:90 if event is None: 91 91 return 92 92 if event.id in self.plot_panels.keys(): … … 99 99 100 100 def _on_plot_lim(self, event=None): 101 if event ==None:101 if event is None: 102 102 return 103 103 if event.id in self.plot_panels.keys(): -
src/sas/sasgui/guiframe/local_perspectives/plotting/sector_mask.py
r959eb01 r235f514 117 117 data = self.base.data 118 118 # If we have no data, just return 119 if data ==None:119 if data is None: 120 120 return 121 121 ## Averaging -
src/sas/sasgui/guiframe/local_perspectives/plotting/slicerpanel.py
rd85c194 r235f514 37 37 self.bck = wx.GridBagSizer(5, 5) 38 38 self.SetSizer(self.bck) 39 if type == None and params ==None:39 if type is None and params is None: 40 40 label = "Right-click on 2D plot for slicer options" 41 41 title = wx.StaticText(self, -1, label, style=wx.ALIGN_LEFT) … … 57 57 """ 58 58 event.Skip() 59 if event.obj_class ==None:59 if event.obj_class is None: 60 60 self.set_slicer(None, None) 61 61 else: … … 68 68 self.bck.Clear(True) 69 69 self.type = type 70 if type ==None:70 if type is None: 71 71 label = "Right-click on 2D plot for slicer options" 72 72 title = wx.StaticText(self, -1, label, style=wx.ALIGN_LEFT) -
src/sas/sasgui/guiframe/panel_base.py
r959eb01 r235f514 441 441 """ 442 442 """ 443 if self._manager ==None:443 if self._manager is None: 444 444 return None 445 445 return self._manager.frame -
src/sas/sasgui/guiframe/startup_configuration.py
r959eb01 r235f514 129 129 width, _ = panel.frame.GetSizeTuple() 130 130 if panel.frame.IsShown(): 131 if p_size ==None or width > p_size:131 if p_size is None or width > p_size: 132 132 p_size = width 133 if p_size ==None:133 if p_size is None: 134 134 p_size = CURRENT_STRINGS['PLOPANEL_WIDTH'] 135 135 self.current_string['PLOPANEL_WIDTH'] = p_size … … 145 145 146 146 data_pw, _ = self.parent.panels["data_panel"].frame.GetSizeTuple() 147 if data_pw ==None:147 if data_pw is None: 148 148 data_pw = CURRENT_STRINGS['DATAPANEL_WIDTH'] 149 149 self.current_string['DATAPANEL_WIDTH'] = data_pw
Note: See TracChangeset
for help on using the changeset viewer.