コード例 #1
0
ファイル: test_colormapdialog.py プロジェクト: jackal02/silx
    def testImageItem(self):
        """Check that an ImageData plot item can be used"""
        dialog = self.colormapDiag
        colormap = Colormap(name='gray', vmin=None, vmax=None)
        data = numpy.arange(3**2).reshape(3, 3)
        item = ImageData()
        item.setData(data, copy=False)

        dialog.setColormap(colormap)
        dialog.show()
        self.qapp.processEvents()
        dialog.setItem(item)
        vrange = dialog._getFiniteColormapRange()
        self.assertEqual(vrange, (0, 8))
コード例 #2
0
ファイル: test_colormapdialog.py プロジェクト: jackal02/silx
    def testItemDel(self):
        """Check that the plot items are not hard linked to the dialog"""
        dialog = self.colormapDiag
        colormap = Colormap(name='gray', vmin=None, vmax=None)
        data = numpy.arange(3**2).reshape(3, 3)
        item = ImageData()
        item.setData(data, copy=False)

        dialog.setColormap(colormap)
        dialog.show()
        self.qapp.processEvents()
        dialog.setItem(item)
        previousRange = dialog._getFiniteColormapRange()
        del item
        vrange = dialog._getFiniteColormapRange()
        self.assertNotEqual(vrange, previousRange)