Changeset 6ae7466 in sasview


Ignore:
Timestamp:
Sep 25, 2018 5:13:24 AM (4 weeks ago)
Author:
Piotr Rozyczko <piotr.rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_image_viewer, ESS_GUI_project_save
Children:
6923863
Parents:
8a09457
Message:

Complain when wrong data sent to perspective. SASVIEW-1165 SASVIEW-1166

Location:
src/sas
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • 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/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/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.