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

Fix input check in Poly3DCollection.__init__ #26532

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 2 lib/mpl_toolkits/mplot3d/art3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ def __init__(self, verts, *args, zsort='average', shade=False,
kwargs['edgecolors'] = _shade_colors(
edgecolors, normals, lightsource
)
if facecolors is None and edgecolors in None:
if facecolors is None and edgecolors is None:
raise ValueError(
"You must provide facecolors, edgecolors, or both for "
"shade to work.")
Expand Down
10 changes: 10 additions & 0 deletions 10 lib/mpl_toolkits/mplot3d/tests/test_axes3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -2260,3 +2260,13 @@ def test_surface3d_zsort_inf():

ax.plot_surface(x, y, z, cmap='jet')
ax.view_init(elev=45, azim=145)


def test_Poly3DCollection_init_value_error():
# smoke test to ensure the input check works
# GH#26420
with pytest.raises(ValueError,
match='You must provide facecolors, edgecolors, '
'or both for shade to work.'):
poly = np.array([[0, 0, 1], [0, 1, 1], [0, 0, 0]], float)
c = art3d.Poly3DCollection([poly], shade=True)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.