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 65bc68d

Browse filesBrowse files
oscargusmeeseeksmachine
authored andcommitted
Backport PR #26532: Fix input check in Poly3DCollection.__init__
1 parent 2841c76 commit 65bc68d
Copy full SHA for 65bc68d

File tree

2 files changed

+11
-1
lines changed
Filter options

2 files changed

+11
-1
lines changed

‎lib/mpl_toolkits/mplot3d/art3d.py

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/mplot3d/art3d.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,7 @@ def __init__(self, verts, *args, zsort='average', shade=False,
905905
kwargs['edgecolors'] = _shade_colors(
906906
edgecolors, normals, lightsource
907907
)
908-
if facecolors is None and edgecolors in None:
908+
if facecolors is None and edgecolors is None:
909909
raise ValueError(
910910
"You must provide facecolors, edgecolors, or both for "
911911
"shade to work.")

‎lib/mpl_toolkits/mplot3d/tests/test_axes3d.py

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/mplot3d/tests/test_axes3d.py
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2260,3 +2260,13 @@ def test_surface3d_zsort_inf():
22602260

22612261
ax.plot_surface(x, y, z, cmap='jet')
22622262
ax.view_init(elev=45, azim=145)
2263+
2264+
2265+
def test_Poly3DCollection_init_value_error():
2266+
# smoke test to ensure the input check works
2267+
# GH#26420
2268+
with pytest.raises(ValueError,
2269+
match='You must provide facecolors, edgecolors, '
2270+
'or both for shade to work.'):
2271+
poly = np.array([[0, 0, 1], [0, 1, 1], [0, 0, 0]], float)
2272+
c = art3d.Poly3DCollection([poly], shade=True)

0 commit comments

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