Skip to content

TST: failing builds on master #14808

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

Closed
1 of 2 tasks
jreback opened this issue Dec 6, 2016 · 15 comments
Closed
1 of 2 tasks

TST: failing builds on master #14808

jreback opened this issue Dec 6, 2016 · 15 comments
Labels
Testing pandas testing functions or related to the test suite
Milestone

Comments

@jreback
Copy link
Contributor

jreback commented Dec 6, 2016

======================================================================
FAIL: test_bar_log_no_subplots (pandas.tests.plotting.test_frame.TestDataFramePlots)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/pandas-dev/pandas/pandas/tests/plotting/test_frame.py", line 1130, in test_bar_log_no_subplots
    tm.assert_numpy_array_equal(ax.yaxis.get_ticklocs(), expected)
  File "/home/travis/build/pandas-dev/pandas/pandas/util/testing.py", line 1079, in assert_numpy_array_equal
    _raise(left, right, err_msg)
  File "/home/travis/build/pandas-dev/pandas/pandas/util/testing.py", line 1062, in _raise
    .format(obj), left.shape, right.shape)
  File "/home/travis/build/pandas-dev/pandas/pandas/util/testing.py", line 1018, in raise_assert_detail
    raise AssertionError(msg)
AssertionError: numpy array are different
numpy array shapes are different
[left]:  (5,)
[right]: (4,)
======================================================================
FAIL: test_bar_log_subplots (pandas.tests.plotting.test_frame.TestDataFramePlots)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/pandas-dev/pandas/pandas/tests/plotting/test_frame.py", line 1141, in test_bar_log_subplots
    tm.assert_numpy_array_equal(ax[0].yaxis.get_ticklocs(), expected)
  File "/home/travis/build/pandas-dev/pandas/pandas/util/testing.py", line 1079, in assert_numpy_array_equal
    _raise(left, right, err_msg)
  File "/home/travis/build/pandas-dev/pandas/pandas/util/testing.py", line 1062, in _raise
    .format(obj), left.shape, right.shape)
  File "/home/travis/build/pandas-dev/pandas/pandas/util/testing.py", line 1018, in raise_assert_detail
    raise AssertionError(msg)
AssertionError: numpy array are different
numpy array shapes are different
[left]:  (7,)
[right]: (6,)
======================================================================
FAIL: test_bar_log (pandas.tests.plotting.test_series.TestSeriesPlots)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/pandas-dev/pandas/pandas/tests/plotting/test_series.py", line 207, in test_bar_log
    tm.assert_numpy_array_equal(ax.yaxis.get_ticklocs(), expected)
  File "/home/travis/build/pandas-dev/pandas/pandas/util/testing.py", line 1079, in assert_numpy_array_equal
    _raise(left, right, err_msg)
  File "/home/travis/build/pandas-dev/pandas/pandas/util/testing.py", line 1062, in _raise
    .format(obj), left.shape, right.shape)
  File "/home/travis/build/pandas-dev/pandas/pandas/util/testing.py", line 1018, in raise_assert_detail
    raise AssertionError(msg)
AssertionError: numpy array are different
numpy array shapes are different
[left]:  (7,)
[right]: (6,)
----------------------------------------------------------------------
Ran 252 tests in 1103.335s
======================================================================
ERROR: test_scalar_na_cmp_corners (pandas.tests.series.test_operators.TestSeriesOperators)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/pandas-dev/pandas/pandas/core/ops.py", line 1170, in na_op
    raise_on_error=True, **eval_kwargs)
  File "/home/travis/build/pandas-dev/pandas/pandas/computation/expressions.py", line 210, in evaluate
    **eval_kwargs)
  File "/home/travis/build/pandas-dev/pandas/pandas/computation/expressions.py", line 63, in _evaluate_standard
    return op(a, b)
TypeError: unsupported operand type(s) for &: 'float' and 'float'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/travis/build/pandas-dev/pandas/pandas/core/internals.py", line 1160, in eval
    result = get_result(other)
  File "/home/travis/build/pandas-dev/pandas/pandas/core/internals.py", line 1129, in get_result
    result = func(values, other)
  File "/home/travis/build/pandas-dev/pandas/pandas/core/ops.py", line 1179, in na_op
    yrav = yrav[mask]
