python 3.2 errors on plot close in tests #152

Closed
josef-pkt opened this Issue Feb 29, 2012 · 3 comments

Comments

Projects
None yet
1 participant
Owner

josef-pkt commented Feb 29, 2012

plt.close(fig) in the graphics tests raises an error, python 3.2, matplotlib 1.2.x from Gohlke for Win 64, nose 1.0.0

I don't know if this is a matplotlib bug or we need to change plot tests.

======================================================================
ERROR: Test violinplot and beanplot with the same dataset.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\programs\python32\lib\site-packages\nose-1.0.0-py3.2.egg\nose\case.py", line 188, in runTest
    self.test(*self.arg)
  File "C:\Programs\Python32\lib\site-packages\numpy\testing\decorators.py", line 147, in skipper_func
    return f(*args, **kwargs)
  File "C:\Programs\Python32\lib\site-packages\scikits.statsmodels-0.4.0-py3.2.egg\scikits\statsmodels\graphics\tests\test_boxplots.py", line 33, in test_violinplot_beanplot
    plt.close(fig)
  File "C:\Programs\Python32\lib\site-packages\matplotlib\pyplot.py", line 433, in close
    _pylab_helpers.Gcf.destroy_fig(arg)
  File "C:\Programs\Python32\lib\site-packages\matplotlib\_pylab_helpers.py", line 75, in destroy_fig
    for manager in Gcf.figs.values():
RuntimeError: dictionary changed size during iteration
Owner

josef-pkt commented Feb 29, 2012

I didn't get the error for the plots in test_var, which close plots with

def close_plots():
    try:
        import matplotlib.pyplot as plt
        plt.close('all')
    except ImportError:
        pass
Owner

josef-pkt commented Feb 29, 2012

replacing plt.close(fig) with plt.close('all') removes the test errors in python 3.2

Owner

josef-pkt commented Mar 15, 2012

bug was already fixed in matplotlib master for python 3

http://comments.gmane.org/gmane.comp.python.matplotlib.general/29946

could revert to plt.close(fig) with newer installer

josef-pkt closed this Mar 15, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment