Example #1
0
 def test_deep_getitem_cross_product_and_slice(self):
     fn = lambda i: Curve(np.arange(i))
     dmap = DynamicMap(fn, kdims=[Dimension('Test', range=(10, 20))])
     self.assertEqual(dmap[[10, 11, 12], 5:10],
                      dmap.clone([(i, fn(i)[5:10]) for i in range(10, 13)]))
Example #2
0
 def test_generator_open_clone(self):
     generator = (Image(sine_array(0, i)) for i in range(10))
     dmap = DynamicMap(generator)
     self.assertEqual(dmap, dmap.clone())
Example #3
0
 def test_generator_bounded_clone(self):
     fn = lambda i: Image(sine_array(0, i))
     dmap = DynamicMap(fn, kdims=[Dimension('dim', range=(0, 10))])
     self.assertEqual(dmap, dmap.clone())
Example #4
0
 def test_callable_open_clone(self):
     fn = lambda i: Image(sine_array(0, i))
     dmap = DynamicMap(fn)
     self.assertEqual(dmap, dmap.clone())
Example #5
0
 def test_generator_closed_clone(self):
     fn = lambda i: Image(sine_array(0,i))
     dmap=DynamicMap(fn, kdims=[Dimension('dim', range=(0,10))])
     self.assertEqual(dmap, dmap.clone())
Example #6
0
 def test_callable_open_clone(self):
     fn = lambda i: Image(sine_array(0,i))
     dmap=DynamicMap(fn)
     self.assertEqual(dmap, dmap.clone())
Example #7
0
 def test_generator_open_clone(self):
     generator = (Image(sine_array(0,i)) for i in range(10))
     dmap=DynamicMap(generator)
     self.assertEqual(dmap, dmap.clone())