Exemple #1
0
    def setUp(self):
        self.path1 = Path([(-0.3, 0.4), (-0.3, 0.3), (-0.2, 0.3), (-0.2, 0.4),
                           (-0.3, 0.4)])

        self.path2 = Path([(-0.3, 0.4), (-0.3, 0.3), (-0.2, 0.3), (-0.2, 0.4),
                           (-3, 4)])

        self.contours1 = Contours([(-0.3, 0.4, 1), (-0.3, 0.3, 1),
                                   (-0.2, 0.3, 1), (-0.2, 0.4, 1),
                                   (-0.3, 0.4, 1)],
                                  vdims='Level')

        self.contours2 = Contours([(-0.3, 0.4, 1), (-0.3, 0.3, 1),
                                   (-0.2, 0.3, 1), (-0.2, 0.4, 1), (-3, 4, 1)],
                                  vdims='Level')

        self.contours3 = Contours([(-0.3, 0.4, 2), (-0.3, 0.3, 2),
                                   (-0.2, 0.3, 2), (-0.2, 0.4, 2),
                                   (-0.3, 0.4, 2)],
                                  vdims='Level')

        self.bounds1 = Bounds(0.3)
        self.bounds2 = Bounds(0.4)

        self.box1 = Box(-0.25, 0.3, 0.3)
        self.box2 = Box(-0.25, 0.3, 0.4)

        self.ellipse1 = Ellipse(-0.25, 0.3, 0.3)
        self.ellipse2 = Ellipse(-0.25, 0.3, 0.4)
Exemple #2
0
    def setUp(self):
        self.path1 = Path([(-0.3, 0.4), (-0.3, 0.3), (-0.2, 0.3), (-0.2, 0.4),
                           (-0.3, 0.4)])

        self.path2 = Path([(-0.3, 0.4), (-0.3, 0.3), (-0.2, 0.3), (-0.2, 0.4),
                           (-3, 4)])

        self.contours1 = Contours([(-0.3, 0.4), (-0.3, 0.3), (-0.2, 0.3),
                                   (-0.2, 0.4), (-0.3, 0.4)],
                                  level=1)

        self.contours2 = Contours([(-0.3, 0.4), (-0.3, 0.3), (-0.2, 0.3),
                                   (-0.2, 0.4), (-3, 4)],
                                  level=1)

        self.contours3 = Contours([(-0.3, 0.4), (-0.3, 0.3), (-0.2, 0.3),
                                   (-0.2, 0.4), (-0.3, 0.4)],
                                  level=2)

        self.bounds1 = Bounds(0.3)
        self.bounds2 = Bounds(0.4)

        self.box1 = Box(-0.25, 0.3, 0.3)
        self.box2 = Box(-0.25, 0.3, 0.4)

        self.ellipse1 = Ellipse(-0.25, 0.3, 0.3)
        self.ellipse2 = Ellipse(-0.25, 0.3, 0.4)
Exemple #3
0
 def test_box_aspect_constructor_rotated(self):
     box = Box(0,0,1, aspect=2, orientation=np.pi/8)
     self.assertEqual(np.allclose(box.data[0], self.rotated_rect), True)
Exemple #4
0
 def test_box_simple_constructor_rotated(self):
     box = Box(0,0,1, orientation=np.pi/8)
     self.assertEqual(np.allclose(box.data[0], self.rotated_square), True)