Skip to content

Commit bd2ceb4

Browse files
committed
Lint
1 parent 03caf3b commit bd2ceb4

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

Orange/widgets/visualize/owscatterplotgraph.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ def __init__(self, scatter_widget, parent=None, view_box=ViewBox):
405405
self.plot_widget.scene().installEventFilter(self._tooltip_delegate)
406406
self.view_box.sigTransformChanged.connect(self.update_density)
407407

408-
self._timer = None
408+
self.timer = None
409409

410410
def _create_legend(self, anchor):
411411
legend = LegendItem()
@@ -730,9 +730,9 @@ def update_sizes(self):
730730
self.master, "impute_sizes", self.default_impute_sizes)
731731
size_imputer(size_data)
732732

733-
if self._timer is not None and self._timer.isActive():
734-
self._timer.stop()
735-
self._timer = None
733+
if self.timer is not None and self.timer.isActive():
734+
self.timer.stop()
735+
self.timer = None
736736

737737
current_size_data = self.scatterplot_item.data["size"].copy()
738738
diff = size_data - current_size_data
@@ -752,16 +752,16 @@ def __call__(self):
752752
self._counter += 1
753753
size = current_size_data + diff * factor
754754
if len(self.factors) == self._counter:
755-
widget._timer.stop()
756-
widget._timer = None
755+
widget.timer.stop()
756+
widget.timer = None
757757
size = size_data
758758
widget.scatterplot_item.setSize(size)
759759
widget.scatterplot_item_sel.setSize(size + SELECTION_WIDTH)
760760

761761
if np.sum(current_size_data) / self.n_valid != -1 and np.sum(diff):
762-
self._timer = QTimer(self.scatterplot_item, interval=50)
763-
self._timer.timeout.connect(Timeout())
764-
self._timer.start()
762+
self.timer = QTimer(self.scatterplot_item, interval=50)
763+
self.timer.timeout.connect(Timeout())
764+
self.timer.start()
765765
else:
766766
self.scatterplot_item.setSize(size_data)
767767
self.scatterplot_item_sel.setSize(size_data + SELECTION_WIDTH)

Orange/widgets/visualize/tests/test_owscatterplotbase.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def test_sampling(self):
165165
np.array([str(x) for x in d], dtype=object)
166166
graph.reset_graph()
167167
self.process_events(until=lambda: not (
168-
self.graph._timer is not None and self.graph._timer.isActive()))
168+
self.graph.timer is not None and self.graph.timer.isActive()))
169169

170170
# Check proper sampling
171171
scatterplot_item = graph.scatterplot_item
@@ -194,7 +194,7 @@ def test_sampling(self):
194194
# Check that sample is extended when sample size is changed
195195
graph.set_sample_size(4)
196196
self.process_events(until=lambda: not (
197-
self.graph._timer is not None and self.graph._timer.isActive()))
197+
self.graph.timer is not None and self.graph.timer.isActive()))
198198
scatterplot_item = graph.scatterplot_item
199199
x, y = scatterplot_item.getData()
200200
data = scatterplot_item.data
@@ -235,7 +235,7 @@ def test_sampling(self):
235235
# Enable sampling when data is already present and not sampled
236236
graph.set_sample_size(3)
237237
self.process_events(until=lambda: not (
238-
self.graph._timer is not None and self.graph._timer.isActive()))
238+
self.graph.timer is not None and self.graph.timer.isActive()))
239239
scatterplot_item = graph.scatterplot_item
240240
x, y = scatterplot_item.getData()
241241
data = scatterplot_item.data
@@ -272,7 +272,7 @@ def test_sampling(self):
272272
d = self.xy[0] - 100
273273
graph.reset_graph()
274274
self.process_events(until=lambda: not (
275-
self.graph._timer is not None and self.graph._timer.isActive()))
275+
self.graph.timer is not None and self.graph.timer.isActive()))
276276
scatterplot_item = graph.scatterplot_item
277277
x, y = scatterplot_item.getData()
278278
self.assertEqual(len(x), 3)
@@ -378,7 +378,7 @@ def test_size_with_nans(self):
378378
d[4] = np.nan
379379
graph.update_sizes()
380380
self.process_events(until=lambda: not (
381-
self.graph._timer is not None and self.graph._timer.isActive()))
381+
self.graph.timer is not None and self.graph.timer.isActive()))
382382
sizes2 = scatterplot_item.data["size"]
383383

384384
self.assertEqual(sizes[1] - sizes[0], sizes2[1] - sizes2[0])

0 commit comments

Comments
 (0)