8000 Add more tests for mplot3d by oscargus · Pull Request #23453 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Add more tests for mplot3d #23453

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 1, 2022
Merged

Conversation

oscargus
Copy link
Member
@oscargus oscargus commented Jul 20, 2022

PR Summary`

Added tests for a bunch of mplot3d code.

Removed get_frame_on and set_frame_on as they can be inherited (only difference is the . As I did not really see the effect of them, I also removed the use in the draw method. I tried to check back, but couldn't really figure out why it was forced to another value there. Seems a bit doubtful.

In the margins method, the logic for raising was changed. Currently, passing e.g. margins(1, x=2) was allowed, setting all the margins to 1 without any type of information. Now it raises instead. Not sure if that is the idea, but it seems to make more sense considering the error message and expected usage. Actually, the same thing happens in the standard margins method as well...

if margins and x is not None and y is not None:
raise TypeError('Cannot pass both positional and keyword '
'arguments for x and/or y.')

PR Checklist

Tests and Styling

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

Documentation

  • [N/A] New features are documented, with examples if plot related.
  • [N/A] New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • [N/A] API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).
  • [N/A] Documentation is sphinx and numpydoc compliant (the docs should build without error).

@WeatherGod
Copy link
Member

Is there a test that verifies turning the panes on and off works?

@oscargus
Copy link
Member Author

Is there a test that verifies turning the panes on and off works?

No, there isn't as far as I can tell. And it doesn't really seem like it does work (as far as I can tell). I will revert those changes and just keep the coverage increase. Will see if I can get that working (or at least test it) in another PR.

@oscargus oscargus changed the title Add tests for mplot3d and minor cleanup Add more tests for mplot3d Jul 29, 2022
x = np.arange(10)
ax.plot(x, np.sin(x))
fig.canvas.draw()
assert ax.get_axis_position() == (False, True, False)
Copy link
Member

Choose a reason for hiding this comment

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

If you understand what this does, it could do with a docstring. It appears unused though.

Copy link
Member Author

Choose a reason for hiding this comment

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

I cannot really say that I do, no...

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe it should be deprecated? This was deprecated as a renderer property in 3.4 and removed now: https://github.com/matplotlib/matplotlib/blob/main/doc/api/next_api_changes/removals/00001-DS.rst

@tacaswell tacaswell added this to the v3.6.0 milestone Aug 1, 2022
@tacaswell
Copy link
Member

The docs failure is the sphinx-gallery issue with resetting the units registry, merging over the failure.

@tacaswell tacaswell merged commit b45025d into matplotlib:main Aug 1, 2022
@oscargus oscargus deleted the mplot3dtests branch August 1, 2022 22:33
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.

4 participants
0