Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Add test_quiver in test_datetime.py#27407
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -446,11 +446,20 @@ def test_plot_date(self): | ||
ax2.plot_date(x_dates, y_ranges) | ||
ax3.plot_date(x_ranges, y_dates) | ||
@mpl.style.context("default") | ||
def test_quiver(self): | ||
dates = [datetime.datetime(2023, 1, 1) + datetime.timedelta(days=i) | ||
for i in range(5)] | ||
x = dates | ||
y = np.zeros_like(x, dtype=float) | ||
u = np.sin(np.arange(len(x))) | ||
v = np.cos(np.arange(len(x))) | ||
fig, ax = plt.subplots(figsize=(10, 6)) | ||
ax.quiver(x, y, u, v, scale=20) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. It seems like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Quiver plots typically expect numerical values for u and v (representing vector components), and y is usually a numerical position value. Using datetime objects for these variables would be unconventional and might not work directly with the quiver plot functionality. I think it might be better to maintain the test as is. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I don't really follow the assertion that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I agree that y is not actually different from x here and should be tested, additionally Ido think u/v should be tested with | ||
fig.autofmt_xdate() | ||
ax.set_title('Quiver Plot with Datetime Data') | ||
ax.set_xlabel('Date') | ||
ax.set_ylabel('Y-axis') | ||
@pytest.mark.xfail(reason="Test for quiverkey not written yet") | ||
@mpl.style.context("default") | ||