-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Add test for remaining axis options #24668
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
cfbbb65
to
378ce5b
Compare
Since these options talk about making circles circular, I wonder if it might be clearer to plot circles here? |
378ce5b
to
bffd42a
Compare
I've added a circle as well. Cannot really find a case where |
def test_axis_options(): | ||
fig, axes = plt.subplots(2, 3) | ||
for i, option in enumerate(('scaled', 'tight', 'image')): | ||
axes[0, i].plot((1, 2), (1, 3.2)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's thd difference between the top and bottom tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aspect ratio.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that a relevant parameter to test? I would have expected that the code paths are the same.
If it is, please add comments á la # aspect ratio > 1
to both parts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure. I guess one can get weird behavior for one of the cases, but have not checked the code paths.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the aspect ratio coming from just the autoscaling on the line?
Testing both of these seems relevant, the Do What I Mean code tends to be full of (and grow) special cases so (low fidelity) fuzz testing is reasonable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that is my impression. It will at least not consider a large circle.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some confusion about how the aspect ratio is being controlled. The confusion is enough I do not want to push the green button, but little enough I am 👍 on someone who does not feel confused pushing the button.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you stick some comments in the test about why the different values being plotted are chosen? Appreciate this is testing new code so is valuable as is (and I won't blcok), but the test without any comments is a bit confusing to me.
2d0cf38
to
40751cb
Compare
I've added a bit of comments. The idea was basically to just try it with a few different scenarios to make sure that we do not break it later. At least not unless it is on purpose. (Also, I like high coverage numbers...) |
PR Summary
These three were not tested.
Selected data so that they would show up slightly different at least.PR Checklist
Documentation and Tests
pytest
passes)Release Notes
.. versionadded::
directive in the docstring and documented indoc/users/next_whats_new/
.. versionchanged::
directive in the docstring and documented indoc/api/next_api_changes/
next_whats_new/README.rst
ornext_api_changes/README.rst