From 796b15aacd1ecdd8ad1ead0178a5e10de791e08a Mon Sep 17 00:00:00 2001 From: kernc Date: Wed, 4 Jan 2017 14:13:08 +0100 Subject: [PATCH] Merge pull request #1861 from nikicc/imageviewer-fix-indexing [FIX] OWImageViewer: Fix selection with missing values (cherry picked from commit 04be22587d1993f15f0ae30f8a4458781e11f395) --- Orange/widgets/data/owimageviewer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Orange/widgets/data/owimageviewer.py b/Orange/widgets/data/owimageviewer.py index 57f58fa8e8e..e7a544dd9db 100644 --- a/Orange/widgets/data/owimageviewer.py +++ b/Orange/widgets/data/owimageviewer.py @@ -991,12 +991,12 @@ def setupScene(self): if self.data: attr = self.stringAttrs[self.imageAttr] titleAttr = self.allAttrs[self.titleAttr] - instances = [inst for inst in self.data - if numpy.isfinite(inst[attr])] assert self.thumbnailView.count() == 0 size = QSizeF(self.imageSize, self.imageSize) - for i, inst in enumerate(instances): + for i, inst in enumerate(self.data): + if not numpy.isfinite(inst[attr]): # skip missing + continue url = self.urlFromValue(inst[attr]) title = str(inst[titleAttr])