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))
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)))
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))
def test_vline_dimension_values(self): hline = VLine(0) self.assertEqual(hline.range(0), (0, 0)) self.assertEqual(hline.range(1), (None, None))
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)))