Changeset dc5ef15 in sasview
- Timestamp:
- May 18, 2017 5:36:57 AM (8 years ago)
- 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
- Files:
-
- 24 added
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
sasview/local_config.py
r9687d58 rdc5ef15 4 4 import time 5 5 import os 6 from sas.sasgui.guiframe.gui_style import GUIFRAME6 #from sas.sasgui.guiframe.gui_style import GUIFRAME 7 7 import sas.sasview 8 8 import logging … … 108 108 SPLASH_SCREEN_PATH = os.path.join(icon_path, "SVwelcome_mini.png") 109 109 TUTORIAL_PATH = os.path.join(media_path, "Tutorial.pdf") 110 DEFAULT_STYLE = GUIFRAME.MULTIPLE_APPLICATIONS|GUIFRAME.MANAGER_ON\111 |GUIFRAME.CALCULATOR_ON|GUIFRAME.TOOLBAR_ON110 #DEFAULT_STYLE = GUIFRAME.MULTIPLE_APPLICATIONS|GUIFRAME.MANAGER_ON\ 111 # |GUIFRAME.CALCULATOR_ON|GUIFRAME.TOOLBAR_ON 112 112 SPLASH_SCREEN_WIDTH = 512 113 113 SPLASH_SCREEN_HEIGHT = 366 -
src/sas/qtgui/Calculators/GenericScatteringCalculator.py
r28a09b0 rdc5ef15 8 8 from PyQt4 import QtCore 9 9 from twisted.internet import threads 10 from mpl_toolkits.mplot3d import Axes3D 10 11 11 12 import sas.qtgui.Utilities.GuiUtils as GuiUtils 12 13 13 from sas.sasgui.perspectives.calculator.load_thread import GenReader 14 from sas.qtgui.Utilities.GenericReader import GenReader 15 14 16 from sas.sascalc.dataloader.data_info import Detector 15 17 from sas.sascalc.dataloader.data_info import Source 16 18 from sas.sascalc.calculator import sas_gen 17 19 18 from mpl_toolkits.mplot3d import Axes3D20 from sas.qtgui.Plotting.Arrow3D import Arrow3D 19 21 from sas.qtgui.Plotting.PlotterBase import PlotterBase 20 from sas.sasgui.guiframe.dataFitting import Data2D21 22 from sas.qtgui.Plotting.Plotter2D import Plotter2D 22 from sas.sasgui.guiframe.dataFitting import Data1D23 23 from sas.qtgui.Plotting.Plotter import Plotter 24 from sas.sasgui.plottools.arrow3d import Arrow3D 24 from sas.qtgui.Plotting.PlotterData import Data1D 25 from sas.qtgui.Plotting.PlotterData import Data2D 25 26 26 27 # Local UI -
src/sas/qtgui/Calculators/UnitTesting/GenericScatteringCalculatorTest.py
r0a6e097 rdc5ef15 19 19 from sas.qtgui.Calculators.GenericScatteringCalculator import Plotter3D 20 20 21 from sas. sasgui.guiframe.data_manager import DataManager21 from sas.qtgui.MainWindow.DataManager import DataManager 22 22 from sas.qtgui.MainWindow.GuiManager import GuiManager 23 23 from sas.qtgui.Utilities.GuiUtils import * -
src/sas/qtgui/MainWindow/DataExplorer.py
rd60da0c rdc5ef15 12 12 from twisted.internet import threads 13 13 14 # SAS 14 # SASCALC 15 15 from sas.sascalc.dataloader.loader import Loader 16 from sas.sasgui.guiframe.data_manager import DataManager 17 from sas.sasgui.guiframe.dataFitting import Data1D 18 from sas.sasgui.guiframe.dataFitting import Data2D 19 16 17 # QTGUI 20 18 import sas.qtgui.Utilities.GuiUtils as GuiUtils 21 19 import sas.qtgui.Plotting.PlotHelper as PlotHelper 20 21 from sas.qtgui.Plotting.PlotterData import Data1D 22 from sas.qtgui.Plotting.PlotterData import Data2D 22 23 from sas.qtgui.Plotting.Plotter import Plotter 23 24 from sas.qtgui.Plotting.Plotter2D import Plotter2D 25 from sas.qtgui.Plotting.MaskEditor import MaskEditor 26 27 from sas.qtgui.MainWindow.DataManager import DataManager 24 28 from sas.qtgui.MainWindow.DroppableDataLoadWidget import DroppableDataLoadWidget 25 from sas.qtgui.Plotting.MaskEditor import MaskEditor26 29 27 30 import sas.qtgui.Perspectives as Perspectives -
src/sas/qtgui/MainWindow/GuiManager.py
r2a432e7 rdc5ef15 11 11 12 12 from twisted.internet import reactor 13 13 14 # General SAS imports 14 15 from sas.sasgui.guiframe.data_manager import DataManager 16 from sas.sasgui.guiframe.proxy import Connection 15 from sas.qtgui.Utilities.ConnectionProxy import ConnectionProxy 17 16 from sas.qtgui.Utilities.SasviewLogger import XStream 18 17 from sas.qtgui.Utilities.IPythonWidget import IPythonWidget … … 24 23 from sas.qtgui.MainWindow.AboutBox import AboutBox 25 24 from sas.qtgui.MainWindow.WelcomePanel import WelcomePanel 25 from sas.qtgui.MainWindow.DataManager import DataManager 26 26 27 27 from sas.qtgui.Calculators.SldPanel import SldPanel … … 278 278 """ 279 279 version_info = {"version": "0.0.0"} 280 c = Connection (LocalConfig.__update_URL__, LocalConfig.UPDATE_TIMEOUT)280 c = ConnectionProxy(LocalConfig.__update_URL__, LocalConfig.UPDATE_TIMEOUT) 281 281 response = c.connect() 282 282 if response is None: -
src/sas/qtgui/MainWindow/UnitTesting/DataExplorerTest.py
r83eb5208 rdc5ef15 13 13 14 14 # Local 15 from sas. sasgui.guiframe.dataFittingimport Data1D15 from sas.qtgui.Plotting.PlotterData import Data1D 16 16 from sas.sascalc.dataloader.loader import Loader 17 from sas. sasgui.guiframe.data_manager import DataManager17 from sas.qtgui.MainWindow.DataManager import DataManager 18 18 19 19 from sas.qtgui.MainWindow.DataExplorer import DataExplorerWindow -
src/sas/qtgui/Perspectives/Fitting/FittingLogic.py
r2add354 rdc5ef15 1 1 import numpy as np 2 2 3 from sas.sasgui.guiframe.dataFitting import Data1D 4 from sas.sasgui.guiframe.dataFitting import Data2D 3 from sas.qtgui.Plotting.PlotterData import Data1D 4 from sas.qtgui.Plotting.PlotterData import Data2D 5 5 6 from sas.sascalc.dataloader.data_info import Detector 6 7 from sas.sascalc.dataloader.data_info import Source -
src/sas/qtgui/Perspectives/Fitting/FittingPerspective.py
r1bc27f1 rdc5ef15 7 7 8 8 from sas.qtgui.Perspectives.Fitting.FittingWidget import FittingWidget 9 #from FitPage import FitPage10 9 11 10 class FittingWindow(QtGui.QTabWidget): -
src/sas/qtgui/Perspectives/Fitting/FittingUtilities.py
r1bc27f1 rdc5ef15 6 6 import numpy 7 7 8 from sas. sasgui.guiframe.dataFittingimport Data1D9 from sas. sasgui.guiframe.dataFittingimport Data2D8 from sas.qtgui.Plotting.PlotterData import Data1D 9 from sas.qtgui.Plotting.PlotterData import Data2D 10 10 11 11 def replaceShellName(param_name, value): … … 363 363 return [i >> d & 1 for d in xrange(digits)] 364 364 365 def 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 17 17 from sasmodels.sasview_model import load_standard_models 18 18 from 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 24 20 import sas.qtgui.Utilities.GuiUtils as GuiUtils 25 from sas. sasgui.perspectives.fitting.model_thread import Calc1D26 from sas. sasgui.perspectives.fitting.model_thread import Calc2D27 from sas. sasgui.perspectives.fitting.utils import get_weight21 from sas.qtgui.Utilities.CategoryInstaller import CategoryInstaller 22 from sas.qtgui.Plotting.PlotterData import Data1D 23 from sas.qtgui.Plotting.PlotterData import Data2D 28 24 29 25 from sas.qtgui.Perspectives.Fitting.UI.FittingWidgetUI import Ui_FittingWidgetUI 26 from sas.qtgui.Perspectives.Fitting.FitThread import FitThread 27 from sas.qtgui.Perspectives.Fitting.ModelThread import Calc1D 28 from sas.qtgui.Perspectives.Fitting.ModelThread import Calc2D 30 29 from sas.qtgui.Perspectives.Fitting.FittingLogic import FittingLogic 31 30 from sas.qtgui.Perspectives.Fitting import FittingUtilities … … 815 814 """ 816 815 # 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) 818 817 update_module = data.err_data if self.is2D else data.dy 819 818 update_module = weight -
src/sas/qtgui/Perspectives/Fitting/OptionsWidget.py
r1bc27f1 rdc5ef15 6 6 from PyQt4 import QtCore 7 7 8 from sas. sasgui.guiframe.dataFittingimport Data2D8 from sas.qtgui.Plotting.PlotterData import Data2D 9 9 10 10 # Local UI -
src/sas/qtgui/Perspectives/Fitting/SmearingWidget.py
r1bc27f1 rdc5ef15 5 5 from PyQt4 import QtCore 6 6 7 from sas. sasgui.guiframe.dataFittingimport Data1D8 from sas. sasgui.guiframe.dataFittingimport Data2D7 from sas.qtgui.Plotting.PlotterData import Data1D 8 from sas.qtgui.Plotting.PlotterData import Data2D 9 9 10 10 # Local UI -
src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingLogicTest.py
r83eb5208 rdc5ef15 11 11 from sas.qtgui.Utilities.GuiUtils import * 12 12 from sas.qtgui.Perspectives.Fitting.FittingWidget import * 13 from sas. sasgui.guiframe.dataFittingimport Data1D13 from sas.qtgui.Plotting.PlotterData import Data1D 14 14 15 15 app = QtGui.QApplication(sys.argv) -
src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingPerspectiveTest.py
r1bc27f1 rdc5ef15 13 13 # Local 14 14 import sas.qtgui.Utilities.GuiUtils as GuiUtils 15 from sas.sasgui.guiframe.dataFitting import Data1D 16 15 from sas.qtgui.Plotting.PlotterData import Data1D 17 16 from sas.qtgui.Perspectives.Fitting.FittingPerspective import FittingWindow 18 17 -
src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingUtilitiesTest.py
r9208346 rdc5ef15 3 3 from PyQt4 import QtGui 4 4 5 from sas. sasgui.guiframe.dataFittingimport Data1D6 from sas. sasgui.guiframe.dataFittingimport Data2D5 from sas.qtgui.Plotting.PlotterData import Data1D 6 from sas.qtgui.Plotting.PlotterData import Data2D 7 7 8 8 from UnitTesting.TestUtils import WarningTestNotImplemented -
src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingWidgetTest.py
r2241130 rdc5ef15 17 17 from sas.qtgui.UnitTesting.TestUtils import QtSignalSpy 18 18 19 from sas. sasgui.guiframe.dataFittingimport Data1D20 from sas. sasgui.guiframe.dataFittingimport Data2D19 from sas.qtgui.Plotting.PlotterData import Data1D 20 from sas.qtgui.Plotting.PlotterData import Data2D 21 21 22 22 app = QtGui.QApplication(sys.argv) -
src/sas/qtgui/Perspectives/Invariant/InvariantPerspective.py
r83eb5208 rdc5ef15 11 11 # sas-global 12 12 from sas.sascalc.invariant import invariant 13 from sas. sasgui.guiframe.dataFittingimport Data1D13 from sas.qtgui.Plotting.PlotterData import Data1D 14 14 import sas.qtgui.Utilities.GuiUtils as GuiUtils 15 15 -
src/sas/qtgui/Plotting/ColorMap.py
rcd2cc745 rdc5ef15 11 11 12 12 from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas 13 from sas. sasgui.guiframe.dataFittingimport Data2D13 from sas.qtgui.Plotting.PlotterData import Data2D 14 14 from sas.qtgui.Utilities.GuiUtils import formatNumber 15 15 from rangeSlider import RangeSlider -
src/sas/qtgui/Plotting/LinearFit.py
rcd2cc745 rdc5ef15 7 7 from PyQt4 import QtCore 8 8 9 #from sas.sasgui.transform import10 9 from sas.qtgui.Utilities.GuiUtils import formatNumber 11 from sas.sasgui.plottools import fittings 12 from sas. sasgui.plottools import transform13 14 from sas. sasgui.plottools.LineModel import LineModel10 11 from sas.qtgui.Plotting import Fittings 12 from sas.qtgui.Plotting import DataTransform 13 from sas.qtgui.Plotting.LineModel import LineModel 15 14 16 15 # Local UI … … 67 66 self.default_A = self.model.getParam('A') 68 67 self.default_B = self.model.getParam('B') 69 self.cstA = fittings.Parameter(self.model, 'A', self.default_A)70 self.cstB = fittings.Parameter(self.model, 'B', self.default_B)71 self.transform = transform68 self.cstA = Fittings.Parameter(self.model, 'A', self.default_A) 69 self.cstB = Fittings.Parameter(self.model, 'B', self.default_B) 70 self.transform = DataTransform 72 71 73 72 self.setFixedSize(self.minimumSizeHint()) … … 123 122 124 123 # Find the fitting parameters 125 self.cstA = fittings.Parameter(self.model, 'A', self.default_A)126 self.cstB = fittings.Parameter(self.model, 'B', self.default_B)124 self.cstA = Fittings.Parameter(self.model, 'A', self.default_A) 125 self.cstB = Fittings.Parameter(self.model, 'B', self.default_B) 127 126 tempdy = numpy.asarray(tempdy) 128 127 tempdy[tempdy == 0] = 1 … … 132 131 xmax = numpy.log10(xmax) 133 132 134 chisqr, out, cov = fittings.sasfit(self.model,133 chisqr, out, cov = Fittings.sasfit(self.model, 135 134 [self.cstA, self.cstB], 136 135 tempx, tempy, tempdy, … … 193 192 tempy = [numpy.log10(y[i]) 194 193 for i in range(len(x)) if x[i] >= xmin_check] 195 tempdy = [ transform.errToLogX(y[i], 0, dy[i], 0)194 tempdy = [DataTransform.errToLogX(y[i], 0, dy[i], 0) 196 195 for i in range(len(x)) if x[i] >= xmin_check] 197 196 else: 198 197 tempy = map(numpy.log10, y) 199 tempdy = map(lambda t1,t2: transform.errToLogX(t1,0,t2,0),y,dy)198 tempdy = map(lambda t1,t2:DataTransform.errToLogX(t1,0,t2,0),y,dy) 200 199 else: 201 200 tempy = y -
src/sas/qtgui/Plotting/MaskEditor.py
rcd2cc745 rdc5ef15 1 1 from PyQt4 import QtGui 2 2 3 from sas. sasgui.guiframe.dataFittingimport Data2D3 from sas.qtgui.Plotting.PlotterData import Data2D 4 4 5 5 # Local UI -
src/sas/qtgui/Plotting/Plotter.py
r83eb5208 rdc5ef15 7 7 from matplotlib.font_manager import FontProperties 8 8 9 from sas.sasgui.guiframe.dataFitting import Data1D 9 from sas.qtgui.Plotting.PlotterData import Data1D 10 10 11 from sas.qtgui.Plotting.PlotterBase import PlotterBase 11 import sas.qtgui.Utilities.GuiUtils as GuiUtils12 12 from sas.qtgui.Plotting.AddText import AddText 13 13 from sas.qtgui.Plotting.SetGraphRange import SetGraphRange 14 14 from sas.qtgui.Plotting.LinearFit import LinearFit 15 15 from sas.qtgui.Plotting.PlotProperties import PlotProperties 16 17 import sas.qtgui.Utilities.GuiUtils as GuiUtils 16 18 import sas.qtgui.Plotting.PlotUtilities as PlotUtilities 17 19 -
src/sas/qtgui/Plotting/Plotter2D.py
r83eb5208 rdc5ef15 10 10 from mpl_toolkits.mplot3d import Axes3D 11 11 12 from sas.sascalc.dataloader.manipulations import CircularAverage 13 14 from sas.qtgui.Plotting.PlotterData import Data1D 15 from sas.qtgui.Plotting.PlotterData import Data2D 16 12 17 import sas.qtgui.Plotting.PlotUtilities as PlotUtilities 13 18 import sas.qtgui.Utilities.GuiUtils as GuiUtils 14 19 from sas.qtgui.Plotting.PlotterBase import PlotterBase 15 20 from sas.qtgui.Plotting.ColorMap import ColorMap 16 from sas.sasgui.guiframe.dataFitting import Data1D17 from sas.sasgui.guiframe.dataFitting import Data2D18 from sas.sascalc.dataloader.manipulations import CircularAverage19 from sas.sasgui.guiframe.local_perspectives.plotting.binder import BindArtist20 21 from sas.qtgui.Plotting.BoxSum import BoxSum 21 22 from sas.qtgui.Plotting.SlicerParameters import SlicerParameters 22 from sas.sasgui.guiframe.local_perspectives.plotting.boxSlicer import BoxInteractorX 23 from sas.sasgui.guiframe.local_perspectives.plotting.AnnulusSlicer import AnnulusInteractor 24 from sas.sasgui.guiframe.local_perspectives.plotting.SectorSlicer import SectorInteractor 25 from sas.sasgui.guiframe.local_perspectives.plotting.boxSum import BoxSumCalculator 26 from sas.sasgui.guiframe.local_perspectives.plotting.boxSlicer import BoxInteractorY 23 from sas.qtgui.Plotting.Binder import BindArtist 24 25 # TODO: move to sas.qtgui namespace 26 from sas.qtgui.Plotting.Slicers.BoxSlicer import BoxInteractorX 27 from sas.qtgui.Plotting.Slicers.BoxSlicer import BoxInteractorY 28 from sas.qtgui.Plotting.Slicers.AnnulusSlicer import AnnulusInteractor 29 from sas.qtgui.Plotting.Slicers.SectorSlicer import SectorInteractor 30 from sas.qtgui.Plotting.Slicers.BoxSum import BoxSumCalculator 27 31 28 32 # Minimum value of Z for which we will present data. -
src/sas/qtgui/Plotting/PlotterBase.py
r83eb5208 rdc5ef15 15 15 16 16 DEFAULT_CMAP = pylab.cm.jet 17 from sas. sasgui.plottools.binder import BindArtist18 19 import sas.qtgui.Utilities.GuiUtils as GuiUtils 20 from sas.sasgui.guiframe.dataFitting import Data1D, Data2D 17 from sas.qtgui.Plotting.Binder import BindArtist 18 from sas.qtgui.Plotting.PlotterData import Data1D 19 from sas.qtgui.Plotting.PlotterData import Data2D 20 21 21 from sas.qtgui.Plotting.ScaleProperties import ScaleProperties 22 22 from sas.qtgui.Plotting.WindowTitle import WindowTitle 23 import sas.qtgui.Utilities.GuiUtils as GuiUtils 23 24 import sas.qtgui.Plotting.PlotHelper as PlotHelper 24 25 import sas.qtgui.Plotting.PlotUtilities as PlotUtilities -
src/sas/qtgui/Plotting/UnitTesting/ColorMapTest.py
r83eb5208 rdc5ef15 10 10 import path_prepare 11 11 12 from sas. sasgui.guiframe.dataFittingimport Data2D12 from sas.qtgui.Plotting.PlotterData import Data2D 13 13 import sas.qtgui.Plotting.Plotter2D as Plotter2D 14 14 from UnitTesting.TestUtils import WarningTestNotImplemented -
src/sas/qtgui/Plotting/UnitTesting/LinearFitTest.py
r83eb5208 rdc5ef15 9 9 import path_prepare 10 10 11 from sas. sasgui.guiframe.dataFittingimport Data1D11 from sas.qtgui.Plotting.PlotterData import Data1D 12 12 import sas.qtgui.Plotting.Plotter as Plotter 13 13 -
src/sas/qtgui/Plotting/UnitTesting/Plotter2DTest.py
r83eb5208 rdc5ef15 12 12 import path_prepare 13 13 ####### 14 from sas. sasgui.guiframe.dataFittingimport Data1D15 from sas. sasgui.guiframe.dataFittingimport Data2D14 from sas.qtgui.Plotting.PlotterData import Data1D 15 from sas.qtgui.Plotting.PlotterData import Data2D 16 16 from UnitTesting.TestUtils import WarningTestNotImplemented 17 17 -
src/sas/qtgui/Plotting/UnitTesting/PlotterBaseTest.py
r83eb5208 rdc5ef15 14 14 from sas.qtgui.Plotting.ScaleProperties import ScaleProperties 15 15 from sas.qtgui.Plotting.WindowTitle import WindowTitle 16 #import sas.qtgui.GuiUtils as GuiUtils17 16 from sas.qtgui.Utilities.GuiUtils import * 18 17 import sas.qtgui.Plotting.PlotHelper as PlotHelper -
src/sas/qtgui/Plotting/UnitTesting/PlotterTest.py
r83eb5208 rdc5ef15 11 11 import path_prepare 12 12 ####### 13 from sas. sasgui.guiframe.dataFittingimport Data1D14 from sas. sasgui.guiframe.dataFittingimport Data2D15 from UnitTesting.TestUtils import WarningTestNotImplemented13 from sas.qtgui.Plotting.PlotterData import Data1D 14 from sas.qtgui.Plotting.PlotterData import Data2D 15 from sas.qtgui.UnitTesting.TestUtils import WarningTestNotImplemented 16 16 from sas.qtgui.Plotting.LinearFit import LinearFit 17 17 from sas.qtgui.Plotting.PlotProperties import PlotProperties -
src/sas/qtgui/Utilities/GuiUtils.py
rad6b4e2 rdc5ef15 4 4 5 5 import os 6 import re 6 7 import sys 7 8 import imp … … 16 17 from PyQt4 import QtGui 17 18 18 # Translate event handlers19 #from sas.sasgui.guiframe.events import EVT_CATEGORY20 #from sas.sasgui.guiframe.events import EVT_STATUS21 #from sas.sasgui.guiframe.events import EVT_APPEND_BOOKMARK22 #from sas.sasgui.guiframe.events import EVT_PANEL_ON_FOCUS23 #from sas.sasgui.guiframe.events import EVT_NEW_LOAD_DATA24 #from sas.sasgui.guiframe.events import EVT_NEW_COLOR25 #from sas.sasgui.guiframe.events import StatusEvent26 #from sas.sasgui.guiframe.events import NewPlotEvent27 28 19 from periodictable import formula as Formula 29 20 30 from sas.sasgui.plottools import transform 31 from sas.sasgui.plottools.convert_units import convert_unit 32 from sas.sasgui.guiframe.dataFitting import Data1D 33 from sas.sasgui.guiframe.dataFitting import Data2D 21 from sas.qtgui.Plotting import DataTransform 22 from sas.qtgui.Plotting.ConvertUnits import convertUnit 23 24 from sas.qtgui.Plotting.PlotterData import Data1D 25 from sas.qtgui.Plotting.PlotterData import Data2D 26 34 27 from sas.sascalc.dataloader.loader import Loader 28 from sas.qtgui.Utilities import CustomDir 35 29 36 30 … … 109 103 if config is None: 110 104 config = _find_local_config('local_config', os.getcwd()) 111 if config is None:112 # Didn't find local config, load the default113 import sas.sasgui.guiframe.config as config114 #logging.info("using default local_config")115 else:116 pass117 #logging.info("found local_config in %s", os.getcwd())105 #if config is None: 106 # # Didn't find local config, load the default 107 # import sas.sasgui.guiframe.config as config 108 # #logging.info("using default local_config") 109 #else: 110 # pass 111 # #logging.info("found local_config in %s", os.getcwd()) 118 112 else: 119 113 pass 120 114 #logging.info("found local_config in %s", PATH_APP) 121 115 122 from sas.sasgui.guiframe.customdir import SetupCustom 123 c_conf_dir = SetupCustom().setup_dir(PATH_APP) 116 c_conf_dir = CustomDir.setup_conf_dir(PATH_APP) 124 117 125 118 custom_config = _find_local_config('custom_config', c_conf_dir) … … 183 176 DEFAULT_OPEN_FOLDER = PATH_APP 184 177 185 DEFAULT_STYLE = config.DEFAULT_STYLE178 #DEFAULT_STYLE = config.DEFAULT_STYLE 186 179 187 180 PLUGIN_STATE_EXTENSIONS = config.PLUGIN_STATE_EXTENSIONS … … 672 665 # X 673 666 if xLabel == "x": 674 data.transformX( transform.toX, transform.errToX)667 data.transformX(DataTransform.toX, DataTransform.errToX) 675 668 xLabel = "%s(%s)" % (xname, xunits) 676 669 if xLabel == "x^(2)": 677 data.transformX( transform.toX2, transform.errToX2)678 xunits = convert _unit(2, xunits)670 data.transformX(DataTransform.toX2, DataTransform.errToX2) 671 xunits = convertUnit(2, xunits) 679 672 xLabel = "%s^{2}(%s)" % (xname, xunits) 680 673 if xLabel == "x^(4)": 681 data.transformX( transform.toX4, transform.errToX4)682 xunits = convert _unit(4, xunits)674 data.transformX(DataTransform.toX4, DataTransform.errToX4) 675 xunits = convertUnit(4, xunits) 683 676 xLabel = "%s^{4}(%s)" % (xname, xunits) 684 677 if xLabel == "ln(x)": 685 data.transformX( transform.toLogX, transform.errToLogX)678 data.transformX(DataTransform.toLogX, DataTransform.errToLogX) 686 679 xLabel = "\ln{(%s)}(%s)" % (xname, xunits) 687 680 if xLabel == "log10(x)": 688 data.transformX( transform.toX_pos, transform.errToX_pos)681 data.transformX(DataTransform.toX_pos, DataTransform.errToX_pos) 689 682 xscale = 'log' 690 683 xLabel = "%s(%s)" % (xname, xunits) 691 684 if xLabel == "log10(x^(4))": 692 data.transformX( transform.toX4, transform.errToX4)693 xunits = convert _unit(4, xunits)685 data.transformX(DataTransform.toX4, DataTransform.errToX4) 686 xunits = convertUnit(4, xunits) 694 687 xLabel = "%s^{4}(%s)" % (xname, xunits) 695 688 xscale = 'log' … … 697 690 # Y 698 691 if yLabel == "ln(y)": 699 data.transformY( transform.toLogX, transform.errToLogX)692 data.transformY(DataTransform.toLogX, DataTransform.errToLogX) 700 693 yLabel = "\ln{(%s)}(%s)" % (yname, yunits) 701 694 if yLabel == "y": 702 data.transformY( transform.toX, transform.errToX)695 data.transformY(DataTransform.toX, DataTransform.errToX) 703 696 yLabel = "%s(%s)" % (yname, yunits) 704 697 if yLabel == "log10(y)": 705 data.transformY( transform.toX_pos, transform.errToX_pos)698 data.transformY(DataTransform.toX_pos, DataTransform.errToX_pos) 706 699 yscale = 'log' 707 700 yLabel = "%s(%s)" % (yname, yunits) 708 701 if yLabel == "y^(2)": 709 data.transformY( transform.toX2, transform.errToX2)710 yunits = convert _unit(2, yunits)702 data.transformY(DataTransform.toX2, DataTransform.errToX2) 703 yunits = convertUnit(2, yunits) 711 704 yLabel = "%s^{2}(%s)" % (yname, yunits) 712 705 if yLabel == "1/y": 713 data.transformY( transform.toOneOverX, transform.errOneOverX)714 yunits = convert _unit(-1, yunits)706 data.transformY(DataTransform.toOneOverX, DataTransform.errOneOverX) 707 yunits = convertUnit(-1, yunits) 715 708 yLabel = "1/%s(%s)" % (yname, yunits) 716 709 if yLabel == "y*x^(2)": 717 data.transformY( transform.toYX2, transform.errToYX2)718 xunits = convert _unit(2, xunits)710 data.transformY(DataTransform.toYX2, DataTransform.errToYX2) 711 xunits = convertUnit(2, xunits) 719 712 yLabel = "%s \ \ %s^{2}(%s%s)" % (yname, xname, yunits, xunits) 720 713 if yLabel == "y*x^(4)": 721 data.transformY( transform.toYX4, transform.errToYX4)722 xunits = convert _unit(4, xunits)714 data.transformY(DataTransform.toYX4, DataTransform.errToYX4) 715 xunits = convertUnit(4, xunits) 723 716 yLabel = "%s \ \ %s^{4}(%s%s)" % (yname, xname, yunits, xunits) 724 717 if yLabel == "1/sqrt(y)": 725 data.transformY(transform.toOneOverSqrtX, 726 transform.errOneOverSqrtX) 727 yunits = convert_unit(-0.5, yunits) 718 data.transformY(DataTransform.toOneOverSqrtX, DataTransform.errOneOverSqrtX) 719 yunits = convertUnit(-0.5, yunits) 728 720 yLabel = "1/\sqrt{%s}(%s)" % (yname, yunits) 729 721 if yLabel == "ln(y*x)": 730 data.transformY( transform.toLogXY, transform.errToLogXY)722 data.transformY(DataTransform.toLogXY, DataTransform.errToLogXY) 731 723 yLabel = "\ln{(%s \ \ %s)}(%s%s)" % (yname, xname, yunits, xunits) 732 724 if yLabel == "ln(y*x^(2))": 733 data.transformY( transform.toLogYX2, transform.errToLogYX2)734 xunits = convert _unit(2, xunits)725 data.transformY(DataTransform.toLogYX2, DataTransform.errToLogYX2) 726 xunits = convertUnit(2, xunits) 735 727 yLabel = "\ln (%s \ \ %s^{2})(%s%s)" % (yname, xname, yunits, xunits) 736 728 if yLabel == "ln(y*x^(4))": 737 data.transformY( transform.toLogYX4, transform.errToLogYX4)738 xunits = convert _unit(4, xunits)729 data.transformY(DataTransform.toLogYX4, DataTransform.errToLogYX4) 730 xunits = convertUnit(4, xunits) 739 731 yLabel = "\ln (%s \ \ %s^{4})(%s%s)" % (yname, xname, yunits, xunits) 740 732 if yLabel == "log10(y*x^(4))": 741 data.transformY( transform.toYX4, transform.errToYX4)742 xunits = convert _unit(4, xunits)733 data.transformY(DataTransform.toYX4, DataTransform.errToYX4) 734 xunits = convertUnit(4, xunits) 743 735 yscale = 'log' 744 736 yLabel = "%s \ \ %s^{4}(%s%s)" % (yname, xname, yunits, xunits) … … 792 784 else: 793 785 return unit 786 787 def parseName(name, expression): 788 """ 789 remove "_" in front of a name 790 """ 791 if re.match(expression, name) is not None: 792 word = re.split(expression, name, 1) 793 for item in word: 794 if item.lstrip().rstrip() != '': 795 return item 796 else: 797 return name -
src/sas/qtgui/Utilities/LocalConfig.py
r83eb5208 rdc5ef15 4 4 import time 5 5 import os 6 import logging7 6 8 from sas.sasgui.guiframe.gui_style import GUIFRAME7 #from sas.sasgui.guiframe.gui_style import GUIFRAME 9 8 import sas.sasview 10 9 … … 104 103 SPLASH_SCREEN_PATH = os.path.join(icon_path, "SVwelcome_mini.png") 105 104 TUTORIAL_PATH = os.path.join(media_path, "Tutorial.pdf") 106 DEFAULT_STYLE = GUIFRAME.MULTIPLE_APPLICATIONS|GUIFRAME.MANAGER_ON\107 |GUIFRAME.CALCULATOR_ON|GUIFRAME.TOOLBAR_ON105 #DEFAULT_STYLE = GUIFRAME.MULTIPLE_APPLICATIONS|GUIFRAME.MANAGER_ON\ 106 # |GUIFRAME.CALCULATOR_ON|GUIFRAME.TOOLBAR_ON 108 107 SPLASH_SCREEN_WIDTH = 512 109 108 SPLASH_SCREEN_HEIGHT = 366 -
src/sas/qtgui/Utilities/UnitTesting/GuiUtilsTest.py
r83eb5208 rdc5ef15 12 12 # SV imports 13 13 from sas.sascalc.dataloader.loader import Loader 14 from sas. sasgui.guiframe.data_manager import DataManager15 from sas. sasgui.guiframe.dataFittingimport Data1D16 from sas. sasgui.guiframe.dataFittingimport Data2D14 from sas.qtgui.MainWindow.DataManager import DataManager 15 from sas.qtgui.Plotting.PlotterData import Data1D 16 from sas.qtgui.Plotting.PlotterData import Data2D 17 17 18 18 # Tested module
Note: See TracChangeset
for help on using the changeset viewer.