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

Skip to content

Remove test_spy from test_datetime.py #27392

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

Merged
merged 4 commits into from
Dec 1, 2023
Merged

Conversation

rawwash
Copy link
Contributor

@rawwash rawwash commented Nov 29, 2023

PR summary

Removing the test_spy for datetime, since does not make sense for unitful data. Spy is related to plotting at array indices, and provides no way of setting the x and y values to non-integer data.

Therefore, this PR aims to remove test_spy.

PR checklist

Comment on lines 497 to 505
data = np.random.rand(10, 10)
data[data < 0.9] = 0
fig, ax = plt.subplots()
sp = ax.spy(data)
ax.set_title('Spy Plot Test')
ax.set_xlabel('Column Index')
ax.set_ylabel('Row Index')
assert sp is not None, "Failed to create spy plot"
plt.close(fig)
Copy link
Member

Choose a reason for hiding this comment

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

This does not use datetime

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Understood, I have redone it with datetime functionality.

@ksunden
Copy link
Member

ksunden commented Nov 29, 2023

I do not think that spy makes sense for unitful data. It is explicitly about plotting at array indices, and provides no way of setting the x and y values to non-integer data.

Therefore, I think the course of action for this method in particular is to simply remove the test template

@rawwash
Copy link
Contributor Author

rawwash commented Nov 29, 2023

Ok, sounds good I can remove the test.

@rawwash rawwash changed the title Added test_spy in test_datetime.py Removing test_spy in test_datetime.py Nov 29, 2023
@QuLogic QuLogic changed the title Removing test_spy in test_datetime.py Remove test_spy from test_datetime.py Dec 1, 2023
@QuLogic QuLogic merged commit 0117642 into matplotlib:main Dec 1, 2023
@QuLogic QuLogic added this to the v3.9.0 milestone Dec 1, 2023
@QuLogic
Copy link
Member

QuLogic commented Dec 1, 2023

Thanks @rawwash! Congratulations on your first PR to Matplotlib 🎉 We hope to hear from you again.

Note that I squash merged this PR, as there was no need for the separate commits.

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.

3 participants