Example #1
0
 def test_deep_clone_map_select_redim(self):
     annotations = (Text(0, 0, 'A') + Arrow(0, 0) + HLine(0) + VLine(0))
     selected = annotations.select(x=(0, 5))
     redimmed = selected.redim(x='z')
     relabelled = redimmed.relabel(label='foo', depth=5)
     mapped = relabelled.map(lambda x: x.clone(group='bar'), Annotation)
     kwargs = dict(label='foo', group='bar', extents=(0, None, 5, None), kdims=['z', 'y'])
     self.assertEqual(mapped.Text.I, Text(0, 0, 'A', **kwargs))
     self.assertEqual(mapped.Arrow.I, Arrow(0, 0, **kwargs))
     self.assertEqual(mapped.HLine.I, HLine(0, **kwargs))
     self.assertEqual(mapped.VLine.I, VLine(0, **kwargs))
Example #2
0
    def test_vline_dimension_values(self):
        vline = VLine(0)
        self.assertEqual(vline.range(0), (0, 0))
        self.assertTrue(all(not np.isfinite(v) for v in vline.range(1)))

        # Testing numpy inputs
        vline = VLine(np.array([0]))
        self.assertEqual(vline.range(0), (0, 0))
        self.assertTrue(all(not np.isfinite(v) for v in vline.range(1)))

        vline = VLine(np.array(0))
        self.assertEqual(vline.range(0), (0, 0))
        self.assertTrue(all(not np.isfinite(v) for v in vline.range(1)))
Example #3
0
 def test_vline_dimension_values(self):
     hline = VLine(0)
     self.assertEqual(hline.range(0), (0, 0))
     self.assertEqual(hline.range(1), (np.NaN, np.NaN))
Example #4
0
 def test_vline_dimension_values(self):
     hline = VLine(0)
     self.assertEqual(hline.range(0), (0, 0))
     self.assertEqual(hline.range(1), (None, None))
Example #5
0
 def test_vline_dimension_values(self):
     hline = VLine(0)
     self.assertEqual(hline.range(0), (0, 0))
     self.assertTrue(all(not np.isfinite(v) for v in hline.range(1)))