Changeset dc5ef15 in sasview for src/sas/qtgui/Perspectives/Fitting


Ignore:
Timestamp:
May 18, 2017 5:36:57 AM (8 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
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:
6066a3f
Parents:
2a432e7
Message:

Removed qtgui dependency on sasgui and wx SASVIEW-590

Location:
src/sas/qtgui/Perspectives/Fitting
Files:
2 added
10 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Fitting/FittingLogic.py

    r2add354 rdc5ef15  
    11import numpy as np 
    22 
    3 from sas.sasgui.guiframe.dataFitting import Data1D 
    4 from sas.sasgui.guiframe.dataFitting import Data2D 
     3from sas.qtgui.Plotting.PlotterData import Data1D 
     4from sas.qtgui.Plotting.PlotterData import Data2D 
     5 
    56from sas.sascalc.dataloader.data_info import Detector 
    67from sas.sascalc.dataloader.data_info import Source 
  • src/sas/qtgui/Perspectives/Fitting/FittingPerspective.py

    r1bc27f1 rdc5ef15  
    77 
    88from sas.qtgui.Perspectives.Fitting.FittingWidget import FittingWidget 
    9 #from FitPage import FitPage 
    109 
    1110class FittingWindow(QtGui.QTabWidget): 
  • src/sas/qtgui/Perspectives/Fitting/FittingUtilities.py

    r1bc27f1 rdc5ef15  
    66import numpy 
    77 
    8 from sas.sasgui.guiframe.dataFitting import Data1D 
    9 from sas.sasgui.guiframe.dataFitting import Data2D 
     8from sas.qtgui.Plotting.PlotterData import Data1D 
     9from sas.qtgui.Plotting.PlotterData import Data2D 
    1010 
    1111def replaceShellName(param_name, value): 
     
    363363    return [i >> d & 1 for d in xrange(digits)] 
    364364 
     365def getWeight(data, is2d, flag=None): 
     366    """ 
     367    Received flag and compute error on data. 
     368    :param flag: flag to transform error of data. 
     369    """ 
     370    weight = None 
     371    if is2d: 
     372        dy_data = data.err_data 
     373        data = data.data 
     374    else: 
     375        dy_data = data.dy 
     376        data = data.y 
     377 
     378    if flag == 0: 
     379        weight = numpy.ones_like(data) 
     380    elif flag == 1: 
     381        weight = dy_data 
     382    elif flag == 2: 
     383        weight = numpy.sqrt(numpy.abs(data)) 
     384    elif flag == 3: 
     385        weight = numpy.abs(data) 
     386    return weight 
  • src/sas/qtgui/Perspectives/Fitting/FittingWidget.py

    r2a432e7 rdc5ef15  
    1717from sasmodels.sasview_model import load_standard_models 
    1818from sas.sascalc.fit.BumpsFitting import BumpsFit as Fit 
    19 from sas.sasgui.perspectives.fitting.fit_thread import FitThread 
    20  
    21 from sas.sasgui.guiframe.CategoryInstaller import CategoryInstaller 
    22 from sas.sasgui.guiframe.dataFitting import Data1D 
    23 from sas.sasgui.guiframe.dataFitting import Data2D 
     19 
    2420import sas.qtgui.Utilities.GuiUtils as GuiUtils 
    25 from sas.sasgui.perspectives.fitting.model_thread import Calc1D 
    26 from sas.sasgui.perspectives.fitting.model_thread import Calc2D 
    27 from sas.sasgui.perspectives.fitting.utils import get_weight 
     21from sas.qtgui.Utilities.CategoryInstaller import CategoryInstaller 
     22from sas.qtgui.Plotting.PlotterData import Data1D 
     23from sas.qtgui.Plotting.PlotterData import Data2D 
    2824 
    2925from sas.qtgui.Perspectives.Fitting.UI.FittingWidgetUI import Ui_FittingWidgetUI 
     26from sas.qtgui.Perspectives.Fitting.FitThread import FitThread 
     27from sas.qtgui.Perspectives.Fitting.ModelThread import Calc1D 
     28from sas.qtgui.Perspectives.Fitting.ModelThread import Calc2D 
    3029from sas.qtgui.Perspectives.Fitting.FittingLogic import FittingLogic 
    3130from sas.qtgui.Perspectives.Fitting import FittingUtilities 
     
    815814        """ 
    816815        # Send original data for weighting 
    817         weight = get_weight(data=data, is2d=self.is2D, flag=self.weighting) 
     816        weight = FittingUtilities.getWeight(data=data, is2d=self.is2D, flag=self.weighting) 
    818817        update_module = data.err_data if self.is2D else data.dy 
    819818        update_module = weight 
  • src/sas/qtgui/Perspectives/Fitting/OptionsWidget.py

    r1bc27f1 rdc5ef15  
    66from PyQt4 import QtCore 
    77 
    8 from sas.sasgui.guiframe.dataFitting import Data2D 
     8from sas.qtgui.Plotting.PlotterData import Data2D 
    99 
    1010# Local UI 
  • src/sas/qtgui/Perspectives/Fitting/SmearingWidget.py

    r1bc27f1 rdc5ef15  
    55from PyQt4 import QtCore 
    66 
    7 from sas.sasgui.guiframe.dataFitting import Data1D 
    8 from sas.sasgui.guiframe.dataFitting import Data2D 
     7from sas.qtgui.Plotting.PlotterData import Data1D 
     8from sas.qtgui.Plotting.PlotterData import Data2D 
    99 
    1010# Local UI 
  • src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingLogicTest.py

    r83eb5208 rdc5ef15  
    1111from sas.qtgui.Utilities.GuiUtils import * 
    1212from sas.qtgui.Perspectives.Fitting.FittingWidget import * 
    13 from sas.sasgui.guiframe.dataFitting import Data1D 
     13from sas.qtgui.Plotting.PlotterData import Data1D 
    1414 
    1515app = QtGui.QApplication(sys.argv) 
  • src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingPerspectiveTest.py

    r1bc27f1 rdc5ef15  
    1313# Local 
    1414import sas.qtgui.Utilities.GuiUtils as GuiUtils 
    15 from sas.sasgui.guiframe.dataFitting import Data1D 
    16  
     15from sas.qtgui.Plotting.PlotterData import Data1D 
    1716from sas.qtgui.Perspectives.Fitting.FittingPerspective import FittingWindow 
    1817 
  • src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingUtilitiesTest.py

    r9208346 rdc5ef15  
    33from PyQt4 import QtGui 
    44 
    5 from sas.sasgui.guiframe.dataFitting import Data1D 
    6 from sas.sasgui.guiframe.dataFitting import Data2D 
     5from sas.qtgui.Plotting.PlotterData import Data1D 
     6from sas.qtgui.Plotting.PlotterData import Data2D 
    77 
    88from UnitTesting.TestUtils import WarningTestNotImplemented 
  • src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingWidgetTest.py

    r2241130 rdc5ef15  
    1717from sas.qtgui.UnitTesting.TestUtils import QtSignalSpy 
    1818 
    19 from sas.sasgui.guiframe.dataFitting import Data1D 
    20 from sas.sasgui.guiframe.dataFitting import Data2D 
     19from sas.qtgui.Plotting.PlotterData import Data1D 
     20from sas.qtgui.Plotting.PlotterData import Data2D 
    2121 
    2222app = QtGui.QApplication(sys.argv) 
Note: See TracChangeset for help on using the changeset viewer.