Changeset fa81e94 in sasview for src/sas/sasgui/perspectives/calculator
- Timestamp:
- Nov 15, 2017 4:33:09 AM (7 years ago)
- Branches:
- 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
- Children:
- d4881f6a
- Parents:
- 7c487846
- Location:
- src/sas/sasgui/perspectives/calculator
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/calculator/__init__.py
- Property mode changed from 100644 to 100755
r5a405bd rfa81e94 2 2 import os 3 3 from distutils.filelist import findall 4 from calculator import *4 from .calculator import * 5 5 N_DIR = 12 6 6 def get_data_path(media): -
src/sas/sasgui/perspectives/calculator/collimation_editor.py
- Property mode changed from 100644 to 100755
r959eb01 rfa81e94 6 6 from sas.sascalc.dataloader.loader import Loader 7 7 from sas.sascalc.dataloader.data_info import Aperture, Collimation 8 from aperture_editor import ApertureDialog8 from .aperture_editor import ApertureDialog 9 9 10 10 from sas.sasgui.guiframe.utils import check_float -
src/sas/sasgui/perspectives/calculator/data_editor.py
- Property mode changed from 100644 to 100755
r235f514 rfa81e94 7 7 from sas.sascalc.dataloader.loader import Loader 8 8 from sas.sascalc.dataloader.data_info import Data2D 9 from detector_editor import DetectorDialog10 from collimation_editor import CollimationDialog11 from console import ConsoleDialog9 from .detector_editor import DetectorDialog 10 from .collimation_editor import CollimationDialog 11 from .console import ConsoleDialog 12 12 13 13 from sas.sasgui.guiframe.events import StatusEvent … … 397 397 if data is None: 398 398 return 399 from sample_editor import SampleDialog399 from .sample_editor import SampleDialog 400 400 dlg = SampleDialog(parent=self, sample=data.sample) 401 401 dlg.set_manager(self) … … 409 409 if data is None: 410 410 return 411 from source_editor import SourceDialog411 from .source_editor import SourceDialog 412 412 dlg = SourceDialog(parent=self, source=data.source) 413 413 dlg.set_manager(self) … … 527 527 try: 528 528 #Load data 529 from load_thread import DataReader529 from .load_thread import DataReader 530 530 ## If a thread is already started, stop it 531 531 if self.reader is not None and self.reader.isrunning(): … … 536 536 self.reader.queue() 537 537 except: 538 msg = "Data Editor: %s" % (sys.exc_ value)538 msg = "Data Editor: %s" % (sys.exc_info()[1]) 539 539 load_error(msg) 540 540 return -
src/sas/sasgui/perspectives/calculator/data_operator.py
- Property mode changed from 100644 to 100755
r7432acb rfa81e94 202 202 else: 203 203 text = name 204 state_list = self.get_datalist().values()204 state_list = list(self.get_datalist().values()) 205 205 name_list = [] 206 206 for state in state_list: 207 207 if state.data is None: 208 208 theory_list = state.get_theory() 209 theory, _ = theory_list.values()[0]209 theory, _ = list(theory_list.values())[0] 210 210 d_name = str(theory.name) 211 211 else: … … 397 397 self._set_textctrl_color(self.data1_cbox, 'pink') 398 398 self._set_textctrl_color(self.data2_cbox, 'pink') 399 msg = "DataOperation: %s" % sys.exc_ value399 msg = "DataOperation: %s" % sys.exc_info()[1] 400 400 self.send_warnings(msg, 'error') 401 401 self.output = None … … 411 411 operator = self.operator_cbox.GetClientData(pos) 412 412 try: 413 exec "output = data1 %s data2" % operator413 exec("output = data1 %s data2" % operator) 414 414 except: 415 415 raise … … 532 532 self.data2_cbox.SetClientData(pos3, val) 533 533 dnames = [] 534 ids = self._data.keys()534 ids = list(self._data.keys()) 535 535 for id in ids: 536 536 if id is not None: … … 539 539 else: 540 540 theory_list = self._data[id].get_theory() 541 theory, _ = theory_list.values()[0]541 theory, _ = list(theory_list.values())[0] 542 542 dnames.append(theory.name) 543 543 ind = np.argsort(dnames) 544 544 if len(ind) > 0: 545 val_list = np.array( self._data.values())[ind]545 val_list = np.array(list(self._data.values()))[ind] 546 546 for datastate in val_list: 547 547 data = datastate.data … … 558 558 try: 559 559 theory_list = datastate.get_theory() 560 for theory, _ in theory_list.values():560 for theory, _ in list(theory_list.values()): 561 561 th_name = theory.name 562 562 posth1 = self.data1_cbox.Append(str(th_name)) … … 588 588 self.send_warnings('') 589 589 self.data_namectr.SetBackgroundColour('white') 590 state_list = self.get_datalist().values()590 state_list = list(self.get_datalist().values()) 591 591 name = self.data_namectr.GetValue().strip() 592 592 name_list = [] … … 594 594 if state.data is None: 595 595 theory_list = state.get_theory() 596 theory, _ = theory_list.values()[0]596 theory, _ = list(theory_list.values())[0] 597 597 d_name = str(theory.name) 598 598 else: … … 896 896 list = [] 897 897 list = self.graph.returnPlottable() 898 if len(list .keys()) > 0:899 first_item = list .keys()[0]898 if len(list(list.keys())) > 0: 899 first_item = list(list.keys())[0] 900 900 if first_item.x != []: 901 901 from sas.sasgui.plottools.PropertyDialog import Properties -
src/sas/sasgui/perspectives/calculator/density_panel.py
- Property mode changed from 100644 to 100755
r7432acb rfa81e94 364 364 except: 365 365 if self.base is not None: 366 msg = "Density/Volume Calculator: %s" % (sys.exc_ value)366 msg = "Density/Volume Calculator: %s" % (sys.exc_info()[1]) 367 367 wx.PostEvent(self.base, StatusEvent(status=msg)) 368 368 if event is not None: -
src/sas/sasgui/perspectives/calculator/detector_editor.py
- Property mode changed from 100644 to 100755
ra1b8fee rfa81e94 1 from __future__ import print_function 1 2 2 3 3 import wx … … 35 35 self.set_values() 36 36 except: 37 print("error", sys.exc_ value)37 print("error", sys.exc_info()[1]) 38 38 39 39 def _define_structure(self): -
src/sas/sasgui/perspectives/calculator/gen_scatter_panel.py
- Property mode changed from 100644 to 100755
ra1b8fee rfa81e94 3 3 This module relies on guiframe manager. 4 4 """ 5 from __future__ import print_function 5 6 6 7 7 import wx … … 228 228 sizer.Add(unit_title, (iy, ix), (1, 1), \ 229 229 wx.EXPAND | wx.ADJUST_MINSIZE, 0) 230 key_list = params.keys()230 key_list = list(params.keys()) 231 231 key_list.sort() 232 232 for param in key_list: … … 560 560 if self.parent.parent is None: 561 561 return 562 msg = "Generic SAS Calculator: %s" % (sys.exc_ value)562 msg = "Generic SAS Calculator: %s" % (sys.exc_info()[1]) 563 563 wx.PostEvent(self.parent.parent, 564 564 StatusEvent(status=msg, type='stop')) … … 761 761 # II. Plot selective points in color 762 762 other_color = np.ones(len(pix_symbol), dtype='bool') 763 for key in color_dic.keys():763 for key in list(color_dic.keys()): 764 764 chosen_color = pix_symbol == key 765 765 if np.any(chosen_color): … … 775 775 # Get atom names not in the list 776 776 a_names = [symb for symb in pix_symbol \ 777 if symb not in color_dic.keys()]777 if symb not in list(color_dic.keys())] 778 778 a_name = a_names[0] 779 779 for name in a_names: … … 899 899 900 900 except: 901 msg = "%s." % sys.exc_ value901 msg = "%s." % sys.exc_info()[1] 902 902 status_type = 'stop' 903 903 self._status_info(msg, status_type) … … 1285 1285 else: 1286 1286 sld_sets[list[0]] = None 1287 for key in sld_sets.keys():1287 for key in list(sld_sets.keys()): 1288 1288 key_low = key.lower() 1289 1289 if key_low.count('mx') > 0: … … 1336 1336 return 1337 1337 1338 for key in sets.keys():1338 for key in list(sets.keys()): 1339 1339 setattr(omfdata, key, sets[key]) 1340 1340 … … 1345 1345 self.sld_data.filename = "Default SLD Profile" 1346 1346 except: 1347 msg = "OMF Panel: %s" % sys.exc_ value1347 msg = "OMF Panel: %s" % sys.exc_info()[1] 1348 1348 infor = 'Error' 1349 1349 #logger.error(msg) … … 1375 1375 step_list = self._get_step_key_list(omfdata) 1376 1376 for ctr_list in self.nodes: 1377 for key in nodes_list.keys():1377 for key in list(nodes_list.keys()): 1378 1378 if ctr_list[0] == key: 1379 1379 ctr_list[1].SetValue(format_number(nodes_list[key], True)) … … 1381 1381 break 1382 1382 for ctr_list in self.stepsize: 1383 for key in step_list.keys():1383 for key in list(step_list.keys()): 1384 1384 if ctr_list[0] == key: 1385 1385 ctr_list[1].SetValue(format_number(step_list[key], True)) … … 1442 1442 sld_key_list = self._get_slds_key_list(omfdata) 1443 1443 # Dic is not sorted 1444 key_list = [key for key in sld_key_list.keys()]1444 key_list = [key for key in list(sld_key_list.keys())] 1445 1445 # Sort here 1446 1446 key_list.sort() … … 1485 1485 ix = 0 1486 1486 iy = -1 1487 for key, value in key_list.ite ritems():1487 for key, value in key_list.items(): 1488 1488 iy += 1 1489 1489 ix = 0 … … 1521 1521 iy = -1 1522 1522 #key_list.sort() 1523 for key, value in key_list.ite ritems():1523 for key, value in key_list.items(): 1524 1524 iy += 1 1525 1525 ix = 0 … … 1641 1641 sld_list = self._get_slds_key_list(sld_data) 1642 1642 for ctr_list in self.slds: 1643 for key in sld_list.keys():1643 for key in list(sld_list.keys()): 1644 1644 if ctr_list[0] == key: 1645 1645 min_val = np.min(sld_list[key]) -
src/sas/sasgui/perspectives/calculator/image_viewer.py
- Property mode changed from 100644 to 100755
r412e9e8b rfa81e94 1 from __future__ import print_function 1 2 2 3 3 import os -
src/sas/sasgui/perspectives/calculator/kiessig_calculator_panel.py
- Property mode changed from 100644 to 100755
r7432acb rfa81e94 14 14 from sas.sasgui.guiframe.panel_base import PanelBase 15 15 from sas.sascalc.calculator.kiessig_calculator import KiessigThicknessCalculator 16 from calculator_widgets import OutputTextCtrl17 from calculator_widgets import InputTextCtrl16 from .calculator_widgets import OutputTextCtrl 17 from .calculator_widgets import InputTextCtrl 18 18 from sas.sasgui.perspectives.calculator import calculator_widgets as widget 19 19 from sas.sasgui.guiframe.documentation_window import DocumentationWindow -
src/sas/sasgui/perspectives/calculator/model_editor.py
- Property mode changed from 100644 to 100755
r69363c7 rfa81e94 23 23 #copyright 2009, University of Tennessee 24 24 ################################################################################ 25 from __future__ import print_function 25 26 26 27 27 import wx … … 790 790 if item.count("_") < 1: 791 791 try: 792 exec "float(math.%s)" % item792 exec("float(math.%s)" % item) 793 793 self.math_combo.Append(str(item)) 794 794 except Exception: -
src/sas/sasgui/perspectives/calculator/resolution_calculator_panel.py
- Property mode changed from 100644 to 100755
r01cda57 rfa81e94 148 148 # Custom sorting 149 149 source_list = [] 150 for key, _ in self.source_mass.ite ritems():150 for key, _ in self.source_mass.items(): 151 151 name_source = str(key) 152 152 source_list.append(name_source) … … 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 … … 1100 1100 new_string.append(value) 1101 1101 except: 1102 logger.error(sys.exc_ value)1102 logger.error(sys.exc_info()[1]) 1103 1103 1104 1104 return new_string … … 1142 1142 return out 1143 1143 except: 1144 logger.error(sys.exc_ value)1144 logger.error(sys.exc_info()[1]) 1145 1145 1146 1146 def _on_xy_coordinate(self, event=None): … … 1269 1269 try: 1270 1270 basename = os.path.basename(path) 1271 if basename not in self.spectrum_dic.keys():1271 if basename not in list(self.spectrum_dic.keys()): 1272 1272 self.spectrum_cb.Append(basename) 1273 1273 self.spectrum_dic[basename] = self._read_file(path) … … 1320 1320 except: 1321 1321 # Skip non-data lines 1322 logger.error(sys.exc_ value)1322 logger.error(sys.exc_info()[1]) 1323 1323 1324 1324 return [wavelength, intensity] -
src/sas/sasgui/perspectives/calculator/sld_panel.py
- Property mode changed from 100644 to 100755
r2d220dd rfa81e94 366 366 if len(myformula.atoms) != 1: 367 367 return 368 element = myformula.atoms.keys()[0]368 element = list(myformula.atoms.keys())[0] 369 369 energy = xray_energy(element.K_alpha) 370 370 … … 450 450 if len(element_formula.atoms) != 1: 451 451 return 452 element = element_formula.atoms.keys()[0]452 element = list(element_formula.atoms.keys())[0] 453 453 energy = xray_energy(element.K_alpha) 454 454 atom = molecule_formula.atoms … … 507 507 except: 508 508 if self.base is not None: 509 msg = "SLD Calculator: %s" % (sys.exc_ value)509 msg = "SLD Calculator: %s" % (sys.exc_info()[1]) 510 510 wx.PostEvent(self.base, StatusEvent(status=msg)) 511 511 if event is not None: -
src/sas/sasgui/perspectives/calculator/slit_length_calculator_panel.py
- Property mode changed from 100644 to 100755
r7432acb rfa81e94 17 17 from sas.sasgui.guiframe.events import StatusEvent 18 18 from sas.sascalc.calculator.slit_length_calculator import SlitlengthCalculator 19 from calculator_widgets import OutputTextCtrl20 from calculator_widgets import InterActiveOutputTextCtrl19 from .calculator_widgets import OutputTextCtrl 20 from .calculator_widgets import InterActiveOutputTextCtrl 21 21 from sas.sasgui.perspectives.calculator import calculator_widgets as widget 22 22 from sas.sasgui.guiframe.documentation_window import DocumentationWindow … … 210 210 try: 211 211 #Load data 212 from load_thread import DataReader212 from .load_thread import DataReader 213 213 ## If a thread is already started, stop it 214 214 if self.reader is not None and self.reader.isrunning(): … … 226 226 if self.parent.parent is None: 227 227 return 228 msg = "Slit Length Calculator: %s" % (sys.exc_ value)228 msg = "Slit Length Calculator: %s" % (sys.exc_info()[1]) 229 229 wx.PostEvent(self.parent.parent, 230 230 StatusEvent(status=msg, type='stop')) … … 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) … … 269 269 if self.parent.parent is None: 270 270 return 271 msg = "Slit Size Calculator: %s" % (sys.exc_ value)271 msg = "Slit Size Calculator: %s" % (sys.exc_info()[1]) 272 272 wx.PostEvent(self.parent.parent, 273 273 StatusEvent(status=msg, type='stop'))
Note: See TracChangeset
for help on using the changeset viewer.