Ejemplo n.º 1
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))
Ejemplo n.º 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))
Ejemplo n.º 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)
Ejemplo n.º 4
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)
Ejemplo n.º 5
0
 def __setstate__(self, state):
     self.__init__()
     # State will have a dummy entry in the first position
     for elem in state[1]:
         self.push_back(pickle.loads(elem))
Ejemplo n.º 6
0
 def __setstate__(self, state):
     """Recursive unpickling method for SWIG-wrapped Poly2D."""
     self.__init__(pickle.loads(state.pop('coeffs')))
Ejemplo n.º 7
0
 def test_RgAz_pickle(self):
     x = coda_types.RgAzDouble(1.2, 3.4)
     y = pickle.loads(pickle.dumps(x))
     self.assertEqual(x, y)
Ejemplo n.º 8
0
 def __setstate__(self, state):
     self.__init__()
 # State will have a dummy entry in the first position
     for elem in state[1]:
         self.push_back(pickle.loads(elem))
Ejemplo n.º 9
0
 def __setstate__(self, state):
     """Recursive unpickling method for SWIG-wrapped Poly2D."""
     self.__init__(pickle.loads(state.pop('coeffs')))
Ejemplo n.º 10
0
 def test_RgAz_pickle(self):
     x = coda_types.RgAzDouble(1.2, 3.4)
     y = pickle.loads(pickle.dumps(x))
     self.assertEqual(x, y)