From bd2ceb4b7ead63668525276c1e544ff0acaf5a1c Mon Sep 17 00:00:00 2001 From: Vesna Tanko Date: Tue, 4 Dec 2018 09:31:40 +0100 Subject: [PATCH] Lint --- Orange/widgets/visualize/owscatterplotgraph.py | 18 +++++++++--------- .../visualize/tests/test_owscatterplotbase.py | 10 +++++----- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Orange/widgets/visualize/owscatterplotgraph.py b/Orange/widgets/visualize/owscatterplotgraph.py index 6b773c0486d..a82b129fb37 100644 --- a/Orange/widgets/visualize/owscatterplotgraph.py +++ b/Orange/widgets/visualize/owscatterplotgraph.py @@ -405,7 +405,7 @@ def __init__(self, scatter_widget, parent=None, view_box=ViewBox): self.plot_widget.scene().installEventFilter(self._tooltip_delegate) self.view_box.sigTransformChanged.connect(self.update_density) - self._timer = None + self.timer = None def _create_legend(self, anchor): legend = LegendItem() @@ -730,9 +730,9 @@ def update_sizes(self): self.master, "impute_sizes", self.default_impute_sizes) size_imputer(size_data) - if self._timer is not None and self._timer.isActive(): - self._timer.stop() - self._timer = None + if self.timer is not None and self.timer.isActive(): + self.timer.stop() + self.timer = None current_size_data = self.scatterplot_item.data["size"].copy() diff = size_data - current_size_data @@ -752,16 +752,16 @@ def __call__(self): self._counter += 1 size = current_size_data + diff * factor if len(self.factors) == self._counter: - widget._timer.stop() - widget._timer = None + widget.timer.stop() + widget.timer = None size = size_data widget.scatterplot_item.setSize(size) widget.scatterplot_item_sel.setSize(size + SELECTION_WIDTH) if np.sum(current_size_data) / self.n_valid != -1 and np.sum(diff): - self._timer = QTimer(self.scatterplot_item, interval=50) - self._timer.timeout.connect(Timeout()) - self._timer.start() + self.timer = QTimer(self.scatterplot_item, interval=50) + self.timer.timeout.connect(Timeout()) + self.timer.start() else: self.scatterplot_item.setSize(size_data) self.scatterplot_item_sel.setSize(size_data + SELECTION_WIDTH) diff --git a/Orange/widgets/visualize/tests/test_owscatterplotbase.py b/Orange/widgets/visualize/tests/test_owscatterplotbase.py index cca5f0d37e0..dd6cd626b41 100644 --- a/Orange/widgets/visualize/tests/test_owscatterplotbase.py +++ b/Orange/widgets/visualize/tests/test_owscatterplotbase.py @@ -165,7 +165,7 @@ def test_sampling(self): np.array([str(x) for x in d], dtype=object) graph.reset_graph() self.process_events(until=lambda: not ( - self.graph._timer is not None and self.graph._timer.isActive())) + self.graph.timer is not None and self.graph.timer.isActive())) # Check proper sampling scatterplot_item = graph.scatterplot_item @@ -194,7 +194,7 @@ def test_sampling(self): # Check that sample is extended when sample size is changed graph.set_sample_size(4) self.process_events(until=lambda: not ( - self.graph._timer is not None and self.graph._timer.isActive())) + self.graph.timer is not None and self.graph.timer.isActive())) scatterplot_item = graph.scatterplot_item x, y = scatterplot_item.getData() data = scatterplot_item.data @@ -235,7 +235,7 @@ def test_sampling(self): # Enable sampling when data is already present and not sampled graph.set_sample_size(3) self.process_events(until=lambda: not ( - self.graph._timer is not None and self.graph._timer.isActive())) + self.graph.timer is not None and self.graph.timer.isActive())) scatterplot_item = graph.scatterplot_item x, y = scatterplot_item.getData() data = scatterplot_item.data @@ -272,7 +272,7 @@ def test_sampling(self): d = self.xy[0] - 100 graph.reset_graph() self.process_events(until=lambda: not ( - self.graph._timer is not None and self.graph._timer.isActive())) + self.graph.timer is not None and self.graph.timer.isActive())) scatterplot_item = graph.scatterplot_item x, y = scatterplot_item.getData() self.assertEqual(len(x), 3) @@ -378,7 +378,7 @@ def test_size_with_nans(self): d[4] = np.nan graph.update_sizes() self.process_events(until=lambda: not ( - self.graph._timer is not None and self.graph._timer.isActive())) + self.graph.timer is not None and self.graph.timer.isActive())) sizes2 = scatterplot_item.data["size"] self.assertEqual(sizes[1] - sizes[0], sizes2[1] - sizes2[0])