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

Skip to content

Add datetime testing for boxplot #27038

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 2 commits into
base: main
Choose a base branch
from

Conversation

ayushrathore111
Copy link

@ayushrathore111 ayushrathore111 commented Oct 9, 2023

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"
this is the screenshot of boxplot by given code..
boxplot_final

-->

PR checklist

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.

We'd prefer to use the axes interface over the plt methods for this test.

Also I'd like to see another axes that shows a vert=False boxplot to make sure that the unit handling works for horizontal boxplots.

Could also argue for positions to be given as datetimes (in another plot...) to make sure that it handles that as well.

Comment on lines +97 to +98
datums = np.array([datetime.datetime.toordinal(d) for d in data])
plt.boxplot(datums, labels=['my data'], showfliers=True)
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
datums = np.array([datetime.datetime.toordinal(d) for d in data])
plt.boxplot(datums, labels=['my data'], showfliers=True)
plt.boxplot(data, labels=['my data'], showfliers=True)

We actually very specifically want the datetimes passed into the plotting methods here. as it stands, this test is not actually testing the unit conversion at all.

@shriyakalakata
Copy link
Contributor

Since this PR has been inactive for over two months, can I create a new PR using advice from the comment on #27485 :

"I think it could translate well to physical units, so perhaps we should make it so that at least we try to adhere to the units behavior..."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs review
Development

Successfully merging this pull request may close these issues.

4 participants