IndexError: boolean index did not match indexed array along dimension 0; dimension is 1 but corresponding boolean dimension is 9
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/travis/build/pandas-dev/pandas/pandas/tests/series/test_operators.py", line 1417, in test_scalar_na_cmp_corners
    self.assertRaises(ValueError, lambda: d.__and__(s, axis='columns'))
  File "/home/travis/build/pandas-dev/pandas/pandas/util/testing.py", line 2380, in assertRaises
    _callable(*args, **kwargs)
  File "/home/travis/build/pandas-dev/pandas/pandas/tests/series/test_operators.py", line 1417, in <lambda>
    self.assertRaises(ValueError, lambda: d.__and__(s, axis='columns'))
  File "/home/travis/build/pandas-dev/pandas/pandas/core/ops.py", line 1223, in f
    return self._combine_series(other, na_op, fill_value, axis, level)
  File "/home/travis/build/pandas-dev/pandas/pandas/core/frame.py", line 3539, in _combine_series
    fill_value=fill_value)
  File "/home/travis/build/pandas-dev/pandas/pandas/core/frame.py", line 3573, in _combine_match_columns
    axes=[left.columns, self.index])
  File "/home/travis/build/pandas-dev/pandas/pandas/core/internals.py", line 3163, in eval
    return self.apply('eval', **kwargs)
  File "/home/travis/build/pandas-dev/pandas/pandas/core/internals.py", line 3057, in apply
    applied = getattr(b, f)(**kwargs)
  File "/home/travis/build/pandas-dev/pandas/pandas/core/internals.py", line 1167, in eval
    result = handle_error()
  File "/home/travis/build/pandas-dev/pandas/pandas/core/internals.py", line 1150, in handle_error
    (repr(other), str(detail)))  # noqa
TypeError: Could not operate array([nan], dtype=object) with block values boolean index did not match indexed array along dimension 0; dimension is 1 but corresponding boolean dimension is 9
----------------------------------------------------------------------
@jreback jreback added the Testing pandas testing functions or related to the test suite label Dec 6, 2016
@jreback jreback added this to the 0.19.2 milestone Dec 6, 2016
@jorisvandenbossche
Copy link
Member

jorisvandenbossche commented Dec 6, 2016

The first ones (plotting failures) started due to PR #14747, although the PR looks unrelated (and only started failing on the master branch, not in the PR)

@jorisvandenbossche
Copy link
Member

It's probably matplotlib 2.0.0b4 -> 2.0.0rc1 that is the culprit (that's a difference between the failing and passing builds)

@jorisvandenbossche
Copy link
Member

jorisvandenbossche commented Dec 6, 2016

@tacaswell

matplotlib 1.5.2:

In [2]: matplotlib.__version__
Out[2]: '1.5.2'

In [3]: df = pd.DataFrame({'A': [3] * 5, 'B': range(1, 6)}, index=range(5))

In [6]: ax = df.plot(kind='bar', grid=True, log=True)

In [7]: ax.yaxis.get_ticklocs()
Out[7]: array([   0.1,    1. ,   10. ,  100. ])

In [8]: [t.get_text() for t in ax.yaxis.get_ticklabels()]
Out[8]: ['', '$\\mathdefault{10^{0}}$', '$\\mathdefault{10^{1}}$', '']

logscale_1 5 3

matplotlib 2.0.0b4:

In [3]: matplotlib.__version__
Out[3]: '2.0.0b4'

In [4]: df = pd.DataFrame({'A': [3] * 5, 'B': range(1, 6)}, index=range(5))

In [5]: ax = df.plot(kind='bar', grid=True, log=True)

In [6]: ax.yaxis.get_ticklocs()
Out[6]: array([   0.1,    1. ,   10. ,  100. ])

In [7]: [t.get_text() for t in ax.yaxis.get_ticklabels()]
Out[7]: ['', '${10^{0}}$', '', '']

logscale_2 0 0b4

With matplotlib 2.0.0rc1

In [3]: matplotlib.__version__
Out[3]: '2.0.0rc1'

In [4]: df = pd.DataFrame({'A': [3] * 5, 'B': range(1, 6)}, index=range(5))

In [5]: ax = df.plot(kind='bar', grid=True, log=True)

In [6]: ax.yaxis.get_ticklocs()
Out[6]: 
array([  1.00000000e-02,   1.00000000e-01,   1.00000000e+00,
         1.00000000e+01,   1.00000000e+02])

In [7]: [t.get_text() for t in ax.yaxis.get_ticklabels()]
Out[7]: ['', '', '${10^{0}}$', '', '']

logscale_2 0 0rc1

