From 3bdb29e5212992523d155ea090837261c59175b6 Mon Sep 17 00:00:00 2001 From: Eric Dill Date: Sat, 11 Jul 2015 17:44:50 -0500 Subject: [PATCH] MNT: Remove commented code --- pyqtgraph/graphicsItems/ImageItem.py | 7 +--- .../graphicsItems/tests/test_ImageItem.py | 41 ------------------- 2 files changed, 2 insertions(+), 46 deletions(-) diff --git a/pyqtgraph/graphicsItems/ImageItem.py b/pyqtgraph/graphicsItems/ImageItem.py index 4447d4b3..744e1937 100644 --- a/pyqtgraph/graphicsItems/ImageItem.py +++ b/pyqtgraph/graphicsItems/ImageItem.py @@ -291,11 +291,8 @@ class ImageItem(GraphicsObject): y = self.mapToDevice(QtCore.QPointF(0,1)) w = Point(x-o).length() h = Point(y-o).length() - xds = max(1, int(1/w)) - yds = max(1, int(1/h)) - # xds = int(1/max(1,w)) - # yds = int(1/max(1,h)) - # 1/0 + xds = int(1/max(1, w)) + yds = int(1/max(1, h)) image = fn.downsample(self.image, xds, axis=0) image = fn.downsample(image, yds, axis=1) else: diff --git a/pyqtgraph/graphicsItems/tests/test_ImageItem.py b/pyqtgraph/graphicsItems/tests/test_ImageItem.py index ce232296..c2ba58d9 100644 --- a/pyqtgraph/graphicsItems/tests/test_ImageItem.py +++ b/pyqtgraph/graphicsItems/tests/test_ImageItem.py @@ -22,44 +22,3 @@ def test_dividebyzero(): # must manually call im.imageItem.render here or the exception # will only exist on the Qt event loop im.imageItem.render() - - -if __name__ == "__main__": - test_dividebyzero() - - -# def test_getViewWidget(): -# view = pg.PlotWidget() -# vref = weakref.ref(view) -# item = pg.InfiniteLine() -# view.addItem(item) -# assert item.getViewWidget() is view -# del view -# gc.collect() -# assert vref() is None -# assert item.getViewWidget() is None -# -# def test_getViewWidget_deleted(): -# view = pg.PlotWidget() -# item = pg.InfiniteLine() -# view.addItem(item) -# assert item.getViewWidget() is view -# -# # Arrange to have Qt automatically delete the view widget -# obj = pg.QtGui.QWidget() -# view.setParent(obj) -# del obj -# gc.collect() -# -# assert not pg.Qt.isQObjectAlive(view) -# assert item.getViewWidget() is None - - -#if __name__ == '__main__': - #view = pg.PlotItem() - #vref = weakref.ref(view) - #item = pg.InfiniteLine() - #view.addItem(item) - #del view - #gc.collect() -