statsmodels / statsmodels

Statsmodels: statistical modeling and econometrics in Python
http://www.statsmodels.org/devel/
BSD 3-Clause "New" or "Revised" License
9.77k stars 2.85k forks source link

BUG/TST statespace pickling error in statsmodels 0.8 #3892

Closed josef-pkt closed 5 years ago

josef-pkt commented 6 years ago

new Debian bug report

with cython 2.6 and statsmodels version 0.8 there is no error in master with cython 2.6, so this must be fixed by the statespace refactoring in master

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=873512 4 cases like the following

======================================================================
ERROR: statsmodels.tsa.statespace.tests.test_save.test_sarimax
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/build/1st/statsmodels-0.8.0/debian/python-statsmodels/usr/lib/python2.7/dist-packages/statsmodels/tsa/statespace/tests/test_save.py", line 22, in test_sarimax
    res.save('test_save_sarimax.p')
  File "/build/1st/statsmodels-0.8.0/debian/python-statsmodels/usr/lib/python2.7/dist-packages/statsmodels/base/wrapper.py", line 72, in save
    save_pickle(self, fname)
  File "/build/1st/statsmodels-0.8.0/debian/python-statsmodels/usr/lib/python2.7/dist-packages/statsmodels/iolib/smpickle.py", line 15, in save_pickle
    cPickle.dump(obj, fout, protocol=-1)
  File "stringsource", line 2, in statsmodels.tsa.statespace._statespace.zStatespace.__reduce_cython__
TypeError: self._design,self._initial_state,self._initial_state_cov,self._obs,self._obs_cov,self._obs_intercept,self._selected_state_cov,self._selection,self._state_cov,self._state_intercept,self._transition cannot be converted to a Python object for pickling
bashtage commented 6 years ago

Didn't I fix this in master?

josef-pkt commented 6 years ago

@bashtage Thanks, with that hint I found the PR

It looks like #3402 hasn't been backported and is not included in 0.8, but I don't know if it would apply to 0.8 (given the statespace refactoring). also Debian uses python 2.7 and I don't see whether #3402 is only relevant for python 3.6.

Based on the Debian report it looks like it only showed up after upgrading cython

tillea commented 6 years ago

Hi, I was watching at the Debian bug report which causes some pressure due to several packages depending from statsmodels. Is there any solution at the horizon?

bashtage commented 6 years ago

It is fixed in Master and will be fixed in 0.9. I don't know what the release target is for that though.

On Tue, Sep 26, 2017, 07:45 Andreas Tille notifications@github.com wrote:

Hi, I was watching at the Debian bug report which causes some pressure due to several packages depending from statsmodels. Is there any solution at the horizon?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/statsmodels/statsmodels/issues/3892#issuecomment-332102209, or mute the thread https://github.com/notifications/unsubscribe-auth/AFU5ReHhF4BzXHWbkX-D1JcOI_FdfjPzks5smJ1tgaJpZM4PFOfD .

tillea commented 6 years ago

Hi Kevin, On Tue, Sep 26, 2017 at 06:58:30AM +0000, Kevin Sheppard wrote:

It is fixed in Master and will be fixed in 0.9. Cool. Could you point to the actual commit which would enable us to backport the fix more easily? Thanks a lot, Andreas.

-- http://fam-tille.de

bashtage commented 6 years ago

https://github.com/statsmodels/statsmodels/commit/f81cde31421288e669e859d0e798d843ca2ecabe

On Tue, 26 Sep 2017 at 08:11, Andreas Tille notifications@github.com wrote:

Hi Kevin, On Tue, Sep 26, 2017 at 06:58:30AM +0000, Kevin Sheppard wrote:

It is fixed in Master and will be fixed in 0.9. Cool. Could you point to the actual commit which would enable us to backport the fix more easily? Thanks a lot, Andreas.

-- http://fam-tille.de

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/statsmodels/statsmodels/issues/3892#issuecomment-332107262, or mute the thread https://github.com/notifications/unsubscribe-auth/AFU5RTwDLvuDuqW96l4t6xWXbhdEzX1-ks5smKOKgaJpZM4PFOfD .

bashtage commented 6 years ago

https://github.com/statsmodels/statsmodels/commit/f81cde31421288e669e859d0e798d843ca2ecabe

bashtage commented 5 years ago

@ChadFulton Fixed.

ChadFulton commented 5 years ago

Thanks @bashtage