I suppose the change in the labels is intentional? ("vastly improved log scale ticks" in your rc1 announcement email. By the way, although you put this in your email as one of the highlights, it is almost not mentioned in the "What's new" / "Changes to the default style" documents)
But, is the fact that the ticklocs now are one element longer (and include two values for which there is no label at the start) also intentional? If so, we will just adjust our tests, that's no problem.

@jorisvandenbossche
Copy link
Member

@tacaswell Can you give a quick confirmation that this change is intentional? (or not) Then I just adapt our tests.

@tacaswell
Copy link
Contributor

Sorry it took me so long to respond, this got lost in the wall of gh notifications I get 😞. I got behind about a month ago and am slowly digging my self back out. In the future, if you need my attention for pandas related plotting issues and I am not responding on GH feel free to escalate communication channels.

The extra tick labels are intentional, the lack of write up in the what's new is because our doc-writing is behind our code writing.

The space at the bottom is not

so

@jorisvandenbossche
Copy link
Member

@tacaswell No problem!
Just to check: the space at the bottom was a bug that is solved since rc1? The extra minor ticklabels are indeed intentional, but was the extra major tickloc at 0.01 (without label) a consequence of the erroneous space? Or was this intentional as well.

Sorry for the questions, I currently don't have a master version of matplotlib, only the tagged rc, installed.

@tacaswell
Copy link
Contributor

In [1]: import pandas as pd

In [2]: import matplotlib.pyplot as plt
plt.i
In [3]: plt.ion()

In [4]: df = pd.DataFrame({'A': [3] * 5, 'B': range(1, 6)}, index=range(5))

In [5]: ax = df.plot(kind='bar', grid=True, log=True)

In [6]: ax.yaxis.get_ticklocs()
Out[6]: array([   0.1,    1. ,   10. ,  100. ])

In [7]: [t.get_text() for t in ax.yaxis.get_ticklabels()]
Out[7]: ['', '${10^{0}}$', '', '']

In [8]: plt.matplotlib.__version__
Out[8]: '2.0.0rc1.post77+gf99ae8b'

I think the not-visible ticks are something we consider a private detail (or maybe I just wish they were a private detail 😉 ).

attn @efiring

@tacaswell
Copy link
Contributor

Assuming my internet comes back overnight, there should be an rc2 tomorrow.

@efiring
Copy link

efiring commented Dec 18, 2016

The problem here is that when we call the LogLocator, it returns a much larger range than needed. That range has probably increased--I suspect for no good reason, but I'm not positive. The axis.get_ticklocs() just passes on what it gets from the locator, so this is hardly what a user would expect from a public method with a name like that. The trimming to fit the view limits doesn't happen until draw time, in _update_ticks(). (Actually, that method is called more than once, which seems inefficient.)
I suspect there are many opportunities for rationalization and optimization in this whole sequence, but it's a big job.
Apart from the change in the amount of range overshoot, which is partly a result of the change in default margin strategy, it looks like all of this has been largely unchanged for years.

I think the upshot for now, with respect to this Pandas test, is that the tick locations returned by get_ticklocs have changed, and may change again. If they are to be used in a test, then the test itself needs to trim off any that are outside the view limits.

@jreback jreback modified the milestones: 0.20.0, 0.19.2 Dec 20, 2016
@jreback
Copy link
Contributor Author

jreback commented Dec 21, 2016

@tacaswell looks like 2.0.0rc2 did something: https://travis-ci.org/pandas-dev/pandas/jobs/185737365 (didn't fix though)

@jorisvandenbossche
Copy link
Member

jorisvandenbossche commented Dec 22, 2016

Tried with rc2, and I get the same figure as @tacaswell showed above for rc1.post78.

Regarding the new error, I suppose this is due to a fix in rc2 (possibly matplotlib/matplotlib#7598), as the result of ax = pd.Series([0.1, 0.01, 0.001]).plot(log=True, kind='bar') with rc2 is:

figure_1

looks much better than with 1.5.3:

figure_1-1

@jorisvandenbossche
Copy link
Member

PR to fix our test: #14957

@efiring
Copy link

efiring commented Dec 22, 2016

Do you really like that missing third bar with 1.5.3? And the bottom-to-top first bar? I don't.

@jorisvandenbossche
Copy link
Member

@efiring maybe you misinterpreted my wording, but I certainly like the new rc2 plot! :)
That is also the reason that I made a PR that just changes our tests for the new behaviour of rc2

@efiring
Copy link

efiring commented Dec 23, 2016

@jorisvandenbossche, you're right, I completely misread your earlier comment. I'm not sure how I managed that--it was perfectly clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite
Projects
None yet
Development

No branches or pull requests

4 participants