Skip to content

Commit a63b38d

Browse files
committed
python: fix python 3.8 Syntax Warning
1 parent 587075c commit a63b38d

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

Diff for: packages/python/plotly/_plotly_utils/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ class NotEncodable(Exception):
211211
def iso_to_plotly_time_string(iso_string):
212212
"""Remove timezone info and replace 'T' delimeter with ' ' (ws)."""
213213
# make sure we don't send timezone info to plotly
214-
if (iso_string.split("-")[:3] is "00:00") or (iso_string.split("+")[0] is "00:00"):
214+
if (iso_string.split("-")[:3] == "00:00") or (iso_string.split("+")[0] == "00:00"):
215215
raise Exception(
216216
"Plotly won't accept timestrings with timezone info.\n"
217217
"All timestrings are assumed to be in UTC."

Diff for: packages/python/plotly/plotly/figure_factory/_candlestick.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,12 @@ def create_candlestick(open, high, low, close, dates=None, direction="both", **k
191191
utils.validate_equal_length(open, high, low, close)
192192
validate_ohlc(open, high, low, close, direction, **kwargs)
193193

194-
if direction is "increasing":
194+
if direction == "increasing":
195195
candle_incr_data = make_increasing_candle(
196196
open, high, low, close, dates, **kwargs
197197
)
198198
data = candle_incr_data
199-
elif direction is "decreasing":
199+
elif direction == "decreasing":
200200
candle_decr_data = make_decreasing_candle(
201201
open, high, low, close, dates, **kwargs
202202
)

Diff for: packages/python/plotly/plotly/figure_factory/_ohlc.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,10 @@ def create_ohlc(open, high, low, close, dates=None, direction="both", **kwargs):
173173
utils.validate_equal_length(open, high, low, close)
174174
validate_ohlc(open, high, low, close, direction, **kwargs)
175175

176-
if direction is "increasing":
176+
if direction == "increasing":
177177
ohlc_incr = make_increasing_ohlc(open, high, low, close, dates, **kwargs)
178178
data = [ohlc_incr]
179-
elif direction is "decreasing":
179+
elif direction == "decreasing":
180180
ohlc_decr = make_decreasing_ohlc(open, high, low, close, dates, **kwargs)
181181
data = [ohlc_decr]
182182
else:

Diff for: packages/python/plotly/plotly/matplotlylib/renderer.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ def draw_path_collection(self, **props):
457457
458458
"""
459459
self.msg += " Attempting to draw a path collection\n"
460-
if props["offset_coordinates"] is "data":
460+
if props["offset_coordinates"] == "data":
461461
markerstyle = mpltools.get_markerstyle_from_collection(props)
462462
scatter_props = {
463463
"coordinates": "data",
@@ -569,7 +569,7 @@ def draw_text(self, **props):
569569
self.draw_title(**props)
570570
else: # just a regular text annotation...
571571
self.msg += " Text object is a normal annotation\n"
572-
if props["coordinates"] is not "data":
572+
if props["coordinates"] != "data":
573573
self.msg += (
574574
" Text object isn't linked to 'data' " "coordinates\n"
575575
)

0 commit comments

Comments
 (0)