Ejemplo n.º 1
0
    def test_create_from_bounds( self ):
        left = 1.0
        right = 10.0
        bottom = -2.0
        top = 5.5

        rect = rectangle.create_from_bounds(
            left = left,
            right = right,
            bottom = bottom,
            top = top
            )
        
        self.assertEqual(
            rect[ (0,0) ],
            left,
            "Rectangle bounds incorrectly calculated"
            )
        self.assertEqual(
            rect[ (0,1) ],
            bottom,
            "Rectangle bounds incorrectly calculated"
            )
        self.assertEqual(
            rect[ (1,0) ],
            right - left,
            "Rectangle bounds incorrectly calculated"
            )
        self.assertEqual(
            rect[ (1,1) ],
            top - bottom,
            "Rectangle bounds incorrectly calculated"
            )
Ejemplo n.º 2
0
 def test_bounds(self):
     rect = rectangle.create_from_bounds(-1, 1, -2, 2)
     result = rectangle.bounds(rect)
     np.testing.assert_almost_equal(result, (-1,1,-2,2), decimal=5)
Ejemplo n.º 3
0
 def test_bounds(self):
     rect = rectangle.create_from_bounds(-1, 1, -2, 2)
     result = rectangle.bounds(rect)
     np.testing.assert_almost_equal(result, (-1,1,-2,2), decimal=5)
Ejemplo n.º 4
0
 def test_create_from_bounds(self):
     result = rectangle.create_from_bounds(-1, 1, -2, 2)
     np.testing.assert_almost_equal(result, [[-1,-2],[2,4]], decimal=5)
Ejemplo n.º 5
0
 def test_create_from_bounds(self):
     result = rectangle.create_from_bounds(-1, 1, -2, 2)
     np.testing.assert_almost_equal(result, [[-1,-2],[2,4]], decimal=5)