Changeset 749b715 in sasview


Ignore:
Timestamp:
Oct 27, 2017 6:28:17 AM (7 years ago)
Author:
Piotr Rozyczko <piotr.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:
b3e8629
Parents:
9e54199
git-author:
Adam Washington <rprospero@…> (10/27/17 06:28:17)
git-committer:
Piotr Rozyczko <piotr.rozyczko@…> (10/27/17 06:28:17)
Message:

Ess sesans plots (#113)

  • Fix line endings
  • Keep the isSesans parameter when making copies.
  • Draw Sesans data in linear coordinates
  • Add unit test for Sesans Plotting
  • Remove lint
Location:
src/sas
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Plotting/Plotter.py

    rf0bb711 r749b715  
    5656        self.xLabel = "%s(%s)"%(value._xaxis, value._xunit) 
    5757        self.yLabel = "%s(%s)"%(value._yaxis, value._yunit) 
     58        if value.isSesans: 
     59            self.xscale = 'linear' 
     60            self.yscale = 'linear' 
    5861        self.title(title=value.name) 
    5962 
  • src/sas/qtgui/Plotting/PlotterData.py

    rfef38e8 r749b715  
    5454        self.yaxis(data1d._yaxis, data1d._yunit) 
    5555        self.title = data1d.title 
     56        self.isSesans = data1d.isSesans 
    5657         
    5758    def __str__(self): 
  • src/sas/qtgui/Plotting/UnitTesting/PlotterTest.py

    rb2a5042 r749b715  
    7373 
    7474        self.assertEqual(self.plotter.ax.get_yscale(), 'log') 
     75        self.assertTrue(FigureCanvas.draw.called) 
     76 
     77    def testPlotWithSesans(self): 
     78        """ Ensure that Sesans data is plotted in linear cooredinates""" 
     79        data = Data1D(x=[1.0, 2.0, 3.0], 
     80                      y=[10.0, 11.0, 12.0], 
     81                      dx=[0.1, 0.2, 0.3], 
     82                      dy=[0.1, 0.2, 0.3]) 
     83        data.title = "Sesans data" 
     84        data.name = "Test Sesans" 
     85        data.isSesans = True 
     86        data.id = 2 
     87 
     88        self.plotter.data = data 
     89        self.plotter.show() 
     90        FigureCanvas.draw = MagicMock() 
     91 
     92        self.plotter.plot(hide_error=True) 
     93 
     94        self.assertEqual(self.plotter.ax.get_xscale(), 'linear') 
     95        self.assertEqual(self.plotter.ax.get_yscale(), 'linear') 
    7596        self.assertTrue(FigureCanvas.draw.called) 
    7697 
  • src/sas/sascalc/dataloader/data_info.py

    r9e6aeaf r749b715  
    775775        clone.meta_data = deepcopy(self.meta_data) 
    776776        clone.errors = deepcopy(self.errors) 
     777        clone.isSesans = self.isSesans 
    777778 
    778779        return clone 
Note: See TracChangeset for help on using the changeset viewer.