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

Function test_cleanup_closepoly

lib/matplotlib/tests/test_path.py:593–613  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

591
592
593def test_cleanup_closepoly():
594 # if the first connected component of a Path ends in a CLOSEPOLY, but that
595 # component contains a NaN, then Path.cleaned should ignore not just the
596 # control points but also the CLOSEPOLY, since it has nowhere valid to
597 # point.
598 paths = [
599 Path([[np.nan, np.nan], [np.nan, np.nan]],
600 [Path.MOVETO, Path.CLOSEPOLY]),
601 # we trigger a different path in the C++ code if we don't pass any
602 # codes explicitly, so we must also make sure that this works
603 Path([[np.nan, np.nan], [np.nan, np.nan]]),
604 # we should also make sure that this cleanup works if there's some
605 # multi-vertex curves
606 Path([[np.nan, np.nan], [np.nan, np.nan], [np.nan, np.nan],
607 [np.nan, np.nan]],
608 [Path.MOVETO, Path.CURVE3, Path.CURVE3, Path.CLOSEPOLY])
609 ]
610 for p in paths:
611 cleaned = p.cleaned(remove_nans=True)
612 assert len(cleaned) == 1
613 assert cleaned.codes[0] == Path.STOP
614
615
616def test_interpolated_moveto():

Callers

nothing calls this directly

Calls 2

PathClass · 0.90
cleanedMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…