Skip to content

Test failure with matplotlib 1.5.2rc2 on Debian #13570

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
olebole opened this issue Jul 5, 2016 · 9 comments
Closed

Test failure with matplotlib 1.5.2rc2 on Debian #13570

olebole opened this issue Jul 5, 2016 · 9 comments
Labels
Testing pandas testing functions or related to the test suite Visualization plotting
Milestone

Comments

@olebole
Copy link

olebole commented Jul 5, 2016

When running the test suite after the package was built, we get the following failure:

ERROR: test_plot (pandas.tests.test_graphics.TestDataFramePlots)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/$BUILD/debian/tmp/usr/lib/python2.7/dist-packages/pandas/tests/test_graphics.py", line 1322, in test_plot
    df.plot.line(blarg=True)
  File "/$BUILD/debian/tmp/usr/lib/python2.7/dist-packages/pandas/tools/plotting.py", line 3758, in line
    return self(kind='line', x=x, y=y, **kwds)
[...]
  File "/$BUILD/debian/tmp/usr/lib/python2.7/dist-packages/pandas/tools/plotting.py", line 1340, in _plot
    return ax.plot(*args, **kwds)
  File "/usr/lib/python2.7/dist-packages/matplotlib/__init__.py", line 1821, in inner
    return func(ax, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/matplotlib/axes/_axes.py", line 1432, in plot
    for line in self._get_lines(*args, **kwargs):
  File "/usr/lib/python2.7/dist-packages/matplotlib/axes/_base.py", line 381, in _grab_next_args
    for seg in self._plot_args(remaining, kwargs):
  File "/usr/lib/python2.7/dist-packages/matplotlib/axes/_base.py", line 369, in _plot_args
    seg = func(x[:, j % ncx], y[:, j % ncy], kw, kwargs)
  File "/usr/lib/python2.7/dist-packages/matplotlib/axes/_base.py", line 276, in _makeline
    seg = mlines.Line2D(x, y, **kw)
  File "/usr/lib/python2.7/dist-packages/matplotlib/lines.py", line 380, in __init__
    self.update(kwargs)
  File "/usr/lib/python2.7/dist-packages/matplotlib/artist.py", line 859, in update
    raise AttributeError('Unknown property %s' % k)
AttributeError: Unknown property blarg

Full log here (from the Debian bug report).

pandas.show_versions() gives:

INSTALLED VERSIONS
------------------
commit: None
python: 2.7.12.final.0
python-bits: 64
OS: Linux
OS-release: 4.6.0-1-amd64
machine: x86_64
processor: 
byteorder: little
LC_ALL: C
LANG: C

pandas: 0.18.0+git114-g6c692ae
nose: 1.3.7
pip: None
setuptools: 20.10.1
Cython: None
numpy: 1.11.1rc1
scipy: 0.17.1
statsmodels: 0.6.1
xarray: None
IPython: None
sphinx: 1.4.4
patsy: 0.4.1
dateutil: 2.4.2
pytz: 2015.7
blosc: None
bottleneck: None
tables: 3.2.2
numexpr: 2.6.0
matplotlib: 1.5.2rc2
openpyxl: 2.3.0
xlrd: 1.0.0
xlwt: 0.7.5
xlsxwriter: None
lxml: 3.6.0
bs4: 4.4.1
html5lib: 0.999
httplib2: None
apiclient: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.8
boto: None
pandas_datareader: None
@sinhrks
Copy link
Member

sinhrks commented Jul 5, 2016

Thanks for the report. Looks to be caused by mpl which raises AttributeError rather than TypeError. Should change the test on pandas side.

Appreciated to submit a PR.

@sinhrks sinhrks added Testing pandas testing functions or related to the test suite Visualization plotting labels Jul 5, 2016
@jorisvandenbossche jorisvandenbossche added this to the 0.18.2 milestone Jul 5, 2016
@olebole
Copy link
Author

olebole commented Jul 6, 2016

line 1333

Shall this be compatible with matplotlib < 1.5.2rc? Then this is not that simple, since tm.assertRaises() only accepts a singe exception, and one then would need to create another mpl_ge_1_5_2 comparison specifically for this test.
Is this really worth it? What is the rationale of the test?

@jorisvandenbossche
Copy link
Member

cc @tacaswell Just to be sure, the change from TypeError to AttributeError, was this on purpose? (it's raised in set_lineprops)

@tacaswell
Copy link
Contributor

I do not think that was intentional and I am not sure off the top of my head why this changed. The Artist.update method has raised AttributeError since 2004.

@tacaswell
Copy link
Contributor

So, I broke this: matplotlib/matplotlib#6175

It looks like we used to have Artist.set which raised TypeError and Artist.update which raised AttributeError (because history). These two code-paths got merged in matplotlib/matplotlib#5599 (also my fault) and we missed the API change in the the exceptions.

Unfortunately I just tagged 1.5.2 last weekend, but have not posted it to pypi or publicized it yet 😞. I am inclined to just document this as an API change, but if you want to lobby for a 1.5.3 fixing this, this is the time to do it!

@jorisvandenbossche
Copy link
Member

I don't think it is that an important change, so leaving (and documenting) it is fine for me (for pandas it is only a test that is broken, and I think you will have a better idea of how big this change is for matploltib users). In any case, I think the AttributeError is more logical.

@olebole
Copy link
Author

olebole commented Jul 7, 2016

@sinhrks @jorisvandenbossche For me the question here is still, what that test is for?

@sinhrks
Copy link
Member

sinhrks commented Jul 7, 2016

can u add _mpl_ge_1_5_2() function like below, then:

if _mpl_ge_1_5_2():
    with tm.assertRaises(AttributeError):
        ...
else:
    with ...

@jorisvandenbossche
Copy link
Member

For me the question here is still, what that test is for?

Well, it tests that if you pass a wrong keyword, that this raises an error, and is not swallowed somewhere in the implementation. So it's not a huge important test, but still useful (we actually have to many functions in pandas that silently swallow invalid arguments)

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 Visualization plotting
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants