def setUp(self): if 'matplotlib' not in Store.renderers: raise SkipTest("Matplotlib required to test widgets") self.basename = 'no-file' self.image1 = Image(np.array([[0,1],[2,3]]), label='Image1') self.image2 = Image(np.array([[1,0],[4,-2]]), label='Image2') self.map1 = HoloMap({1:self.image1, 2:self.image2}, label='TestMap') self.unicode_table = ItemTable([('β','Δ1'), ('°C', '3×4')], label='Poincaré', group='α Festkörperphysik') self.renderer = MPLRenderer.instance()
def setUp(self): if 'matplotlib' not in Store.renderers and pn is not None: raise SkipTest("Matplotlib and Panel required to test rendering.") self.basename = 'no-file' self.image1 = Image(np.array([[0,1],[2,3]]), label='Image1') self.image2 = Image(np.array([[1,0],[4,-2]]), label='Image2') self.map1 = HoloMap({1:self.image1, 2:self.image2}, label='TestMap') self.unicode_table = ItemTable([('β','Δ1'), ('°C', '3×4')], label='Poincaré', group='α Festkörperphysik') self.renderer = MPLRenderer.instance() self.nbcontext = Renderer.notebook_context self.comm_manager = Renderer.comm_manager with param.logging_level('ERROR'): Renderer.notebook_context = False Renderer.comm_manager = CommManager
def test_chart_reduce(self): mean = self.chart.reduce(x=np.mean) itable = ItemTable(OrderedDict([('y', np.mean(self.ys))])) self.assertEqual(mean, itable)