Ejemplo n.º 1
0
 def test_bad_legend(self):
     with self.assertRaises(AssertionError):
         self.figs.append(
             dcs.plot_multiline_history(self.time,
                                        self.data,
                                        self.label,
                                        legend=self.legend[:-1]))
Ejemplo n.º 2
0
 def test_ignore_zeros2(self):
     self.data[:, 1] = 0
     self.data[:, 3] = 0
     self.figs.append(
         dcs.plot_multiline_history(self.time,
                                    self.data,
                                    self.label,
                                    ignore_empties=True))
Ejemplo n.º 3
0
 def test_ignore_zeros3(self):
     self.data = np.zeros(self.data.shape)
     with dcs.capture_output() as out:
         not_a_fig = dcs.plot_multiline_history(self.time, self.data, label='All Zeros', ignore_empties=True)
     output = out.getvalue().strip()
     out.close()
     self.assertIs(not_a_fig, None)
     self.assertEqual(output,'All Zeros plot skipped due to missing data.')
Ejemplo n.º 4
0
 def test_ignore_zeros3(self):
     self.data = np.zeros(self.data.shape)
     with dcs.capture_output() as out:
         not_a_fig = dcs.plot_multiline_history(self.time,
                                                self.data,
                                                label='All Zeros',
                                                ignore_empties=True)
     output = out.getvalue().strip()
     out.close()
     self.assertIs(not_a_fig, None)
     self.assertEqual(output, 'All Zeros plot skipped due to missing data.')
Ejemplo n.º 5
0
 def test_with_colormap(self):
     self.figs.append(
         dcs.plot_multiline_history(self.time,
                                    self.data,
                                    self.label,
                                    colormap=self.colormap))
Ejemplo n.º 6
0
 def test_with_legend(self):
     self.figs.append(
         dcs.plot_multiline_history(self.time,
                                    self.data,
                                    self.label,
                                    legend=self.legend))
Ejemplo n.º 7
0
 def test_with_opts(self):
     self.figs.append(
         dcs.plot_multiline_history(self.time,
                                    self.data,
                                    self.label,
                                    opts=self.opts))
Ejemplo n.º 8
0
 def test_with_type_(self):
     self.figs.append(
         dcs.plot_multiline_history(self.time, self.data, self.label,
                                    self.type_))
Ejemplo n.º 9
0
 def test_defaults(self):
     self.figs.append(
         dcs.plot_multiline_history(self.time, self.data, self.label))
Ejemplo n.º 10
0
 def test_defaults(self):
     self.figs.append(dcs.plot_multiline_history(self.time, self.data, self.label))
Ejemplo n.º 11
0
 def test_with_opts(self):
     self.figs.append(dcs.plot_multiline_history(self.time, self.data, self.label, opts=self.opts))
Ejemplo n.º 12
0
 def test_bad_legend(self):
     with self.assertRaises(AssertionError):
         self.figs.append(dcs.plot_multiline_history(self.time, self.data, self.label, legend=self.legend[:-1]))
Ejemplo n.º 13
0
 def test_ignore_zeros2(self):
     self.data[:,1] = 0
     self.data[:,3] = 0
     self.figs.append(dcs.plot_multiline_history(self.time, self.data, self.label, ignore_empties=True))
Ejemplo n.º 14
0
 def test_no_data(self):
     with dcs.capture_output() as out:
         dcs.plot_multiline_history(self.time, None, '')
     output = out.getvalue().strip()
     out.close()
     self.assertEqual(output, 'plot skipped due to missing data.')
Ejemplo n.º 15
0
 def test_with_colormap(self):
     self.figs.append(dcs.plot_multiline_history(self.time, self.data, self.label, colormap=self.colormap))
Ejemplo n.º 16
0
 def test_with_legend(self):
     self.figs.append(dcs.plot_multiline_history(self.time, self.data, self.label, legend=self.legend))
Ejemplo n.º 17
0
 def test_no_data(self):
     with dcs.capture_output() as out:
         dcs.plot_multiline_history(self.time, None, '')
     output = out.getvalue().strip()
     out.close()
     self.assertEqual(output, 'plot skipped due to missing data.')
Ejemplo n.º 18
0
 def test_second_y_scale1(self):
     self.figs.append(dcs.plot_multiline_history(self.time, self.data, self.label, type_='population', \
         second_y_scale=self.second_y_scale))
Ejemplo n.º 19
0
 def test_second_y_scale1(self):
     self.figs.append(dcs.plot_multiline_history(self.time, self.data, self.label, type_='population', \
         second_y_scale=self.second_y_scale))
Ejemplo n.º 20
0
 def test_with_type_(self):
     self.figs.append(dcs.plot_multiline_history(self.time, self.data, self.label, self.type_))
Ejemplo n.º 21
0
 def test_second_y_scale2(self):
     self.figs.append(dcs.plot_multiline_history(self.time, self.data, self.label, \
         second_y_scale=self.second_y_scale))
Ejemplo n.º 22
0
 def test_nominal(self):
     self.figs.append(dcs.plot_multiline_history(self.time, self.data, label=self.label, \
         type_=self.type_, opts=self.opts, legend=self.legend, colormap=self.colormap))
Ejemplo n.º 23
0
 def test_second_y_scale2(self):
     self.figs.append(dcs.plot_multiline_history(self.time, self.data, self.label, \
         second_y_scale=self.second_y_scale))
Ejemplo n.º 24
0
 def test_nominal(self):
     self.figs.append(dcs.plot_multiline_history(self.time, self.data, label=self.label, \
         type_=self.type_, opts=self.opts, legend=self.legend, colormap=self.colormap))