MCPcopy Index your code
hub / github.com/plotly/plotly.py / check_sizes

Function check_sizes

_plotly_utils/png.py:277–298  ·  view source on GitHub ↗

Check that these arguments, if supplied, are consistent. Return a (width, height) pair.

(size, width, height)

Source from the content-addressed store, hash-verified

275
276
277def check_sizes(size, width, height):
278 """
279 Check that these arguments, if supplied, are consistent.
280 Return a (width, height) pair.
281 """
282
283 if not size:
284 return width, height
285
286 if len(size) != 2:
287 raise ProtocolError("size argument should be a pair (width, height)")
288 if width is not None and width != size[0]:
289 raise ProtocolError(
290 "size[0] (%r) and width (%r) should match when both are used."
291 % (size[0], width)
292 )
293 if height is not None and height != size[1]:
294 raise ProtocolError(
295 "size[1] (%r) and height (%r) should match when both are used."
296 % (size[1], height)
297 )
298 return size
299
300
301def check_color(c, greyscale, which):

Callers 2

__init__Method · 0.85
from_arrayFunction · 0.85

Calls 1

ProtocolErrorClass · 0.85

Tested by

no test coverage detected