Changes in / [a3c59503:d00475d] in sasview
- Files:
-
- 2 added
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
build_tools/conda_qt5_min_osx.yml
r16417bb rc18ca00 15 15 - pytest 16 16 - mako 17 - pyinstaller 17 - pyinstaller=3.3.1 18 18 - pyopencl 19 19 - testpath=0.3.1 -
build_tools/conda_qt5_win.yml
r16417bb r7ecece1 17 17 - pytest 18 18 - mako 19 - pyinstaller 19 - pyinstaller=3.3.1 20 20 - pyopencl 21 21 - testpath=0.3.1 -
src/sas/qtgui/MainWindow/DataExplorer.py
ra3c59503 r6bc0840 1470 1470 self.manager.update_stored_data(deleted_names) 1471 1471 1472 def closeAllPlots(self): 1473 """ 1474 Close all currently displayed plots 1475 """ 1476 1477 for plot_id in PlotHelper.currentPlots(): 1478 try: 1479 plotter = PlotHelper.plotById(plot_id) 1480 plotter.close() 1481 self.plot_widgets[plot_id].close() 1482 self.plot_widgets.pop(plot_id, None) 1483 except AttributeError as ex: 1484 logging.error("Closing of %s failed:\n %s" % (plot_id, str(ex))) 1485 1472 1486 def closePlotsForItem(self, item): 1473 1487 """ -
src/sas/qtgui/MainWindow/GuiManager.py
ra3c59503 r8748751 24 24 from sas.qtgui.Utilities.PluginManager import PluginManager 25 25 from sas.qtgui.Utilities.GridPanel import BatchOutputPanel 26 from sas.qtgui.Utilities.ResultPanel import ResultPanel 26 27 27 28 from sas.qtgui.Utilities.ReportDialog import ReportDialog … … 147 148 self.aboutWidget = AboutBox() 148 149 self.categoryManagerWidget = CategoryManager(self._parent, manager=self) 150 149 151 self.grid_window = None 150 152 self.grid_window = BatchOutputPanel(parent=self) … … 154 156 self.grid_subwindow.setVisible(False) 155 157 self.grid_window.windowClosedSignal.connect(lambda: self.grid_subwindow.setVisible(False)) 158 159 self.results_panel = ResultPanel(parent=self._parent, manager=self) 160 self.results_frame = self._workspace.workspace.addSubWindow(self.results_panel) 161 self.results_frame.setVisible(False) 162 self.results_panel.windowClosedSignal.connect(lambda: self.results_frame.setVisible(False)) 156 163 157 164 self._workspace.toolBar.setVisible(LocalConfig.TOOLBAR_SHOW) … … 443 450 """ 444 451 # disable not yet fully implemented actions 445 #self._workspace.actionOpen_Analysis.setVisible(False)446 452 self._workspace.actionUndo.setVisible(False) 447 453 self._workspace.actionRedo.setVisible(False) … … 450 456 self._workspace.actionImage_Viewer.setVisible(False) 451 457 self._workspace.actionCombine_Batch_Fit.setVisible(False) 452 self._workspace.actionFit_Results.setVisible(False)453 458 # orientation viewer set to invisible SASVIEW-1132 454 459 self._workspace.actionOrientation_Viewer.setVisible(False) … … 510 515 self._workspace.actionNext.triggered.connect(self.actionNext) 511 516 self._workspace.actionPrevious.triggered.connect(self.actionPrevious) 517 self._workspace.actionClosePlots.triggered.connect(self.actionClosePlots) 512 518 # Analysis 513 519 self._workspace.actionFitting.triggered.connect(self.actionFitting) … … 524 530 525 531 self.communicate.sendDataToGridSignal.connect(self.showBatchOutput) 532 self.communicate.resultPlotUpdateSignal.connect(self.showFitResults) 526 533 527 534 #============ FILE ================= … … 853 860 """ 854 861 """ 855 print("actionFit_Results TRIGGERED") 856 pass 862 self.showFitResults(None) 863 864 def showFitResults(self, output_data): 865 """ 866 Show bumps convergence plots 867 """ 868 self.results_frame.setVisible(True) 869 if output_data: 870 self.results_panel.onPlotResults(output_data) 857 871 858 872 def actionAdd_Custom_Model(self): … … 945 959 """ 946 960 self._workspace.workspace.activatePreviousSubWindow() 961 962 def actionClosePlots(self): 963 """ 964 Closes all Plotters and Plotter2Ds. 965 """ 966 self.filesWidget.closeAllPlots() 967 pass 947 968 948 969 #============ HELP ================= -
src/sas/qtgui/MainWindow/MainWindow.py
rb14db78 r33812c3 6 6 from PyQt5.QtWidgets import QApplication 7 7 from PyQt5.QtGui import QPixmap 8 from PyQt5.QtCore import Qt 8 9 import os 9 10 import sys … … 58 59 splash = SplashScreen() 59 60 splash.show() 60 61 app.setAttribute(Qt.AA_EnableHighDpiScaling) 61 62 # fix for pyinstaller packages app to avoid ReactorAlreadyInstalledError 62 63 import sys -
src/sas/qtgui/MainWindow/UI/MainWindowUI.ui
refaf022 r6bc0840 25 25 <y>0</y> 26 26 <width>915</width> 27 <height>2 1</height>27 <height>26</height> 28 28 </rect> 29 29 </property> … … 128 128 <addaction name="actionPrevious"/> 129 129 <addaction name="separator"/> 130 <addaction name="actionClosePlots"/> 130 131 </widget> 131 132 <widget class="QMenu" name="menuAnalysis"> … … 571 572 </property> 572 573 </action> 574 <action name="actionClosePlots"> 575 <property name="text"> 576 <string>Close All Plots</string> 577 </property> 578 </action> 573 579 </widget> 574 580 <resources/> -
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
rb8dccb8 r75906a1 1573 1573 if param_dict is None: 1574 1574 return 1575 if hasattr(res, 'convergence') and len(res.convergence)>0: 1576 self.communicate.resultPlotUpdateSignal.emit(result[0]) 1575 1577 1576 1578 elapsed = result[1] … … 2333 2335 max_column = self.lstParams.itemDelegate().param_max 2334 2336 if model_column == param_column: 2335 self.kernel_module.setParam(parameter_name, value) 2337 # don't try to update multiplicity counters if they aren't there. 2338 # Note that this will fail for proper bad update where the model 2339 # doesn't contain multiplicity parameter 2340 if parameter_name != self.kernel_module.multiplicity_info.control: 2341 self.kernel_module.setParam(parameter_name, value) 2336 2342 elif model_column == min_column: 2337 2343 # min/max to be changed in self.kernel_module.details[parameter_name] = ['Ang', 0.0, inf] … … 3373 3379 else: 3374 3380 index = self.theory_item 3381 params = FittingUtilities.getStandardParam(self._model_model) 3375 3382 report_logic = ReportPageLogic(self, 3376 3383 kernel_module=self.kernel_module, 3377 3384 data=self.data, 3378 3385 index=index, 3379 model=self._model_model)3386 params=params) 3380 3387 3381 3388 return report_logic.reportList() -
src/sas/qtgui/Perspectives/Fitting/ReportPageLogic.py
r085ee014 r75906a1 13 13 14 14 import sas.qtgui.Utilities.GuiUtils as GuiUtils 15 from sas.qtgui.Perspectives.Fitting import FittingUtilities16 15 17 16 class ReportPageLogic(object): … … 19 18 Logic for the Report Page functionality. Refactored from FittingWidget. 20 19 """ 21 def __init__(self, parent=None, kernel_module=None, data=None, index=None, model=None):20 def __init__(self, parent=None, kernel_module=None, data=None, index=None, params=None): 22 21 23 22 self.parent = parent … … 25 24 self.data = data 26 25 self._index = index 27 self. model = model26 self.params = params 28 27 29 28 @staticmethod … … 119 118 Look at widget state and extract parameters 120 119 """ 121 pars = FittingUtilities.getStandardParam(self.model) 122 if pars is None: 120 if self.params is None: 123 121 return "" 124 122 125 123 report = "" 126 124 plus_minus = " ± " 127 for value in pars:125 for value in self.params: 128 126 try: 129 127 par_name = value[1] -
src/sas/qtgui/Perspectives/Inversion/InversionPerspective.py
r6ae7466 raed159f 473 473 self._calculator.set_qmax(qmax) 474 474 if np.size(self.logic.data.dy) == 0 or np.all(self.logic.data.dy) == 0: 475 self. logic.data.dy = self._calculator.add_errors(self.logic.data.y)475 self._calculator.add_errors() 476 476 self.updateDataList(data) 477 477 self.populateDataComboBox(self.logic.data.filename, data) -
src/sas/qtgui/Plotting/Binder.py
rcee5c78 r75906a1 233 233 """ 234 234 # TODO: sort by zorder of axes then by zorder within axes 235 #self._artists.sort(cmp=lambda x, y: cmp(y.zorder, x.zorder))236 #self._artists.sort(cmp=lambda x, y: y.zorder.__gt__(x.zorder))237 235 found = Selection() 236 self._artists.sort(key=lambda x: x.zorder, reverse=True) 238 237 for artist in self._artists: 239 238 # TODO: should contains() return false if invisible? -
src/sas/qtgui/Plotting/ColorMap.py
rd6b8a1d r8fad50b 8 8 9 9 import matplotlib as mpl 10 from matplotlib import pylab11 10 import numpy 12 11 … … 32 31 self.data = data 33 32 self._cmap_orig = self._cmap = cmap if cmap is not None else DEFAULT_MAP 34 self.all_maps = [m for m in pylab.cm.datad]33 self.all_maps = [m for m in mpl.cm.datad] 35 34 self.maps = sorted(m for m in self.all_maps if not m.endswith("_r")) 36 35 self.rmaps = sorted(set(self.all_maps) - set(self.maps)) -
src/sas/qtgui/Plotting/ConvertUnits.py
rb8080e1 r75906a1 10 10 """ 11 11 if power != 0: 12 if unit.find("^") != -1: # if the unit contains a power er^13 toks = re.split( "\^", unit)12 if unit.find("^") != -1: # if the unit contains a power ^ 13 toks = re.split(r"\^", unit) 14 14 if toks[0].find("/") != -1 or \ 15 15 toks[0].find("-") != -1: -
src/sas/qtgui/Plotting/Plotter2D.py
r2f55df6 r8fad50b 1 1 import copy 2 2 import numpy 3 import pylab4 3 import functools 5 4 import logging … … 9 8 from PyQt5 import QtWidgets 10 9 11 DEFAULT_CMAP = pylab.cm.jet12 10 13 11 #import sys … … 15 13 import matplotlib as mpl 16 14 mpl.use("Qt5Agg") 15 DEFAULT_CMAP = mpl.cm.jet 17 16 18 17 from mpl_toolkits.mplot3d import Axes3D -
src/sas/qtgui/Plotting/PlotterBase.py
r34f13a83 r8fad50b 1 import pylab2 1 import numpy 3 2 … … 10 9 11 10 import matplotlib.pyplot as plt 11 import matplotlib as mpl 12 12 from matplotlib import rcParams 13 13 14 DEFAULT_CMAP = pylab.cm.jet14 DEFAULT_CMAP = mpl.cm.jet 15 15 from sas.qtgui.Plotting.Binder import BindArtist 16 16 from sas.qtgui.Plotting.PlotterData import Data1D -
src/sas/qtgui/Plotting/Slicers/AzimutSlicer.py
re20870bc r75906a1 137 137 sector = sect(self.base.data2D) 138 138 139 from sas. sasgui.guiframe.dataFittingimport Data1D139 from sas.qtgui.Plotting.PlotterData import Data1D 140 140 if hasattr(sector, "dxl"): 141 141 dxl = sector.dxl -
src/sas/qtgui/Utilities/CategoryInstaller.py
rc889a3e r75906a1 26 26 def __init__(self): 27 27 """ initialization """ 28 29 @staticmethod30 def _get_installed_model_dir():31 """32 returns the dir where installed_models.txt should be33 """34 import sas.sascalc.dataloader.readers35 return sas.sascalc.dataloader.readers.get_data_path()36 37 @staticmethod38 def _get_models_py_dir():39 """40 returns the dir where models.py should be41 """42 import sas.sasgui.perspectives.fitting.models43 return sas.sasgui.perspectives.fitting.models.get_model_python_path()44 45 @staticmethod46 def _get_default_cat_file_dir():47 """48 returns the dir where default_cat.j should be49 """50 # The default categories file is usually found with the code, except51 # when deploying using py2app (it will be in Contents/Resources), or52 # py2exe (it will be in the exec dir).53 import sas.sasview54 cat_file = "default_categories.json"55 56 possible_cat_file_paths = [57 os.path.join(os.path.split(sas.sasview.__file__)[0], cat_file), # Source58 os.path.join(os.path.dirname(sys.executable), '..', 'Resources', cat_file), # Mac59 os.path.join(os.path.dirname(sys.executable), cat_file) # Windows60 ]61 62 for path in possible_cat_file_paths:63 if os.path.isfile(path):64 return os.path.dirname(path)65 66 raise RuntimeError('CategoryInstaller: Could not find folder containing default categories')67 28 68 29 @staticmethod -
src/sas/qtgui/Utilities/GridPanel.py
ra4b9b7a r75906a1 491 491 """ 492 492 location = GuiUtils.HELP_DIRECTORY_LOCATION 493 url = "/user/ sasgui/perspectives/pr/pr_help.html#batch-pr-mode"493 url = "/user/qtgui/Perspectives/Fitting/fitting_help.html#batch-fit-mode" 494 494 try: 495 495 webbrowser.open('file://' + os.path.realpath(location + url)) -
src/sas/qtgui/Utilities/GuiUtils.py
r2eeda93 raed159f 106 106 except ImportError: 107 107 pass 108 #logging.error("Error loading %s/%s: %s" % (path, confg_file, sys.exc_value))109 108 except ValueError: 110 109 print("Value error") … … 113 112 if fObj is not None: 114 113 fObj.close() 115 #logging.info("GuiManager loaded %s/%s" % (path, confg_file))116 114 return config_module 117 115 … … 294 292 changeDataExplorerTabSignal = QtCore.pyqtSignal(int) 295 293 296 def updateModelItemWithPlot(item, update_data, name="", checkbox_state=None): 294 # Plot fitting results (FittingWidget->GuiManager) 295 resultPlotUpdateSignal = QtCore.pyqtSignal(list) 296 297 297 """ 298 298 Adds a checkboxed row named "name" to QStandardItem -
src/sas/sascalc/pr/fit/expression.py
r1431dab raed159f 209 209 """%("\n ".join(assignments),"\n ".join(code)) 210 210 211 #print("Function: "+functiondef) 212 exec(functiondef) in globals, locals 211 exec(functiondef, globals, locals) 213 212 retfn = locals['eval_expressions'] 214 213 -
src/sas/sascalc/pr/invertor.py
reeea6a3 raed159f 227 227 return None 228 228 229 def add_errors(self, yvalues): 230 """ 231 Adds errors to data set is they are not avaialble 232 :return: 233 """ 234 stats_errors = np.zeros(len(yvalues)) 235 for i in range(len(yvalues)): 236 # Scale the error so that we can fit over several decades of Q 237 scale = 0.05 * np.sqrt(yvalues[i]) 238 min_err = 0.01 * yvalues[i] 239 stats_errors[i] = scale * np.sqrt(np.fabs(yvalues[i])) + min_err 240 logger.warning("Simulated errors have been added to the data set\n") 241 return stats_errors 229 def add_errors(self, sigma=0.05): 230 """ 231 Adds errors to data set is they are not available. 232 Uses $\Delta y = \sigma | y |$. 233 """ 234 self.dy = sigma * np.fabs(self.y) 242 235 243 236 def clone(self): … … 514 507 # We were not able to estimate the errors 515 508 # Return an empty error matrix 516 logger.error(sys.exc_ value)509 logger.error(sys.exc_info()[1]) 517 510 518 511 # Keep a copy of the last output … … 559 552 # number of terms 560 553 best_alpha, _, _ = self.estimate_alpha(self.nfunc) 561 logger.warning("Invertor.estimate_numterms: %s" % sys.exc_ value)554 logger.warning("Invertor.estimate_numterms: %s" % sys.exc_info()[1]) 562 555 return self.nfunc, best_alpha, "Could not estimate number of terms" 563 556 … … 646 639 647 640 except: 648 message = "Invertor.estimate_alpha: %s" % sys.exc_ value641 message = "Invertor.estimate_alpha: %s" % sys.exc_info()[1] 649 642 return 0, message, elapsed 650 643 … … 763 756 764 757 except: 765 msg = "Invertor.from_file: corrupted file\n%s" % sys.exc_ value758 msg = "Invertor.from_file: corrupted file\n%s" % sys.exc_info()[1] 766 759 raise RuntimeError(msg) 767 760 else:
Note: See TracChangeset
for help on using the changeset viewer.