예제 #1
0
파일: frame.py 프로젝트: zhouy5/pims
    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)
예제 #2
0
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
예제 #3
0
파일: array.py 프로젝트: tdhock/pandas
    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
예제 #4
0
    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
예제 #5
0
파일: series.py 프로젝트: ricarpor/pandas
    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
예제 #6
0
    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
예제 #7
0
    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
예제 #8
0
    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
예제 #9
0
    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
예제 #10
0
파일: mrecords.py 프로젝트: shmuller/numpy
    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
예제 #11
0
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
예제 #12
0
 def __setstate__(self, state):
     (version, shp, typ, isf, raw) = state
     ndarray.__setstate__(self, (shp, typ, isf, raw))
예제 #13
0
파일: series.py 프로젝트: willgrass/pandas
 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
예제 #14
0
파일: series.py 프로젝트: jlsandell/pandas
 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
예제 #15
0
 def __setstate__(self, p):
     ndarray.__setstate__(self, p[0])
     self.units = p[1]
     self.symbol = p[2]