-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
TST: Fix some plotting xfails #55440
Conversation
def test_errorbar_plot_iterator(self): | ||
d = {"x": np.arange(12), "y": np.arange(12, 0, -1)} | ||
df = DataFrame(d) | ||
|
||
# yerr is iterator | ||
ax = _check_plot_works(df.plot, yerr=itertools.repeat(0.1, len(df))) | ||
ax = _check_plot_works(df.plot, yerr=np.full(len(df), 0.1)) |
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.
Docstring for yerr says array-like; I don't think we should expect an iterator to work.
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.
the test name and comment a line up specifically say iterator. i dont care about iterators either, but someone at some point did this intentionally. may merit a whatsnew if we are officially giving up on this
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.
Thanks - I took another look. This goes back to when the error bars were added in #6834. The issue is actually on our end - we pass kwargs twice to two different subplots and on the 2nd the generator is exhausted. We can fix by making a copy in the test.
It seems to me this could break in the future because the matplotlib docs don't say generators are supported, but we can leave as-is for now.
@@ -303,7 +302,7 @@ def test_uhf(self): | |||
tlocs = axis.get_ticklocs() | |||
tlabels = axis.get_ticklabels() | |||
for loc, label in zip(tlocs, tlabels): | |||
xp = conv._from_ordinal(loc).strftime("%H:%M:%S.%f") | |||
xp = conv._from_ordinal(loc).strftime("%H:%M:%S") |
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.
Confirmed the decimal here is not shown in the label when plotting.
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.
should it be?
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.
Great question. On matplotlib 3.5, the code rs = str(label.get_text())
returns the empty string and the subsequent assert is not ran. On 3.6, we get "21:59:51"
for rs
. In both cases, 21:59:51
is displayed on the resulting plot. So I believe the test was incorrect on our end.
@@ -1339,7 +1337,7 @@ def test_format_date_axis(self): | |||
xaxis = ax.get_xaxis() | |||
for line in xaxis.get_ticklabels(): | |||
if len(line.get_text()) > 0: | |||
assert line.get_rotation() == 30 | |||
assert line.get_rotation() == 0.0 |
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.
The label is not rotated visually.
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.
same, should it be?
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.
Same as the previous - on 3.5 line.get_text()
is returning the empty string. In both 3.5 and 3.6, line.get_rotation()
reports 0.0
, agreeing with the resulting plot.
…to plot_xfails
This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this. |
Still planning on working on this? |
Yes - I would like to get back to this, but not in the next few weeks at least. Taking it off the queue. |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.