Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
VesnaT committed Dec 4, 2018
1 parent 03caf3b commit bd2ceb4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
18 changes: 9 additions & 9 deletions Orange/widgets/visualize/owscatterplotgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions Orange/widgets/visualize/tests/test_owscatterplotbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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])
Expand Down

0 comments on commit bd2ceb4

Please sign in to comment.