Beispiel #1
0
 def __getstate__(self):
     """
     This is required to make the object pickle-able
     """
     
     # Define a dictionary containing everything needed.  
     # Ignore self.parent
     state = self.__dict__.copy()
     state.pop('_parent', None)
     
     # Now handle the possibly large arrays (too large to pickle)
     for key,val in state.iteritems():
         
         if isinstance(val, np.ndarray):
             
             state[key] = ICgen_utils.listify(val, 1001)
             
     return state
Beispiel #2
0
    def __getstate__(self):
        """
        This is required to make the object pickle-able
        """

        # Define a dictionary containing everything needed.
        # Ignore self.parent
        state = self.__dict__.copy()
        state.pop('_parent', None)

        # Now handle the possibly large arrays (too large to pickle)
        for key, val in state.iteritems():

            if isinstance(val, np.ndarray):

                state[key] = ICgen_utils.listify(val, 1001)

        return state