def __setstate__(self, state): """Necessary for making this object picklable""" nd_state, own_state = state ndarray.__setstate__(self, nd_state) for attr, val in own_state.items(): setattr(self, attr, val)
def _genTimeSeries(reduce_args, state): import scikits.timeseries.tseries as ts from numpy import ndarray from numpy.ma import MaskedArray time_series = ts._tsreconstruct(*reduce_args) #from setstate modified (ver, shp, typ, isf, raw, msk, flv, dsh, dtm, dtyp, frq, infodict) = state #print 'regenerating %s' % dtyp MaskedArray.__setstate__(time_series, (ver, shp, typ, isf, raw, msk, flv)) _dates = time_series._dates #_dates.__setstate__((ver, dsh, typ, isf, dtm, frq)) #use remote typ ndarray.__setstate__(_dates, (dsh, dtyp, isf, dtm)) _dates.freq = frq _dates._cachedinfo.update( dict(full=None, hasdups=None, steps=None, toobj=None, toord=None, tostr=None)) # Update the _optinfo dictionary time_series._optinfo.update(infodict) return time_series
def __setstate__(self, state): """Necessary for making this object picklable""" nd_state, own_state = state ndarray.__setstate__(self, nd_state) fill_value, sp_index = own_state[:2] self.sp_index = sp_index self.fill_value = fill_value
def __setstate__(self, state): """Necessary for making this object picklable""" nd_state, own_state = state ndarray.__setstate__(self, nd_state) index, fill_value, sp_index = own_state[:3] name = None if len(own_state) > 3: name = own_state[3] self.sp_index = sp_index self.fill_value = fill_value self.index = index self.name = name
def __setstate__(self, state): """ Restores the internal state of the TimeSeries, for pickling purposes. `state` is typically the output of the ``__getstate__`` output, and is a 5-tuple: - class name - a tuple giving the shape of the data - a typecode for the data - a binary string for the data - a binary string for the mask. """ (ver, shp, typ, isf, raw, frq) = state ndarray.__setstate__(self, (shp, typ, isf, raw)) self.freq = frq
def __setstate__(self, state): """ Restores the internal state of the TimeSeries, for pickling purposes. `state` is typically the output of the ``__getstate__`` output, and is a 5-tuple: - class name - a tuple giving the shape of the data - a typecode for the data - a binary string for the data - a binary string for the mask. """ (ver, shp, typ, isf, raw, frq) = state ndarray.__setstate__(self, (shp, typ, isf, raw)) self._unit = frq
def __setstate__(self, state): """Restore the internal state of the masked array, for pickling purposes. ``state`` is typically the output of the ``__getstate__`` output, and is a 5-tuple: - class name - a tuple giving the shape of the data - a typecode for the data - a binary string for the data - a binary string for the mask. """ (ver, shp, typ, isf, raw, msk, flv) = state ndarray.__setstate__(self, (shp, typ, isf, raw)) mdtype = dtype([(k, bool_) for (k, _) in self.dtype.descr]) self.__dict__['_mask'].__setstate__((shp, mdtype, isf, msk)) self.fill_value = flv
def _genTimeSeries(reduce_args, state): import scikits.timeseries.tseries as ts from numpy import ndarray from numpy.ma import MaskedArray time_series = ts._tsreconstruct(*reduce_args) # from setstate modified (ver, shp, typ, isf, raw, msk, flv, dsh, dtm, dtyp, frq, infodict) = state # print 'regenerating %s' % dtyp MaskedArray.__setstate__(time_series, (ver, shp, typ, isf, raw, msk, flv)) _dates = time_series._dates # _dates.__setstate__((ver, dsh, typ, isf, dtm, frq)) #use remote typ ndarray.__setstate__(_dates, (dsh, dtyp, isf, dtm)) _dates.freq = frq _dates._cachedinfo.update(dict(full=None, hasdups=None, steps=None, toobj=None, toord=None, tostr=None)) # Update the _optinfo dictionary time_series._optinfo.update(infodict) return time_series
def __setstate__(self, state): (version, shp, typ, isf, raw) = state ndarray.__setstate__(self, (shp, typ, isf, raw))
def __setstate__(self, state): """Necessary for making this object picklable""" nd_state, own_state = state ndarray.__setstate__(self, nd_state) index, = own_state self.index = index
def __setstate__(self, p): ndarray.__setstate__(self, p[0]) self.units = p[1] self.symbol = p[2]