Esempio n. 1
0
 def test_init_styles_nomarkers(self):
     plotters.init_matplotlib('test.svg', False, False)
     self.assertEqual(len(plotters.STYLES), len(plotters.LINESTYLES)+\
                      len(plotters.DASHES))
     for ls in plotters.LINESTYLES:
         self.assertIn(dict(linestyle=ls), plotters.STYLES)
     for d in plotters.DASHES:
         self.assertIn(dict(dashes=d), plotters.STYLES)
Esempio n. 2
0
    def __init__(self, settings):
        Formatter.__init__(self, settings)
        plotters.init_matplotlib(settings.OUTPUT, settings.USE_MARKERS,
                                 settings.LOAD_MATPLOTLIBRC)
        self.plotters = plotters

        self.figure = None
        self.plotter = None
Esempio n. 3
0
 def test_init_styles_nomarkers(self):
     plotters.init_matplotlib('test.svg', False, False)
     self.assertEqual(len(plotters.STYLES), len(plotters.LINESTYLES) +
                      len(plotters.DASHES))
     for ls in plotters.LINESTYLES:
         self.assertIn(dict(linestyle=ls), plotters.STYLES)
     for d in plotters.DASHES:
         self.assertIn(dict(dashes=d), plotters.STYLES)
Esempio n. 4
0
    def __init__(self, settings):
        Formatter.__init__(self, settings)
        plotters.init_matplotlib(settings.OUTPUT, settings.USE_MARKERS,
                                 settings.LOAD_MATPLOTLIBRC)
        self.plotters = plotters

        self.figure = None
        self.plotter = None
Esempio n. 5
0
 def test_init_styles(self):
     plotters.init_matplotlib('test.svg', True, False)
     self.assertEqual(len(plotters.STYLES), len(plotters.LINESTYLES) +
                      len(plotters.DASHES) + len(plotters.MARKERS))
     for ls in plotters.LINESTYLES:
         self.assertIn(dict(linestyle=ls), plotters.STYLES)
     for d in plotters.DASHES:
         self.assertIn(dict(dashes=d), plotters.STYLES)
     for m in plotters.MARKERS:
         self.assertIn(dict(marker=m, markevery=10), plotters.STYLES)
Esempio n. 6
0
    def test_create_ellipsis(self):
        plotters.init_matplotlib('test.svg', True, True)
        # Ellipsis plots only work with >=2 data series
        p = plotters.EllipsisPlotter(self.plot_config, self.data_config)
        self.assertRaises(RuntimeError, p.init)

        self.plot_config['series'].append({'data': 'Test 1'})
        p = plotters.EllipsisPlotter(self.plot_config, self.data_config)
        p.init()
        self.assertIsInstance(p, plotters.EllipsisPlotter)
Esempio n. 7
0
 def test_init_styles(self):
     plotters.init_matplotlib('test.svg', True, False)
     self.assertEqual(len(plotters.STYLES), len(plotters.LINESTYLES) +
                      len(plotters.DASHES) + len(plotters.MARKERS))
     for ls in plotters.LINESTYLES:
         self.assertIn(dict(linestyle=ls), plotters.STYLES)
     for d in plotters.DASHES:
         self.assertIn(dict(dashes=d), plotters.STYLES)
     for m in plotters.MARKERS:
         self.assertIn(dict(marker=m, markevery=10), plotters.STYLES)
Esempio n. 8
0
    def test_create_ellipsis(self):
        plotters.init_matplotlib('test.svg', True, True)
        # Ellipsis plots only work with >=2 data series
        p = plotters.EllipsisPlotter(self.plot_config, self.data_config)
        self.assertRaises(RuntimeError, p.init)

        self.plot_config['series'].append({'data': 'Test 1'})
        p = plotters.EllipsisPlotter(self.plot_config, self.data_config)
        p.init()
        self.assertIsInstance(p, plotters.EllipsisPlotter)
Esempio n. 9
0
 def runTest(self):
     pool = Pool(initializer=initfunc)
     results = resultset.load(self.filename)
     self.settings.update(results.meta())
     self.settings.load_test(informational=True)
     plotters.init_matplotlib("-", False, True)
     for p in self.settings.PLOTS.keys():
         plot = pool.apply(plot_one, (self.settings, p, results))
         if not plot.verify() and p not in PLOTS_MAY_FAIL:
             raise self.failureException(
                 "Verification of plot '%s' failed" % p)
