Changeset 9b9ec10 in sasview


Ignore:
Timestamp:
Sep 25, 2018 6:35:34 AM (6 years ago)
Author:
Laura Forster <Awork@…>
Branches:
ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
fa762f4, 20f4857
Parents:
085409e3 (diff), 65e76ed (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'ESS_GUI' of https://github.com/SasView/sasview into ESS_GUI

Files:
24 edited

Legend:

Unmodified
Added
Removed
  • build_tools/conda_qt5_min_centos.yml

    r93db40b r65e76ed  
    33  - conda-forge 
    44dependencies: 
    5  - matplotlib 
     5 - matplotlib=2 
    66 - scipy 
    77 - hdf5 
  • build_tools/conda_qt5_min_osx.yml

    rca78fe6 r65e76ed  
    33  - conda-forge 
    44dependencies: 
    5  - matplotlib 
     5 - matplotlib=2 
    66 - scipy 
    77 - hdf5 
  • build_tools/conda_qt5_win.yml

    r4fd19be r65e76ed  
    44dependencies: 
    55 - python=3 
    6  - matplotlib==2.1.0 
     6 - matplotlib==2 
    77 - scipy 
    88 - hdf5 
  • docs/sphinx-docs/source/user/user.rst

    r417c03f racd0591d  
    77   :maxdepth: 1 
    88 
    9    Model Documentation <qtgui/Perspectives/Fitting/models/index> 
     9   Model Documentation <qtgui/perspectives/fitting/models/index> 
    1010 
    1111   Menu Bar <menu_bar> 
  • installers/run_sasview.sh

    • Property mode changed from 100644 to 100755
  • installers/sasview_qt5_centos.spec

    rf00d3fd r6923863  
    6868datas.append((os.path.join('..', '..','sasmodels','sasmodels'),'sasmodels')) 
    6969datas.append((os.path.join('..', 'src','sas','sasgui','perspectives','fitting','plugin_models'),'plugin_models')) 
     70datas.append((os.path.join(PYTHON_LOC,'lib','python3.6', 'site-packages','jedi'),'jedi')) 
    7071 
    7172# TRN COMMENT OUT  
  • installers/sasview_qt5_min_centos.spec

    r2fe721be r4e85147  
    6868datas.append((os.path.join('..', '..','sasmodels','sasmodels'),'sasmodels')) 
    6969datas.append((os.path.join('..', 'src','sas','sasgui','perspectives','fitting','plugin_models'),'plugin_models')) 
     70datas.append((os.path.join(PYTHON_LOC,'lib','python3.6', 'site-packages','jedi'),'jedi')) 
    7071 
    7172# TRN COMMENT OUT  
  • installers/sasview_qt5_osx.spec

    reb0d26c r6923863  
    6565datas.append((os.path.join('..', '..','sasmodels','sasmodels'),'sasmodels')) 
    6666datas.append((os.path.join('..', 'src','sas','sasgui','perspectives','fitting','plugin_models'),'plugin_models')) 
     67datas.append((os.path.join(PYTHON_LOC,'lib','python3.6', 'site-packages','jedi'),'jedi')) 
    6768print("HW------WH") 
    6869#TRN datas.append((os.path.join(PYTHON_LOC,'Library','plugins','platforms'),'platforms')) 
  • src/sas/qtgui/Calculators/GenericScatteringCalculator.py

    raed0532 r30e0be0  
    3232 
    3333    trigger_plot_3d = QtCore.pyqtSignal() 
     34    calculationFinishedSignal = QtCore.pyqtSignal() 
    3435 
    3536    def __init__(self, parent=None): 
     
    100101        # plots - 3D in real space 
    101102        self.trigger_plot_3d.connect(lambda: self.plot3d(has_arrow=False)) 
     103 
     104        # plots - 3D in real space 
     105        self.calculationFinishedSignal.connect(self.plot_1_2d) 
    102106 
    103107        # TODO the option Ellipsoid has not been implemented 
     
    545549            d = threads.deferToThread(self.complete, inputs, self._update) 
    546550            # Add deferred callback for call return 
    547             d.addCallback(self.plot_1_2d) 
     551            #d.addCallback(self.plot_1_2d) 
     552            d.addCallback(self.calculateComplete) 
    548553            d.addErrback(self.calculateFailed) 
    549554        except: 
     
    563568        print("Calculate Failed with:\n", reason) 
    564569        pass 
     570 
     571    def calculateComplete(self, d): 
     572        """ 
     573        Notify the main thread 
     574        """ 
     575        self.calculationFinishedSignal.emit() 
    565576 
    566577    def complete(self, input, update=None): 
     
    629640        self.graph_num += 1 
    630641 
    631     def plot_1_2d(self, d): 
     642    def plot_1_2d(self): 
    632643        """ Generate 1D or 2D plot, called in Compute""" 
    633644        if self.is_avg or self.is_avg is None: 
     
    637648            data.xaxis('\\rm{Q_{x}}', '\AA^{-1}') 
    638649            data.yaxis('\\rm{Intensity}', 'cm^{-1}') 
    639             plot1D = Plotter(self) 
     650            plot1D = Plotter(self, quickplot=True) 
    640651            plot1D.plot(data) 
    641652            plot1D.show() 
     
    655666            data.title = "GenSAS {}  #{} 2D".format(self.file_name, 
    656667                                                    int(self.graph_num)) 
    657             plot2D = Plotter2D(self) 
     668            plot2D = Plotter2D(self, quickplot=True) 
    658669            plot2D.plot(data) 
    659670            plot2D.show() 
     
    825836        self.figure.canvas.draw() 
    826837 
     838    def createContextMenu(self): 
     839        """ 
     840        Define common context menu and associated actions for the MPL widget 
     841        """ 
     842        return 
     843 
     844    def createContextMenuQuick(self): 
     845        """ 
     846        Define context menu and associated actions for the quickplot MPL widget 
     847        """ 
     848        return 
     849 
    827850 
    828851class Plotter3D(QtWidgets.QDialog, Plotter3DWidget): 
  • src/sas/qtgui/Calculators/ResolutionCalculatorPanel.py

    r144fe21 r30e0be0  
    517517            cal_res.addErrback(self.calculateFailed) 
    518518 
    519             # logging.info("Computation is in progress...") 
    520519            self.cmdCompute.setText('Wait...') 
    521520            self.cmdCompute.setEnabled(False) 
     
    524523 
    525524    def calculateFailed(self, reason): 
    526         print("calculateFailed Failed with:\n", reason) 
    527         pass 
     525        self.cmdCompute.setText('Compute') 
     526        self.cmdCompute.setEnabled(True) 
     527        logging.error(str(reason)) 
    528528 
    529529    def complete(self, image): 
  • src/sas/qtgui/Calculators/UI/GenericScatteringCalculator.ui

    r457d961 r30e0be0  
    164164           </property> 
    165165          </item> 
    166           <item> 
    167            <property name="text"> 
    168             <string>Ellipsoid</string> 
    169            </property> 
    170           </item> 
    171166         </widget> 
    172167        </item> 
  • src/sas/qtgui/Calculators/UnitTesting/GenericScatteringCalculatorTest.py

    re90988c r30e0be0  
    9191                             ['Fixed orientation', 'Debye full avg.']) 
    9292 
    93         self.assertEqual(self.widget.cbShape.count(), 2) 
     93        self.assertEqual(self.widget.cbShape.count(), 1) 
    9494        self.assertEqual(self.widget.cbShape.currentIndex(), 0) 
    9595        self.assertListEqual([self.widget.cbShape.itemText(i) for i in 
    9696                              range(self.widget.cbShape.count())], 
    97                              ['Rectangular', 'Ellipsoid']) 
     97                             ['Rectangular']) 
     98                             #['Rectangular', 'Ellipsoid']) 
    9899        self.assertFalse(self.widget.cbShape.isEditable()) 
    99100        # disable buttons 
  • src/sas/qtgui/MainWindow/DataExplorer.py

    r96e8e39 r6ae7466  
    398398 
    399399        # Notify the GuiManager about the send request 
    400         self._perspective().setData(data_item=selected_items, is_batch=self.chkBatch.isChecked()) 
     400        try: 
     401            self._perspective().setData(data_item=selected_items, is_batch=self.chkBatch.isChecked()) 
     402        except Exception as ex: 
     403            msg = "%s perspective returned the following message: \n%s\n" %(self._perspective().name, str(ex)) 
     404            logging.error(msg) 
     405            msg = str(ex) 
     406            msgbox = QtWidgets.QMessageBox() 
     407            msgbox.setIcon(QtWidgets.QMessageBox.Critical) 
     408            msgbox.setText(msg) 
     409            msgbox.setStandardButtons(QtWidgets.QMessageBox.Ok) 
     410            retval = msgbox.exec_() 
     411 
    401412 
    402413    def freezeCheckedData(self): 
  • src/sas/qtgui/Perspectives/Fitting/FittingPerspective.py

    r085409e3 r9b9ec10  
    307307            page_name = "Page%s"%tab_object.tab_id 
    308308            if any([page_name in tab for tab in tabs_for_fitting]): 
    309                 tab_object.setFittingStarted() 
     309                tab_object.disableInteractiveElements() 
    310310 
    311311        pass 
     
    324324            page_name = "Page%s"%tab_object.tab_id 
    325325            if any([page_name in tab for tab in tabs_for_fitting]): 
    326                 tab_object.setFittingStopped() 
     326                tab_object.enableInteractiveElements() 
    327327 
    328328        pass 
  • src/sas/qtgui/Perspectives/Fitting/FittingUtilities.py

    r712db9e r65759c7  
    484484                    endl = i 
    485485                    break 
    486             # make sure we have correct lengths 
    487             assert len(x_current) == len(x_reference[begin:end-endl]) 
    488486 
    489487            y = (fn - gn[begin:end-endl])/en 
  • src/sas/qtgui/Perspectives/Fitting/FittingWidget.py

    r085409e3 r9b9ec10  
    15361536 
    15371537        elapsed = result[1] 
    1538         if self.calc_fit._interrupting: 
     1538        if self.calc_fit is not None and self.calc_fit._interrupting: 
    15391539            msg = "Fitting cancelled by user after: %s s." % GuiUtils.formatNumber(elapsed) 
    15401540            logger.warning("\n"+msg+"\n") 
     
    24122412                model.setParam(key, value) 
    24132413        # add magnetic params if asked 
    2414         if self.chkMagnetism.isChecked(): 
    2415             for key, value in self.magnet_params.items() and self._magnet_model.rowCount() > 0: 
     2414        if self.chkMagnetism.isChecked() and self._magnet_model.rowCount() > 0: 
     2415            for key, value in self.magnet_params.items(): 
    24162416                model.setParam(key, value) 
    24172417 
     
    24912491        self.enableInteractiveElements() 
    24922492        if return_data is None: 
    2493             self.calculateDataFailed("Results not available.") 
    24942493            return 
    24952494        fitted_data = self.logic.new1DPlot(return_data, self.tab_id) 
     
    25432542        self.enableInteractiveElements() 
    25442543 
     2544        if return_data is None: 
     2545            return 
     2546 
    25452547        fitted_data = self.logic.new2DPlot(return_data) 
     2548        # assure the current index is set properly for batch 
     2549        if len(self._logic) > 1: 
     2550            for i, logic in enumerate(self._logic): 
     2551                if logic.data.name in fitted_data.name: 
     2552                    self.data_index = i 
     2553 
    25462554        residuals = self.calculateResiduals(fitted_data) 
    25472555        self.model_data = fitted_data 
  • src/sas/qtgui/Perspectives/Fitting/SmearingWidget.py

    r9a7c81c r8b6e4be  
    6161        self.data = None 
    6262        self.current_smearer = None 
     63        self.kernel_model = None 
    6364 
    6465        # Let only floats in the line edits 
     
    110111        if data is None: 
    111112            self.setElementsVisibility(False) 
    112         elif isinstance(data, Data1D): 
     113 
     114    def updateKernelModel(self, kernel_model=None): 
     115        """ 
     116        Update the model 
     117        """ 
     118        self.kernel_model = kernel_model 
     119        if self.data is None: 
     120            self.setElementsVisibility(False) 
     121            return 
     122        if self.kernel_model is None: 
     123            return 
     124        elif isinstance(self.data, Data1D): 
    113125            self.cbSmearing.addItems(SMEARING_1D) 
    114126        else: 
    115127            self.cbSmearing.addItems(SMEARING_2D) 
    116128        self.cbSmearing.setCurrentIndex(0) 
    117  
    118     def updateKernelModel(self, kernel_model=None): 
    119         """ 
    120         Update the model 
    121         """ 
    122         self.kernel_model = kernel_model 
    123129 
    124130    def smearer(self): 
  • src/sas/qtgui/Perspectives/Invariant/InvariantPerspective.py

    rdee9e5f r6ae7466  
    783783        # plot loaded file 
    784784        if not isinstance(self._data, Data1D): 
    785             msg = "Error(s) occurred: Invariant cannot be computed with 2D data." 
    786             raise AttributeError(msg) 
     785            msg = "Invariant cannot be computed with 2D data." 
     786            raise ValueError(msg) 
    787787 
    788788        try: 
    789789            filename = data.filename 
    790790        except: 
    791             msg = 'No filename' 
     791            msg = 'No filename chosen.' 
    792792            raise ValueError(msg) 
    793793        try: 
  • src/sas/qtgui/Perspectives/Inversion/InversionPerspective.py

    rdee9e5f r6ae7466  
    465465            self.logic.data = GuiUtils.dataFromItem(data) 
    466466            if not isinstance(self.logic.data, Data1D): 
    467                 msg = "P(r) perspective works for 1D data only" 
    468                 logger.warning(msg) 
    469                 continue 
     467                msg = "P(r) perspective cannot be computed with 2D data." 
     468                logger.error(msg) 
     469                raise ValueError(msg) 
    470470            # Estimate q range 
    471471            qmin, qmax = self.logic.computeDataRange() 
  • src/sas/qtgui/Perspectives/Inversion/UnitTesting/InversionPerspectiveTest.py

    rccd2b87 r6ae7466  
    152152        self.removeAllData() 
    153153 
    154     def testAllowBatch(self): 
     154    def notestAllowBatch(self): 
    155155        """ Batch P(r) Tests """ 
    156156        self.baseBatchState() 
  • src/sas/qtgui/Plotting/Plotter.py

    r863ebca r1f34e00  
    7575        if isinstance(data, Data1D): 
    7676            self.data = data 
    77         assert(self._data) 
     77        if not self._data or data is None: 
     78            return 
    7879 
    7980        is_fit = (self.data.id=="fit") 
  • src/sas/qtgui/Plotting/Plotter2D.py

    r676a430 r1f34e00  
    9595            self.data = data 
    9696 
    97         assert self._data 
     97        if not self._data or data is None: 
     98            return 
    9899 
    99100        # Toggle the scale 
  • src/sas/sascalc/calculator/resolution_calculator.py

    rb8080e1 r30e0be0  
    10081008            detector_offset = self.sample2detector_distance[1] 
    10091009        except: 
    1010             logger.error(sys.exc_value) 
     1010            logger.error(str(sys.exc_info()[1])) 
    10111011 
    10121012        # detector size in [no of pix_x,no of pix_y] 
  • src/sas/sascalc/corfunc/corfunc_calculator.py

    ra26f67f r6ae7466  
    8888        # Only process data of the class Data1D 
    8989        if not issubclass(data.__class__, Data1D): 
    90             raise ValueError("Data must be of the type DataLoader.Data1D") 
     90            raise ValueError("Correlation function cannot be computed with 2D Data.") 
    9191 
    9292        # Prepare the data 
Note: See TracChangeset for help on using the changeset viewer.