Example #1
0
 def test_empty_adjoint_plot(self):
     adjoint = Curve([0,1,1,2,3]) << Empty() << Curve([0,1,1,0,1])
     plot = bokeh_renderer.get_plot(adjoint)
     adjoint_plot = plot.subplots[(0, 0)]
     self.assertEqual(len(adjoint_plot.subplots), 3)
     grid = plot.state.children[1]
     (f1, _, _), (f2, _, _), (s1, _, _) = grid.children
     self.assertIsInstance(s1, Spacer)
     self.assertEqual(s1.width, 0)
     self.assertEqual(s1.height, 0)
     self.assertEqual(f1.plot_height, f2.plot_height)
Example #2
0
 def test_empty_adjoint_plot(self):
     adjoint = Curve([0,1,1,2,3]) << Empty() << Curve([0,1,1,0,1])
     plot = bokeh_renderer.get_plot(adjoint)
     adjoint_plot = plot.subplots[(0, 0)]
     self.assertEqual(len(adjoint_plot.subplots), 3)
     column = plot.state.children[1]
     row1, row2 = column.children
     self.assertEqual(row1.children[0].plot_height, row1.children[1].plot_height)
     self.assertEqual(row1.children[1].plot_width, 0)
     self.assertEqual(row2.children[1].plot_width, 0)
     self.assertEqual(row2.children[0].plot_height, row2.children[1].plot_height)