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]))
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))
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.')
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.')
def test_with_colormap(self): self.figs.append( dcs.plot_multiline_history(self.time, self.data, self.label, colormap=self.colormap))
def test_with_legend(self): self.figs.append( dcs.plot_multiline_history(self.time, self.data, self.label, legend=self.legend))
def test_with_opts(self): self.figs.append( dcs.plot_multiline_history(self.time, self.data, self.label, opts=self.opts))
def test_with_type_(self): self.figs.append( dcs.plot_multiline_history(self.time, self.data, self.label, self.type_))
def test_defaults(self): self.figs.append( dcs.plot_multiline_history(self.time, self.data, self.label))
def test_defaults(self): self.figs.append(dcs.plot_multiline_history(self.time, self.data, self.label))
def test_with_opts(self): self.figs.append(dcs.plot_multiline_history(self.time, self.data, self.label, opts=self.opts))
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]))
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))
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.')
def test_with_colormap(self): self.figs.append(dcs.plot_multiline_history(self.time, self.data, self.label, colormap=self.colormap))
def test_with_legend(self): self.figs.append(dcs.plot_multiline_history(self.time, self.data, self.label, legend=self.legend))
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.')
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))
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))
def test_with_type_(self): self.figs.append(dcs.plot_multiline_history(self.time, self.data, self.label, self.type_))
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))
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))
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))
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))