Skip to content

Commit 45e9de3

Browse files
authored
Merge pull request #33 from domarm-comat/issue_32_fix
Issue 32 fix
2 parents 2767373 + 31a885f commit 45e9de3

File tree

5 files changed

+43
-51
lines changed

5 files changed

+43
-51
lines changed

pglive/sources/live_candleStickPlot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def getData(self) -> Tuple[List[float], List[Tuple[float, ...]]]:
8787
return self.x_data, self.y_data
8888

8989
def data_bounds(self, ax: int = 0, offset: int = 0) -> Tuple[ndarray, ndarray]:
90-
if self.x_data == [] and self.output_y_data == []:
90+
if self.x_data is [] and self.output_y_data is []:
9191
return 0, 0
9292
if ax == 0:
9393
sub_range = self.x_data[-offset:]
@@ -96,7 +96,7 @@ def data_bounds(self, ax: int = 0, offset: int = 0) -> Tuple[ndarray, ndarray]:
9696
return np.nanmin(sub_range), np.nanmax(sub_range)
9797

9898
def data_tick(self, ax: int = 0):
99-
if self.x_data == [] and self.output_y_data == []:
99+
if self.x_data is [] and self.output_y_data is []:
100100
return 0, 0
101101
if ax == 0:
102102
return self.x_data[0] if len(self.x_data) == 1 else self.x_data[-1] - self.x_data[0]

pglive/sources/live_categorized_bar_plot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def getData(self):
113113

114114
def data_bounds(self, ax: int = 0, offset: int = 0) -> Tuple:
115115
if ax == 0:
116-
if self.x_data == []:
116+
if self.x_data is []:
117117
return 0, 0
118118
sub_range = self.x_data[-offset:]
119119
return np.nanmin(sub_range), np.nanmax(sub_range)
@@ -123,7 +123,7 @@ def data_bounds(self, ax: int = 0, offset: int = 0) -> Tuple:
123123

124124
def data_tick(self, ax: int = 0):
125125
if ax == 0:
126-
if self.x_data == []:
126+
if self.x_data is []:
127127
return 0, 0
128128
return self.x_data[0] if len(self.x_data) == 1 else self.x_data[-1] - self.x_data[0]
129129
else:

pglive/sources/live_plot.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def getData(self) -> Tuple[List[float], List[float]]:
105105
return self.opts["width"], self.opts["y"]
106106

107107
def update_leading_line(self) -> None:
108-
if self.opts["width"] == [] and self.opts["y"] == []:
108+
if self.opts["width"] is [] and self.opts["y"] is []:
109109
self.clear_leading_lines()
110110
return
111111

@@ -117,7 +117,7 @@ def update_leading_line(self) -> None:
117117

118118
def data_bounds(self, ax: int = 0, offset: int = 0) -> Tuple[np.ndarray, np.ndarray]:
119119
x, y = self.getData()
120-
if x == [] and y == []:
120+
if x is [] and y is []:
121121
return 0, 0
122122
if ax == 0:
123123
sub_range = x[-offset:]
@@ -127,7 +127,7 @@ def data_bounds(self, ax: int = 0, offset: int = 0) -> Tuple[np.ndarray, np.ndar
127127

128128
def data_tick(self, ax: int = 0):
129129
x, y = self.getData()
130-
if x == [] and y == []:
130+
if x is [] and y is []:
131131
return 0, 0
132132
if ax == 0:
133133
return x[0] if len(x) == 1 else x[1] - x[0]
@@ -152,7 +152,7 @@ def clear(self):
152152
self.sigPlotChanged.emit()
153153

154154
def update_leading_line(self) -> None:
155-
if self.opts["x"] == [] and self.opts["height"] == []:
155+
if self.opts["x"] is [] and self.opts["height"] is []:
156156
self.clear_leading_lines()
157157
return
158158

@@ -164,7 +164,7 @@ def update_leading_line(self) -> None:
164164

165165
def data_bounds(self, ax: int = 0, offset: int = 0) -> Tuple[np.ndarray, np.ndarray]:
166166
x, y = self.getData()
167-
if x == [] and y == []:
167+
if x is [] and y is []:
168168
return 0, 0
169169
if ax == 0:
170170
sub_range = x[-offset:]
@@ -174,7 +174,7 @@ def data_bounds(self, ax: int = 0, offset: int = 0) -> Tuple[np.ndarray, np.ndar
174174

175175
def data_tick(self, ax: int = 0):
176176
x, y = self.getData()
177-
if x == [] and y == []:
177+
if x is [] and y is []:
178178
return 0, 0
179179
if ax == 0:
180180
return x[0] if len(x) == 1 else x[1] - x[0]

poetry.lock

Lines changed: 32 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "pglive"
3-
version = "0.7.1"
3+
version = "0.7.2"
44
description = "Pyqtgraph live plot"
55
authors = ["Martin Domaracky <domarm@comat.sk>"]
66
license = "MIT"

0 commit comments

Comments
 (0)