From 73d28ec507f0a785c1cd77f73abc07eea44d73b3 Mon Sep 17 00:00:00 2001 From: krzywon Date: Tue, 8 Oct 2024 14:46:54 -0400 Subject: [PATCH 1/6] Include james in the contributors list --- build_tools/contributors.tsv | 1 + 1 file changed, 1 insertion(+) diff --git a/build_tools/contributors.tsv b/build_tools/contributors.tsv index 7a4931b285..45af4705f9 100644 --- a/build_tools/contributors.tsv +++ b/build_tools/contributors.tsv @@ -17,6 +17,7 @@ Cho, Jae-Hie "University of Tennessee, Knoxville" x None Cooper-Benun, Torin ISIS Neutron and Muon Source x None Cortes Hernandez, R University of Tennessee, Knoxville x None Corona, Patrick University of California, Santa Barbara x None +Crake-Merani, James ISIS Neutron and Muon Source x 0009-0003-1736-5567 None Doucet, Mathieu Oak Ridge National Laboratory x 0000-0002-5560-6478 None Doutch, James ISIS Neutron and Muon Source x None Dresen, Dominique University of Cologne x None From 9e3cd58c757c312f1805e293c77bf6bff804b55f Mon Sep 17 00:00:00 2001 From: James Crake-Merani Date: Fri, 23 Aug 2024 09:49:58 +0100 Subject: [PATCH 2/6] Set the parent of whatsnew correctly. Whatsnew's parent should be the mainwindow, not the gui manager. Also whatsnew is not passing on its parent to the QDialog super class. --- src/sas/qtgui/MainWindow/GuiManager.py | 4 ++-- src/sas/qtgui/Utilities/WhatsNew/WhatsNew.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sas/qtgui/MainWindow/GuiManager.py b/src/sas/qtgui/MainWindow/GuiManager.py index 4d745f162c..2a2983fba5 100644 --- a/src/sas/qtgui/MainWindow/GuiManager.py +++ b/src/sas/qtgui/MainWindow/GuiManager.py @@ -208,7 +208,7 @@ def addWidgets(self): self.GENSASCalculator = None self.DataOperation = DataOperationUtilityPanel(self) self.FileConverter = FileConverterWidget(self) - self.WhatsNew = WhatsNew(self) + self.WhatsNew = WhatsNew(self._parent) self.regenProgress = DocRegenProgress(self) def loadAllPerspectives(self): @@ -675,7 +675,7 @@ def actionWelcome(self): self.welcomePanel.show() def actionWhatsNew(self): - self.WhatsNew = WhatsNew(strictly_newer=False) + self.WhatsNew = WhatsNew(self._parent, strictly_newer=False) self.WhatsNew.show() def showWelcomeMessage(self): diff --git a/src/sas/qtgui/Utilities/WhatsNew/WhatsNew.py b/src/sas/qtgui/Utilities/WhatsNew/WhatsNew.py index a3c5ad1ce5..7c7be3da94 100644 --- a/src/sas/qtgui/Utilities/WhatsNew/WhatsNew.py +++ b/src/sas/qtgui/Utilities/WhatsNew/WhatsNew.py @@ -97,7 +97,7 @@ class WhatsNew(QDialog): """ def __init__(self, parent=None, strictly_newer=True): - super().__init__() + super().__init__(parent) self.setWindowTitle(f"What's New in SasView {sasview_version}") From ebada3b6af28939cf108b906c8969aca4c8511a1 Mon Sep 17 00:00:00 2001 From: krzywon Date: Wed, 9 Oct 2024 15:52:25 -0400 Subject: [PATCH 3/6] Remove NaNs from any resulting fit, regardless of the source to ensure resulting data is plottable --- src/sas/qtgui/Perspectives/Fitting/FittingWidget.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/sas/qtgui/Perspectives/Fitting/FittingWidget.py b/src/sas/qtgui/Perspectives/Fitting/FittingWidget.py index 6d90857798..3942cdc4f2 100644 --- a/src/sas/qtgui/Perspectives/Fitting/FittingWidget.py +++ b/src/sas/qtgui/Perspectives/Fitting/FittingWidget.py @@ -83,6 +83,7 @@ def get_weights(self: Any, name: str) -> Tuple[np.ndarray, np.ndarray]: logger = logging.getLogger(__name__) + class ToolTippedItemModel(QtGui.QStandardItemModel): """ Subclass from QStandardItemModel to allow displaying tooltips in @@ -3116,6 +3117,12 @@ def createTheoryIndex(self, fitted_data): Create a QStandardModelIndex containing model data """ name = self.nameFromData(fitted_data) + # TODO: Temporary Hack to fix NaNs in generated theory data + # This is usually from GSC models that are calculated outside the Q range they were created for + # The 'remove_nans_in_data' should become its own function in a data utility class, post-6.0.0 release. + from sasdata.dataloader.filereader import FileReader + temp_reader = FileReader() + fitted_data = temp_reader._remove_nans_in_data(fitted_data) # Modify the item or add it if new theory_item = GuiUtils.createModelItemWithPlot(fitted_data, name=name) self.communicate.updateTheoryFromPerspectiveSignal.emit(theory_item) From 49ff47e1541b9296a07853b6a8876142408d24e7 Mon Sep 17 00:00:00 2001 From: krzywon Date: Wed, 9 Oct 2024 16:02:20 -0400 Subject: [PATCH 4/6] Use tags instead of release branches for sasdata and sasmodels --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d384c9285e..d8e2673855 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -105,8 +105,8 @@ jobs: - name: Fetch sources for sibling projects run: | - git clone --depth=50 --branch=release_0.9.0 https://github.com/SasView/sasdata.git ../sasdata - git clone --depth=50 --branch=release_1.0.8 https://github.com/SasView/sasmodels.git ../sasmodels + git clone --depth=50 --branch=v0.9.0 https://github.com/SasView/sasdata.git ../sasdata + git clone --depth=50 --branch=v1.0.8 https://github.com/SasView/sasmodels.git ../sasmodels git clone --depth=50 --branch=v0.9.2 https://github.com/bumps/bumps.git ../bumps - name: Build and install sasdata From 86c689fd3deecf686e161a0df80bea00efe49cc8 Mon Sep 17 00:00:00 2001 From: krzywon Date: Fri, 11 Oct 2024 08:54:49 -0400 Subject: [PATCH 5/6] Get fitting optimizer from config, not predefined value (I swear I did this before...) --- src/sas/qtgui/Perspectives/Fitting/FittingPerspective.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/sas/qtgui/Perspectives/Fitting/FittingPerspective.py b/src/sas/qtgui/Perspectives/Fitting/FittingPerspective.py index 09fb8fcc3f..0a2ada7830 100644 --- a/src/sas/qtgui/Perspectives/Fitting/FittingPerspective.py +++ b/src/sas/qtgui/Perspectives/Fitting/FittingPerspective.py @@ -8,7 +8,8 @@ from PySide6 import QtWidgets from bumps import options -from bumps import fitters + +from sas.system.config import config import sas.qtgui.Utilities.ObjectLibrary as ObjectLibrary import sas.qtgui.Utilities.GuiUtils as GuiUtils @@ -50,9 +51,6 @@ def __init__(self, parent=None, data=None): # Max index for adding new, non-clashing tab names self.maxIndex = 1 - # The default optimizer - self.optimizer = 'Levenberg-Marquardt' - # Dataset index -> Fitting tab mapping self.dataToFitTab = {} @@ -79,7 +77,8 @@ def __init__(self, parent=None, data=None): # Fit options - uniform for all tabs self.fit_options = options.FIT_CONFIG self.fit_options_widget = FittingOptions(config=self.fit_options) - self.fit_options.selected_id = fitters.MPFit.id + self.fit_options.selected_id = config.config.FITTING_DEFAULT_OPTIMIZER + self.optimizer = self.fit_options.selected_name # Listen to GUI Manager signal updating fit options self.fit_options_widget.fit_option_changed.connect(self.onFittingOptionsChange) From 3dfbb596a1c0a854ad328ddc92717862484d6cdd Mon Sep 17 00:00:00 2001 From: krzywon Date: Fri, 11 Oct 2024 13:12:03 -0400 Subject: [PATCH 6/6] Add status bar message when GSC opens waring users it may be behind the main window. --- src/sas/qtgui/MainWindow/GuiManager.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sas/qtgui/MainWindow/GuiManager.py b/src/sas/qtgui/MainWindow/GuiManager.py index 2a2983fba5..e2ea5945f3 100644 --- a/src/sas/qtgui/MainWindow/GuiManager.py +++ b/src/sas/qtgui/MainWindow/GuiManager.py @@ -1063,6 +1063,8 @@ def actionGeneric_Scattering_Calculator(self): if self.GENSASCalculator is None: self.GENSASCalculator = GenericScatteringCalculator(self) self.GENSASCalculator.show() + self.updateStatusBar("The Generic Scattering Calculator is open, but it sometimes opens behind the main " + "window.") except Exception as ex: logging.error(str(ex)) return