MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_exact_extents

Function test_exact_extents

lib/matplotlib/tests/test_path.py:109–119  ·  view source on GitHub ↗
(path, extents)

Source from the content-addressed store, hash-verified

107
108@pytest.mark.parametrize('path, extents', zip(_test_paths, _test_path_extents))
109def test_exact_extents(path, extents):
110 # notice that if we just looked at the control points to get the bounding
111 # box of each curve, we would get the wrong answers. For example, for
112 # hard_curve = Path([[0, 0], [1, 0], [1, 1], [0, 1]],
113 # [Path.MOVETO, Path.CURVE4, Path.CURVE4, Path.CURVE4])
114 # we would get that the extents area (0, 0, 1, 1). This code takes into
115 # account the curved part of the path, which does not typically extend all
116 # the way out to the control points.
117 # Note that counterintuitively, path.get_extents() returns a Bbox, so we
118 # have to get that Bbox's `.extents`.
119 assert np.all(path.get_extents().extents == extents)
120
121
122@pytest.mark.parametrize('ignored_code', [Path.CLOSEPOLY, Path.STOP])

Callers

nothing calls this directly

Calls 1

get_extentsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…