Skip to content

Commit bfa69ce

Browse files
committed
add exception for out of range 'insets.cell'
1 parent e9c2e01 commit bfa69ce

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

plotly/tools.py

+8
Original file line numberDiff line numberDiff line change
@@ -955,6 +955,14 @@ def _add_domain_is_3d(layout, s_label, x_domain, y_domain):
955955
r = inset['cell'][0] - 1
956956
c = inset['cell'][1] - 1
957957

958+
# Throw exception if r | c is out of range
959+
if not (0 <= r < rows):
960+
raise Exception("Some 'cell' row value it out of range. "
961+
"Note: the starting cell is (1, 1)")
962+
if not (0 <= c < cols):
963+
raise Exception("Some 'cell' col value it out of range. "
964+
"Note: the starting cell is (1, 1)")
965+
958966
# Get inset x domain using grid
959967
x_s = grid[r][c][0] + inset['l'] * width
960968
if inset['w'] == 'to_end':

0 commit comments

Comments
 (0)