8000 Fix missing Patch3DCollection._z_markers_idx by slavoutich · Pull Request #20416 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Fix missing Patch3DCollection._z_markers_idx #20416

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

Conversation

slavoutich
Copy link
Contributor
@slavoutich slavoutich commented Jun 11, 2021

PR Summary

The issue is introduced by commit f888285: attribute Patch3DCollection._z_markers_idx is used within _maybe_depth_shade_and_sort_colors() function, but is never assigned.

The same changes were done in the Path3DCollection class, but there attribute is set correctly within set_3d_properties() function. Assuming this is the expected behaviour, this commit also sets _z_markers_idx in Patch3DCollection.set_3d_properties().

PR Checklist

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (run flake8 on changed files to check).
  • New features are documented, with examples if plot related.
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • Conforms to Matplotlib style conventions (install flake8-docstrings and run flake8 --docstring-convention=all).
  • New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).

The issue is introduced by commit f888285: attribute
`Patch3DCollection._z_markers_idx` is used within
`_maybe_depth_shade_and_sort_colors()` function, but is never assigned.

The same changes were done in the `Path3DCollection` class, but there
attribute is set correctly within `set_3d_properties()` function.
Assuming this is the expected behaviour, this commit also sets
`_z_markers_idx` in `Patch3DCollection.set_3d_properties()`
Copy link
@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a while, please feel free to ping @matplotlib/developers or anyone who has commented on the PR. Most of our reviewers are volunteers and sometimes things fall through the cracks.

You can also join us on gitter for real-time discussion.

For details on testing, writing docs, and our review process, please see the developer guide

We strive to be a welcoming and open project. Please follow our Code of Conduct.

kwant-bot pushed a commit to kwant-project/kwant that referenced this pull request Jun 11, 2021
The issue is in Matplotlib. This is a temporary solution before [1] is merged.

Fixes #407.

[1] matplotlib/matplotlib#20416
@QuLogic QuLogic added this to the v3.4.3 milestone Jun 11, 2021
@QuLogic
Copy link
Member
QuLogic commented Jun 11, 2021

It looks like this is an untested code path. How did you notice this? Would it be possible to convert that code into a test?

LGTM otherwise.

Previously there was an untested path for the case when facecolors array had more then one color.
@slavoutich
Copy link
Contributor Author

How did you notice this?

We have some ancient code, that derived from Patch3DCollection, written years ago probably to work around some bugs in matplotlib, and our own tests started to fail

Would it be possible to convert that code into a test?

I modified test_mplot3d.py::test_patch_collection_modification to enter the failing code path (essentially, setting two face colors instead of one). Pretty sure there is a better way to test it, but figuring out the testing of matplotlib in details is not what I exactly plan to do right now 😃

@slavoutich
Copy link
Contributor Author

I don't get why codecov complains about my changes, seemingly they can't possibly modify the coverage on the parts it tells it does ¯_(ツ)_/¯

@jklymak jklymak merged commit d156771 into matplotlib:master Jun 15, 2021
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Jun 15, 2021
timhoffm added a commit that referenced this pull request Jun 15, 2021
…416-on-v3.4.x

Backport PR #20416 on branch v3.4.x (Fix missing Patch3DCollection._z_markers_idx)
kwant-bot pushed a commit to kwant-project/kwant that referenced this pull request Jun 21, 2021
The issue is in Matplotlib. This is a temporary solution before [1] is merged.

Fixes #407.

[1] matplotlib/matplotlib#20416
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0