Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ed036db

Browse filesBrowse files
committed
Simplify shape check
1 parent 0673de9 commit ed036db
Copy full SHA for ed036db

File tree

Expand file treeCollapse file tree

1 file changed

+3
-8
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-8
lines changed

‎lib/matplotlib/collections.py

Copy file name to clipboardExpand all lines: lib/matplotlib/collections.py
+3-8Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2055,15 +2055,10 @@ def __init__(self, *args, **kwargs):
20552055
# end of signature deprecation code
20562056

20572057
super().__init__(**kwargs)
2058+
_api.check_shape((None, None, 2), coordinates=coords)
20582059
self._coordinates = coords
2059-
shape = self._coordinates.shape
2060-
if (self._coordinates.ndim != 3 or shape[-1] != 2):
2061-
raise ValueError(
2062-
"coordinates must be a (N, M, 2) array-like, but got "
2063-
f"{shape}")
2064-
2065-
self._meshWidth = shape[1] - 1
2066-
self._meshHeight = shape[0] - 1
2060+
self._meshWidth = self._coordinates.shape[1] - 1
2061+
self._meshHeight = self._coordinates.shape[0] - 1
20672062
self._antialiased = antialiased
20682063
self._shading = shading
20692064

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.