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

Skip to content

add test_quiver in test_datetime.py #27547

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

Conversation

Elllllllvin
Copy link

PR summary

I have added a datetime smoketest for Axes.quiver to lib/matplotlib/tests/test_datetime.py. as requested in #26864

It seems like Axes.quiver() allows datatime as the types of parameter X and Y.

I also tested whether U and V can accept the values of the datetime / timedelta, and the answer is no. Firstly, since U and V represent the x and y directional components of the arrow vector, the datetime type seems meaningless. Secondly, after testing, the same bug #27500 will appear, requiring the use of dates.date 2num() for type conversion

(It's my first time actively participating in an open-source project, and I've just opened my first pull request. I've conscientiously adhered to the contributing guidelines throughout the implementation process, and I appreciate your understanding in case of any unintentional mistakes.)

Below is an image of the plot generated from this example code.
test_quiver

PR checklist

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

@dstansby dstansby left a comment

Choose a reason for hiding this comment

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

This looks good to me - just need to remove two extra lines and then I can approve it.

Comment on lines 480 to 481
x_ranges = np.array(range(threshold))
y_ranges = np.array(range(threshold))
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
x_ranges = np.array(range(threshold))
y_ranges = np.array(range(threshold))

These two lines can be removed as they're duplicates of the two lines above.

Copy link
Author

@Elllllllvin Elllllllvin Jan 23, 2024

Choose a reason for hiding this comment

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

Thanks for your reply, I have just removed two extra lines , but the auto-checks seems failed.. it is about Pull Request Labeler / labeler (pull_request_target) , I have tried several times but can't find reasons

Co-authored-by: Elliott Sales de Andrade <[email protected]>
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.

3 participants