Changeset 235f514 in sasview for src/sas/sasgui/perspectives/calculator
- 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/perspectives/calculator
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/calculator/calculator.py
r959eb01 r235f514 93 93 Edit meta data 94 94 """ 95 if self.data_edit_frame ==None:95 if self.data_edit_frame is None: 96 96 self.data_edit_frame = DataEditorWindow(parent=self.parent, 97 97 manager=self, data=[], … … 106 106 Data operation 107 107 """ 108 if self.data_operator_frame ==None:108 if self.data_operator_frame is None: 109 109 # Use one frame all the time 110 110 self.data_operator_frame = DataOperatorWindow(parent=self.parent, … … 121 121 Compute the Kiessig thickness 122 122 """ 123 if self.kiessig_frame ==None:123 if self.kiessig_frame is None: 124 124 frame = KiessigWindow(parent=self.parent, manager=self) 125 125 self.put_icon(frame) … … 133 133 Compute the scattering length density of molecula 134 134 """ 135 if self.sld_frame ==None:135 if self.sld_frame is None: 136 136 frame = SldWindow(parent=self.parent, 137 137 base=self.parent, manager=self) … … 146 146 Compute the mass density or molar voulme 147 147 """ 148 if self.cal_md_frame ==None:148 if self.cal_md_frame is None: 149 149 frame = DensityWindow(parent=self.parent, 150 150 base=self.parent, manager=self) … … 159 159 Compute the slit size a given data 160 160 """ 161 if self.cal_slit_frame ==None:161 if self.cal_slit_frame is None: 162 162 frame = SlitLengthCalculatorWindow(parent=self.parent, manager=self) 163 163 self.put_icon(frame) … … 171 171 Estimate the instrumental resolution 172 172 """ 173 if self.cal_res_frame ==None:173 if self.cal_res_frame is None: 174 174 frame = ResolutionWindow(parent=self.parent, manager=self) 175 175 self.put_icon(frame) … … 183 183 On Generic model menu event 184 184 """ 185 if self.gen_frame ==None:185 if self.gen_frame is None: 186 186 frame = SasGenWindow(parent=self.parent, manager=self) 187 187 self.put_icon(frame) … … 214 214 :param filename: file name to open in editor 215 215 """ 216 if self.py_frame ==None:216 if self.py_frame is None: 217 217 frame = PyConsole(parent=self.parent, base=self, 218 218 filename=filename) -
src/sas/sasgui/perspectives/calculator/data_editor.py
r959eb01 r235f514 419 419 """ 420 420 path = None 421 if location ==None:421 if location is None: 422 422 location = os.getcwd() 423 423 -
src/sas/sasgui/perspectives/calculator/data_operator.py
r959eb01 r235f514 198 198 self.send_warnings('') 199 199 msg = '' 200 if name ==None:200 if name is None: 201 201 text = self.data_namectr.GetValue().strip() 202 202 else: … … 205 205 name_list = [] 206 206 for state in state_list: 207 if state.data ==None:207 if state.data is None: 208 208 theory_list = state.get_theory() 209 209 theory, _ = theory_list.values()[0] … … 278 278 pos = item.GetCurrentSelection() 279 279 data = item.GetClientData(pos) 280 if data ==None:280 if data is None: 281 281 content = "?" 282 282 self.put_text_pic(self.data1_pic, content) … … 313 313 content = "?" 314 314 if not (self.numberctr.IsShown() and self.numberctr.IsEnabled()): 315 if data ==None:315 if data is None: 316 316 content = "?" 317 317 self.put_text_pic(self.data2_pic, content) … … 355 355 pos1 = self.data1_cbox.GetCurrentSelection() 356 356 data1 = self.data1_cbox.GetClientData(pos1) 357 if data1 ==None:357 if data1 is None: 358 358 self.output = None 359 359 return flag … … 361 361 data2 = self.data2_cbox.GetClientData(pos2) 362 362 363 if data2 ==None:363 if data2 is None: 364 364 self.output = None 365 365 return flag … … 422 422 """ 423 423 out = self.out_pic 424 if output ==None:424 if output is None: 425 425 content = "?" 426 426 self.put_text_pic(out, content) … … 592 592 name_list = [] 593 593 for state in state_list: 594 if state.data ==None:594 if state.data is None: 595 595 theory_list = state.get_theory() 596 596 theory, _ = theory_list.values()[0] … … 609 609 wx.MessageBox(msg, 'Error') 610 610 return 611 if self.output ==None:611 if self.output is None: 612 612 msg = "No Output Data has been generated... " 613 613 wx.MessageBox(msg, 'Error') -
src/sas/sasgui/perspectives/calculator/density_panel.py
r959eb01 r235f514 239 239 update units and output combobox 240 240 """ 241 if event ==None:241 if event is None: 242 242 return 243 243 event.Skip() … … 257 257 update units and input combobox 258 258 """ 259 if event ==None:259 if event is None: 260 260 return 261 261 event.Skip() -
src/sas/sasgui/perspectives/calculator/gen_scatter_panel.py
r959eb01 r235f514 487 487 path = None 488 488 filename = '' 489 if location ==None:489 if location is None: 490 490 location = os.getcwd() 491 491 … … 864 864 return 865 865 self.sld_data = self.parent.get_sld_from_omf() 866 if self.sld_data ==None:866 if self.sld_data is None: 867 867 if self.parent.parent != None: 868 868 infor = 'Error' … … 880 880 self.model.set_sld_data(self.sld_data) 881 881 self.set_input_params() 882 if self.is_avg or self.is_avg ==None:882 if self.is_avg or self.is_avg is None: 883 883 self._create_default_1d_data() 884 884 i_out = np.zeros(len(self.data.y)) … … 979 979 Update the progress bar 980 980 """ 981 if self.parent.parent ==None:981 if self.parent.parent is None: 982 982 return 983 983 type = "progress" … … 1010 1010 out = np.append(out, outi) 1011 1011 #print time.time() - s 1012 if self.is_avg or self.is_avg ==None:1012 if self.is_avg or self.is_avg is None: 1013 1013 self._draw1D(out) 1014 1014 else: … … 1287 1287 key_low = key.lower() 1288 1288 if key_low.count('mx') > 0: 1289 if sld_sets[key] ==None:1289 if sld_sets[key] is None: 1290 1290 sld_sets[key] = self.sld_data.sld_mx 1291 1291 mx = sld_sets[key] 1292 1292 elif key_low.count('my') > 0: 1293 if sld_sets[key] ==None:1293 if sld_sets[key] is None: 1294 1294 sld_sets[key] = self.sld_data.sld_my 1295 1295 my = sld_sets[key] 1296 1296 elif key_low.count('mz') > 0: 1297 if sld_sets[key] ==None:1297 if sld_sets[key] is None: 1298 1298 sld_sets[key] = self.sld_data.sld_mz 1299 1299 mz = sld_sets[key] … … 1368 1368 """ 1369 1369 1370 if omfdata ==None:1370 if omfdata is None: 1371 1371 self._set_none_text() 1372 1372 return … … 1437 1437 self.slds = [] 1438 1438 omfdata = self.sld_data 1439 if omfdata ==None:1439 if omfdata is None: 1440 1440 raise 1441 1441 sld_key_list = self._get_slds_key_list(omfdata) … … 1477 1477 self.nodes = [] 1478 1478 omfdata = self.sld_data 1479 if omfdata ==None:1479 if omfdata is None: 1480 1480 raise 1481 1481 key_list = self._get_nodes_key_list(omfdata) … … 1512 1512 self.stepsize = [] 1513 1513 omfdata = self.sld_data 1514 if omfdata ==None:1514 if omfdata is None: 1515 1515 raise 1516 1516 key_list = self._get_step_key_list(omfdata) … … 1631 1631 Set sld textctrls 1632 1632 """ 1633 if sld_data ==None:1633 if sld_data is None: 1634 1634 for ctr_list in self.slds: 1635 1635 ctr_list[1].Enable(False) … … 1739 1739 if npts > 0: 1740 1740 nop = self.set_npts_from_slddata() 1741 if nop ==None:1741 if nop is None: 1742 1742 nop = npts 1743 1743 self.display_npts(nop) … … 1911 1911 Set omfdata 1912 1912 """ 1913 if data ==None:1913 if data is None: 1914 1914 return 1915 1915 self.sld_data = data 1916 enable = (not data ==None)1916 enable = (not data is None) 1917 1917 self._set_omfpanel_sld_data(self.sld_data) 1918 1918 self.omfpanel.bt_save.Enable(enable) -
src/sas/sasgui/perspectives/calculator/image_viewer.py
r959eb01 r235f514 85 85 """ 86 86 path = None 87 if location ==None:87 if location is None: 88 88 location = os.getcwd() 89 89 dlg = wx.FileDialog(self.parent, "Image Viewer: Choose a image file", -
src/sas/sasgui/perspectives/calculator/model_editor.py
r959eb01 r235f514 1388 1388 1389 1389 def _get_upper_name(self, name=None): 1390 if name ==None:1390 if name is None: 1391 1391 return "" 1392 1392 upper_name = "" -
src/sas/sasgui/perspectives/calculator/resolution_calculator_panel.py
r959eb01 r235f514 839 839 : Param image: pylab object 840 840 """ 841 if image ==None:841 if image is None: 842 842 return 843 843 if color == 'g': … … 973 973 if len(qx) != len(qy): 974 974 return None 975 if qx == None or qy ==None:975 if qx is None or qy is None: 976 976 return None 977 977 return qx, qy … … 1261 1261 if selection == 'Add new': 1262 1262 path = self._selectDlg() 1263 if path ==None:1263 if path is None: 1264 1264 self.spectrum_cb.SetValue('Flat') 1265 1265 self.resolution.set_spectrum(self.spectrum_dic['Flat']) … … 1301 1301 """ 1302 1302 try: 1303 if path ==None:1303 if path is None: 1304 1304 wx.PostEvent(self.parent.parent, StatusEvent(status=\ 1305 1305 " Selected Distribution was not loaded: %s" % path)) -
src/sas/sasgui/perspectives/calculator/slit_length_calculator_panel.py
rd0248bd r235f514 157 157 path = None 158 158 filename = '' 159 if location ==None:159 if location is None: 160 160 location = os.getcwd() 161 161
Note: See TracChangeset
for help on using the changeset viewer.