Ejemplo n.º 1
0
class TestBBarray():

    BBarray = np.array(
        (((-23.5, 456), (56, 532.0)), ((-20.3, 460), (54, 465)),
         ((-23.5, 456), (58, 540.)), ((-26.5, 12), (56, 532.0))),
        dtype=np.float)
    BB = asBBox(((-26.5, 12.), (58., 540.)))

    def testJoin(self):
        BB = fromBBArray(self.BBarray)
        assert BB == self.BB
Ejemplo n.º 2
0
 def testPassArray2(self):
     # same data type -- should be a view
     A = np.array(((0, 0), (5, 5)), np.float_)
     C = asBBox(A)
     A[0, 0] = -10
     assert C[0, 0] == A[0, 0]
Ejemplo n.º 3
0
 def testPassArray(self):
     # Different data type
     A = np.array(((0, 0), (5, 5)))
     C = asBBox(A)
     assert A is not C
Ejemplo n.º 4
0
 def testPassThrough2(self):
     B = ((0, 0), (5, 5))
     C = asBBox(B)
     assert B is not C
Ejemplo n.º 5
0
 def testPassThrough(self):
     B = BBox(((0, 0), (5, 5)))
     C = asBBox(B)
     assert B is C