Skip to content

Commit

Permalink
Merge pull request #3122 from SasView/6.0.0-final-fixes
Browse files Browse the repository at this point in the history
6.0.0: Final Fixes
  • Loading branch information
krzywon authored Oct 16, 2024
2 parents 17ea162 + 3dfbb59 commit 5326cb0
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions build_tools/contributors.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions src/sas/qtgui/MainWindow/GuiManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down
9 changes: 4 additions & 5 deletions src/sas/qtgui/Perspectives/Fitting/FittingPerspective.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = {}

Expand All @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/sas/qtgui/Utilities/WhatsNew/WhatsNew.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")

Expand Down

0 comments on commit 5326cb0

Please sign in to comment.