-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Add datetime testing for boxplot #26986
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
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.
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.
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.
See comments, but the biggest thing is that we are testing our builtin datetime support here, not pandas datetime support.
instance = TestDatetimePlotting() | ||
|
||
|
||
instance.test_boxplot() |
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.
instance = TestDatetimePlotting() | |
instance.test_boxplot() |
This seems to have been put in for testing purposes
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 this i forgot to remove
fig, ax = plt.subplots() | ||
ax.boxplot(...) | ||
|
||
df = pd.DataFrame({'date': pd.to_datetime(['2023-01-01', '2023-02-01', '2023-03-01', '2023-04-01', '2023-05-01']), |
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.
Can we do a numpy/list of datetime object version of this?
We do not want to test Pandas converters here, we want to test our own. (We actually do have a few tests to make sure we don't fully break pandas elsewhere, but that is not the intent of this module)
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.
okay !! I'm gonna change this..
df = pd.DataFrame({'date': pd.to_datetime(['2023-01-01', '2023-02-01', '2023-03-01', '2023-04-01', '2023-05-01']), | ||
'value': [10, 20, 30, 40, 50]}) | ||
plt.figure() | ||
plt.bar(df['value'], df['date']) |
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.
A bar graph is not a boxplot, and therefore does fit this unit test
Also a (vertical) bar graph with date values on the y axis will generally need a bottom
argument as there is nothing about 1970-01-01 that is likely meaningful to the plot you are making.
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'll remove the bar graph..
Please use more specific titles for your PR/commit message; I have modified the title here to be clearer. |
PR summary
I have added the code corresponding screenshots for the boxplot testing function in test_datetime.py file. and completed the portion for Axes.boxplot of issue #26864".
-->
PR checklist