Esempio n. 10
0
 def runTest(self):
     pool = Pool(initializer=initfunc)
     results = resultset.load(self.filename)
     self.settings.update(results.meta())
     self.settings.load_test(informational=True)
     plotters.init_matplotlib("-", False, True)
     for p in self.settings.PLOTS.keys():
         plot = pool.apply(plot_one, (self.settings, p, results))
         if not plot.verify() and p not in PLOTS_MAY_FAIL:
             raise self.failureException(
                 "Verification of plot '%s' failed" % p)
Esempio n. 11
0
    def test_init_rcfile(self):
        with mock.patch.object(plotters.matplotlib, 'matplotlib_fname') as mock_obj:
            mock_obj.return_value = ''
            if 'MATPLOTLIBRC' in os.environ:
                del os.environ['MATPLOTLIBRC']

            plotters.init_matplotlib('test.svg', False, True)
            for k,v in MATPLOTLIB_RC_VALUES.items():
                self.assertEqual(v, plotters.matplotlib.rcParams[k],
                                 msg='rc param mismatch on %s: %s != %s' %(k,v,plotters.matplotlib.rcParams[k]))
        self.assertEqual(plotters.matplotlib.rcParams['axes.color_cycle'],
                         plotters.COLOURS)
Esempio n. 12
0
    def test_init_rcfile(self):
        with mock.patch.object(plotters.matplotlib,
                               'matplotlib_fname') as mock_obj:
            mock_obj.return_value = ''
            if 'MATPLOTLIBRC' in os.environ:
                del os.environ['MATPLOTLIBRC']

            plotters.init_matplotlib('test.svg', False, True)
            for k, v in MATPLOTLIB_RC_VALUES.items():
                self.assertEqual(v,
                                 plotters.matplotlib.rcParams[k],
                                 msg='rc param mismatch on %s: %s != %s' %
                                 (k, v, plotters.matplotlib.rcParams[k]))
        self.assertEqual(plotters.matplotlib.rcParams['axes.color_cycle'],
                         plotters.COLOURS)
Esempio n. 13
0
 def test_create_bar(self):
     plotters.init_matplotlib('test.svg', True, True)
     self.create_plotter(plotters.BarPlotter)
Esempio n. 14
0
 def test_create_timeseries_combine(self):
     plotters.init_matplotlib('test.svg', True, True)
     self.create_plotter(plotters.TimeseriesCombinePlotter)
Esempio n. 15
0
def initfunc():
    plotters.init_matplotlib("-", False, True)
Esempio n. 16
0
def plot_one(settings, plot, results):
    from flent import plotters
    plotters.init_matplotlib("-", False, True)
    settings.PLOT = plot
    return plotters.draw_worker(settings, [results])
Esempio n. 17
0
 def test_create_cdf_combine(self):
     plotters.init_matplotlib('test.svg', True, True)
     self.create_plotter(plotters.CdfCombinePlotter)
Esempio n. 18
0
 def test_create_cdf(self):
     plotters.init_matplotlib('test.svg', True, True)
     self.create_plotter(plotters.CdfPlotter)
Esempio n. 19
0
 def test_create_bar(self):
     plotters.init_matplotlib('test.svg', True, True)
     self.create_plotter(plotters.BarPlotter)
Esempio n. 20
0
 def test_create_timeseries_combine(self):
     plotters.init_matplotlib('test.svg', True, True)
     self.create_plotter(plotters.TimeseriesCombinePlotter)
Esempio n. 21
0
 def test_create_cdf(self):
     plotters.init_matplotlib('test.svg', True, True)
     self.create_plotter(plotters.CdfPlotter)
Esempio n. 22
0
 def test_create_cdf_combine(self):
     plotters.init_matplotlib('test.svg', True, True)
     self.create_plotter(plotters.CdfCombinePlotter)
Esempio n. 23
0
 def test_create_subplot_combine(self):
     plotters.init_matplotlib('test.svg', True, True)
     self.create_plotter(plotters.SubplotCombinePlotter)
Esempio n. 24
0
 def test_create_subplot_combine(self):
     plotters.init_matplotlib('test.svg', True, True)
     self.create_plotter(plotters.SubplotCombinePlotter)
Esempio n. 25
0
def initfunc():
    plotters.init_matplotlib("-", False, True)
Esempio n. 26
0
 def init_test_backend(self, filename):
     plotters.init_matplotlib(filename, False, False)
     return plotters.matplotlib.get_backend()
Esempio n. 27
0
 def init_test_backend(self, filename):
     plotters.init_matplotlib(filename, False, False)
     return plotters.matplotlib.get_backend()