Skip to content

Commit 7be0625

Browse files
That pesky Python2 integer divide!
1 parent aeb7416 commit 7be0625

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/python/plotly/plotly/subplots.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ def _checks(item, defaults):
640640
# Check to see that number of rows and columns does not conflict with
641641
# requested vertical_spacing and horizontal_spacing
642642
def _check_row_col_spacing(n, spacing):
643-
if (n > 1) and (spacing > (1 / (n - 1))):
643+
if (n > 1) and (spacing > (1.0 / (n - 1))):
644644
return False
645645
return True
646646

packages/python/plotly/plotly/tests/test_core/test_subplots/test_make_subplots.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,15 @@ def test_row_width_not_list_of_correct_numbers(self):
116116

117117
def test_bad_row_spacing(self):
118118
with self.assertRaises(ValueError) as cm:
119-
tls.make_subplots(rows=3, vertical_spacing=1 / 2 + 1e-6)
119+
tls.make_subplots(rows=3, vertical_spacing=1.0 / 2.0 + 1e-6)
120120
assert (
121121
cm.exception.args[0]
122122
== "Vertical spacing must be less than or equal to 1 / (rows - 1)."
123123
)
124124

125125
def test_bad_col_spacing(self):
126126
with self.assertRaises(ValueError) as cm:
127-
tls.make_subplots(cols=3, horizontal_spacing=1 / 2 + 1e-6)
127+
tls.make_subplots(cols=3, horizontal_spacing=1.0 / 2.0 + 1e-6)
128128
assert (
129129
cm.exception.args[0]
130130
== "Horizontal spacing must be less than or equal to 1 / (cols - 1)."

0 commit comments

Comments
 (0)