Repository navigation
SWR matplotlib__matplotlib-17851 - #70
richeshgupta wants to merge 3 commits into
Conversation
| """Convert paths from a collection object to 3D segments.""" | ||
|
|
||
| zs = np.broadcast_to(zs, len(paths)) | ||
| if not np.iterable(zs): |
There was a problem hiding this comment.
[MEDIUM] Iterable zs of unmatched length now silently truncates the collection, with no test exercising the boundary
Issue
The new guard passes any iterable zs straight into zip(paths, zs), which truncates at the shorter sequence: zs=[5] now renders only the first path where np.broadcast_to previously expanded it to every path, and wrong-length arrays that previously raised ValueError now silently drop paths. Both new tests pass exactly-matched zs (99 rows for 99 paths) or a scalar, so the length-mismatch boundary is never exercised.
Evidence
CONFIRMED: the removed np.broadcast_to(zs, len(paths)) raised ValueError on length mismatch and broadcast length-1 iterables to all paths, while zip(paths, zs) in the same hunk truncates to min(len(paths), len(zs)).
SWRBench case matplotlib__matplotlib-17851: pinned base 7ed6bc2 to head d3c674c of matplotlib#17851. Benchmark replay, not for merge.