Skip to content

Commit 31a885f

Browse files
committed
fix: #32 applied fix to other plot types
1 parent 4db2f60 commit 31a885f

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
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_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]

0 commit comments

Comments
 (0)