Ticket #97 (new defect)
Opened 9 months ago
Error unpickling time series of dicts
| Reported by: | robertf | Owned by: | pierregm |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | timeseries | Version: | |
| Keywords: | pickle | Cc: |
Description
Unpickling a time series which as dicts for data generates an error. This is on OS X 10.6, timeseries version 0.91.3.
Python 2.6.1 (r261:67515, Jul 7 2009, 23:51:51) Type "copyright", "credits" or "license" for more information.
IPython 0.10 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object'. ?object also works, ?? prints more.
In [1]: import scikits.timeseries as ts
In [2]: import pickle
In [3]: sD = ts.Date('d', '2009-01-01')
In [4]: dictTS = ts.time_series(dates=[sD], data=[{'a':1}])
In [5]: dp = pickle.dumps(dictTS)
In [6]: pickle.loads(dp)
TypeError? Traceback (most recent call last)
/Users/TandG/<ipython console> in <module>()
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ pickle.pyc in loads(str)
1372 def loads(str): 1373 file = StringIO(str)
-> 1374 return Unpickler(file).load()
1375 1376 # Doctest
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ pickle.pyc in load(self)
856 while 1: 857 key = read(1)
--> 858 dispatch[key](self)
859 except _Stop, stopinst: 860 return stopinst.value
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/ pickle.pyc in load_build(self)
1215 setstate = getattr(inst, "setstate", None) 1216 if setstate:
-> 1217 setstate(state)
1218 return 1219 slotstate = None
/Library/Python/2.6/site-packages/scikits.timeseries-0.91.3-py2.6- macosx-10.6-universal.egg/scikits/timeseries/tseries.pyc in setstate(self, state)
1303 """ 1304 (ver, shp, typ, isf, raw, msk, flv, dsh, dtm, frq,
infodict) = state -> 1305 MaskedArray?.setstate(self, (ver, shp, typ, isf, raw, msk, flv))
1306 _dates = self._dates 1307 _dates.setstate((dsh, dtype(int_), isf, dtm))
/Library/Python/2.6/site-packages/numpy-1.4.0.dev7542-py2.6- macosx-10.6-universal.egg/numpy/ma/core.pyc in setstate(self, state)
5321 """ 5322 (ver, shp, typ, isf, raw, msk, flv) = state
-> 5323 ndarray.setstate(self, (shp, typ, isf, raw))
5324 self._mask.setstate((shp, make_mask_descr(typ),
isf, msk))
5325 self.fill_value = flv
TypeError?: object pickle not returning list
