Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Added test for ax.violin #27486

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

tracyqian0720
Copy link

PR summary

Added tests for ax.violin in test_datetime.py, 2 example cases are provided.
Parent issue to expand test coverage see issue #26864

added two randomly generated distribution and plot them with ax.violin()

Screen Shot 2023-12-09 at 3 51 35 PM

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 week or so, please leave a new comment below and that should bring it to our attention. 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.

Copy link
Member

@ksunden ksunden left a comment

Choose a reason for hiding this comment

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

Please do not run an autoformatter on the entire file. this makes it very hard for us to actually see what the changes proposed here are. Please revert all unrelated changes here. (as much as I personally like black style, this project does not use it and we don't like changing large amounts of code for purely stylistic reasons)

This test does not use datetimes, as is the explicit goal of the tests in this file, as such it is not testing what we are setting out to test.

However, I actually think I may err towards just deleting this test, for the reasons laid out in #27485 (comment) (plus the fact that the things I do still want to test are equally tested by testing violinplot)

@@ -755,8 +793,32 @@ def test_triplot(self):
@pytest.mark.xfail(reason="Test for violin not written yet")
@mpl.style.context("default")
def test_violin(self):
fig, ax = plt.subplots()
ax.violin(...)
plt, ax = plt.subplots(1, 1)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
plt, ax = plt.subplots(1, 1)
fig, ax = plt.subplots(1, 1)

This is flagging flake8 because it is reusing the name for pyplot, the idiomatic name for this variable is fig, as it is a Figure object.

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.

2 participants