def test_vector_pickle(self):
        x = coda_types.VectorSizeT(tuple(range(10)))
        y = pickle.loads(pickle.dumps(x))
        self.assertEqual(tuple(x), tuple(y))

        x = coda_types.VectorRowColInt(tuple(coda_types.RowColInt(i + 1, i + 2) for i in range(10)))
        y = pickle.loads(pickle.dumps(x))
        self.assertEqual(tuple(x), tuple(y))
Exemple #2
0
    def test_vector_pickle(self):
        x = coda_types.VectorSizeT(tuple(range(10)))
        y = pickle.loads(pickle.dumps(x))
        self.assertEqual(tuple(x), tuple(y))

        x = coda_types.VectorRowColInt(tuple(coda_types.RowColInt(i+1,i+2)
                                             for i in range(10)))
        y = pickle.loads(pickle.dumps(x))
        self.assertEqual(tuple(x), tuple(y))
Exemple #3
0
    def test_RowCol_pickle(self):
        x = coda_types.RowColDouble(1.2, 3.4)
        y = pickle.loads(pickle.dumps(x))
        self.assertEqual(x, y)

        x = coda_types.RowColInt(1, 2)
        y = pickle.loads(pickle.dumps(x))
        self.assertEqual(x, y)

        x = coda_types.RowColSizeT(1, 2)
        y = pickle.loads(pickle.dumps(x))
        self.assertEqual(x, y)
    def test_RowCol_pickle(self):
        x = coda_types.RowColDouble(1.2, 3.4)
        y = pickle.loads(pickle.dumps(x))
        self.assertEqual(x, y)

        x = coda_types.RowColInt(1, 2)
        y = pickle.loads(pickle.dumps(x))
        self.assertEqual(x, y)

        x = coda_types.RowColSizeT(1, 2)
        y = pickle.loads(pickle.dumps(x))
        self.assertEqual(x, y)
Exemple #5
0
    def __getstate__(self):
        """Recursive pickling method for SWIG-wrapped Poly2D."""
        # Create a dictionary of parameters and values
        state = {}

        # Use swig_setmethods to get only data we can set later
        state['coeffs'] = pickle.dumps(self.coeffs())
        return state
Exemple #6
0
    def __getstate__(self):
        """Recursive pickling method for SWIG-wrapped Poly2D."""
    # Create a dictionary of parameters and values
        state = {}

    # Use swig_setmethods to get only data we can set later
        state['coeffs'] = pickle.dumps(self.coeffs())
        return state
Exemple #7
0
 def __getstate__(self):
     # Return a nonempty (thus non-false) tuple with dummy value in first position
     return (-1, tuple(pickle.dumps(elem) for elem in self))
Exemple #8
0
 def test_RgAz_pickle(self):
     x = coda_types.RgAzDouble(1.2, 3.4)
     y = pickle.loads(pickle.dumps(x))
     self.assertEqual(x, y)
Exemple #9
0
 def __getstate__(self):
 # Return a nonempty (thus non-false) tuple with dummy value in first position
     return (-1, tuple(pickle.dumps(elem) for elem in self))
 def test_RgAz_pickle(self):
     x = coda_types.RgAzDouble(1.2, 3.4)
     y = pickle.loads(pickle.dumps(x))
     self.assertEqual(x, y)