From 86c689fd3deecf686e161a0df80bea00efe49cc8 Mon Sep 17 00:00:00 2001 From: krzywon Date: Fri, 11 Oct 2024 08:54:49 -0400 Subject: [PATCH] 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)