From 03348c7deeef8a7cfc6e8614fb73255470a95c34 Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Sat, 30 Mar 2019 21:57:40 +0000 Subject: [PATCH 1/2] Updated tests after changes in param formatting --- holoviews/tests/plotting/bokeh/testbarplot.py | 5 ++--- holoviews/tests/plotting/bokeh/testlabels.py | 5 ++--- holoviews/tests/plotting/bokeh/testpointplot.py | 14 ++++++-------- holoviews/tests/plotting/bokeh/testspikesplot.py | 5 ++--- .../tests/plotting/bokeh/testvectorfieldplot.py | 5 ++--- .../tests/plotting/matplotlib/testpointplot.py | 14 ++++++-------- .../tests/plotting/matplotlib/testspikeplot.py | 5 ++--- .../plotting/matplotlib/testvectorfieldplot.py | 5 ++--- 8 files changed, 24 insertions(+), 34 deletions(-) diff --git a/holoviews/tests/plotting/bokeh/testbarplot.py b/holoviews/tests/plotting/bokeh/testbarplot.py index ca67e02b20..1f64340e13 100644 --- a/holoviews/tests/plotting/bokeh/testbarplot.py +++ b/holoviews/tests/plotting/bokeh/testbarplot.py @@ -246,7 +246,6 @@ def test_bars_color_index_color_clash(self): with ParamLogStream() as log: plot = bokeh_renderer.get_plot(bars) log_msg = log.stream.read() - warning = ("%s: Cannot declare style mapping for 'color' option " - "and declare a color_index; ignoring the color_index.\n" - % plot.name) + warning = ("Cannot declare style mapping for 'color' option " + "and declare a color_index; ignoring the color_index.\n") self.assertEqual(log_msg, warning) diff --git a/holoviews/tests/plotting/bokeh/testlabels.py b/holoviews/tests/plotting/bokeh/testlabels.py index 1d51b70796..d93b1462f6 100644 --- a/holoviews/tests/plotting/bokeh/testlabels.py +++ b/holoviews/tests/plotting/bokeh/testlabels.py @@ -181,7 +181,6 @@ def test_labels_color_index_color_clash(self): with ParamLogStream() as log: plot = bokeh_renderer.get_plot(labels) log_msg = log.stream.read() - warning = ("%s: Cannot declare style mapping for 'text_color' option " - "and declare a color_index; ignoring the color_index.\n" - % plot.name) + warning = ("Cannot declare style mapping for 'text_color' option " + "and declare a color_index; ignoring the color_index.\n") self.assertEqual(log_msg, warning) diff --git a/holoviews/tests/plotting/bokeh/testpointplot.py b/holoviews/tests/plotting/bokeh/testpointplot.py index b5a21710dd..7578933836 100644 --- a/holoviews/tests/plotting/bokeh/testpointplot.py +++ b/holoviews/tests/plotting/bokeh/testpointplot.py @@ -169,8 +169,8 @@ def test_points_non_numeric_size_warning(self): with ParamLogStream() as log: plot = bokeh_renderer.get_plot(points) log_msg = log.stream.read() - warning = ('%s: z dimension is not numeric, ' - 'cannot use to scale Points size.\n' % plot.name) + warning = ('z dimension is not numeric, ' + 'cannot use to scale Points size.\n') self.assertEqual(log_msg, warning) def test_points_categorical_xaxis(self): @@ -476,9 +476,8 @@ def test_point_color_index_color_clash(self): with ParamLogStream() as log: plot = bokeh_renderer.get_plot(points) log_msg = log.stream.read() - warning = ("%s: Cannot declare style mapping for 'color' option " - "and declare a color_index; ignoring the color_index.\n" - % plot.name) + warning = ("Cannot declare style mapping for 'color' option " + "and declare a color_index; ignoring the color_index.\n") self.assertEqual(log_msg, warning) def test_point_color_index_color_no_clash(self): @@ -497,7 +496,6 @@ def test_point_size_index_size_clash(self): with ParamLogStream() as log: plot = bokeh_renderer.get_plot(points) log_msg = log.stream.read() - warning = ("%s: Cannot declare style mapping for 'size' option " - "and declare a size_index; ignoring the size_index.\n" - % plot.name) + warning = ("Cannot declare style mapping for 'size' option " + "and declare a size_index; ignoring the size_index.\n") self.assertEqual(log_msg, warning) diff --git a/holoviews/tests/plotting/bokeh/testspikesplot.py b/holoviews/tests/plotting/bokeh/testspikesplot.py index 084142efb4..c4028dba76 100644 --- a/holoviews/tests/plotting/bokeh/testspikesplot.py +++ b/holoviews/tests/plotting/bokeh/testspikesplot.py @@ -218,7 +218,6 @@ def test_spikes_color_index_color_clash(self): with ParamLogStream() as log: plot = bokeh_renderer.get_plot(spikes) log_msg = log.stream.read() - warning = ("%s: Cannot declare style mapping for 'color' option " - "and declare a color_index; ignoring the color_index.\n" - % plot.name) + warning = ("Cannot declare style mapping for 'color' option " + "and declare a color_index; ignoring the color_index.\n") self.assertEqual(log_msg, warning) diff --git a/holoviews/tests/plotting/bokeh/testvectorfieldplot.py b/holoviews/tests/plotting/bokeh/testvectorfieldplot.py index 62c330bd04..5cbf841d3d 100644 --- a/holoviews/tests/plotting/bokeh/testvectorfieldplot.py +++ b/holoviews/tests/plotting/bokeh/testvectorfieldplot.py @@ -76,7 +76,6 @@ def test_vectorfield_color_index_color_clash(self): with ParamLogStream() as log: plot = bokeh_renderer.get_plot(vectorfield) log_msg = log.stream.read() - warning = ("%s: Cannot declare style mapping for 'line_color' option " - "and declare a color_index; ignoring the color_index.\n" - % plot.name) + warning = ("Cannot declare style mapping for 'line_color' option " + "and declare a color_index; ignoring the color_index.\n") self.assertEqual(log_msg, warning) diff --git a/holoviews/tests/plotting/matplotlib/testpointplot.py b/holoviews/tests/plotting/matplotlib/testpointplot.py index b4081cc01b..37c97379ff 100644 --- a/holoviews/tests/plotting/matplotlib/testpointplot.py +++ b/holoviews/tests/plotting/matplotlib/testpointplot.py @@ -21,8 +21,8 @@ def test_points_non_numeric_size_warning(self): with ParamLogStream() as log: plot = mpl_renderer.get_plot(points) log_msg = log.stream.read() - warning = ('%s: z dimension is not numeric, ' - 'cannot use to scale Points size.\n' % plot.name) + warning = ('z dimension is not numeric, ' + 'cannot use to scale Points size.\n') self.assertEqual(log_msg, warning) def test_points_cbar_extend_both(self): @@ -305,9 +305,8 @@ def test_point_color_index_color_clash(self): with ParamLogStream() as log: plot = mpl_renderer.get_plot(points) log_msg = log.stream.read() - warning = ("%s: Cannot declare style mapping for 'color' option " - "and declare a color_index; ignoring the color_index.\n" - % plot.name) + warning = ("Cannot declare style mapping for 'color' option " + "and declare a color_index; ignoring the color_index.\n") self.assertEqual(log_msg, warning) def test_point_size_index_size_clash(self): @@ -316,7 +315,6 @@ def test_point_size_index_size_clash(self): with ParamLogStream() as log: plot = mpl_renderer.get_plot(points) log_msg = log.stream.read() - warning = ("%s: Cannot declare style mapping for 's' option " - "and declare a size_index; ignoring the size_index.\n" - % plot.name) + warning = ("Cannot declare style mapping for 's' option " + "and declare a size_index; ignoring the size_index.\n") self.assertEqual(log_msg, warning) diff --git a/holoviews/tests/plotting/matplotlib/testspikeplot.py b/holoviews/tests/plotting/matplotlib/testspikeplot.py index 2ee2ae915c..ae6913b9aa 100644 --- a/holoviews/tests/plotting/matplotlib/testspikeplot.py +++ b/holoviews/tests/plotting/matplotlib/testspikeplot.py @@ -194,8 +194,7 @@ def test_spikes_color_index_color_clash(self): with ParamLogStream() as log: plot = mpl_renderer.get_plot(spikes) log_msg = log.stream.read() - warning = ("%s: Cannot declare style mapping for 'color' option " - "and declare a color_index; ignoring the color_index.\n" - % plot.name) + warning = ("Cannot declare style mapping for 'color' option " + "and declare a color_index; ignoring the color_index.\n") self.assertEqual(log_msg, warning) diff --git a/holoviews/tests/plotting/matplotlib/testvectorfieldplot.py b/holoviews/tests/plotting/matplotlib/testvectorfieldplot.py index 1975e5f5c0..2c58f8cc95 100644 --- a/holoviews/tests/plotting/matplotlib/testvectorfieldplot.py +++ b/holoviews/tests/plotting/matplotlib/testvectorfieldplot.py @@ -97,7 +97,6 @@ def test_vectorfield_color_index_color_clash(self): with ParamLogStream() as log: plot = mpl_renderer.get_plot(vectorfield) log_msg = log.stream.read() - warning = ("%s: Cannot declare style mapping for 'color' option " - "and declare a color_index; ignoring the color_index.\n" - % plot.name) + warning = ("Cannot declare style mapping for 'color' option " + "and declare a color_index; ignoring the color_index.\n") self.assertEqual(log_msg, warning) From e5befb887303537c106bf458a0d4703b4fe125fc Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Sat, 30 Mar 2019 22:09:07 +0000 Subject: [PATCH 2/2] Fixed flakes --- holoviews/tests/plotting/bokeh/testbarplot.py | 2 +- holoviews/tests/plotting/bokeh/testlabels.py | 2 +- holoviews/tests/plotting/bokeh/testpointplot.py | 6 +++--- holoviews/tests/plotting/bokeh/testspikesplot.py | 2 +- holoviews/tests/plotting/bokeh/testvectorfieldplot.py | 2 +- holoviews/tests/plotting/matplotlib/testpointplot.py | 6 +++--- holoviews/tests/plotting/matplotlib/testspikeplot.py | 2 +- holoviews/tests/plotting/matplotlib/testvectorfieldplot.py | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/holoviews/tests/plotting/bokeh/testbarplot.py b/holoviews/tests/plotting/bokeh/testbarplot.py index 1f64340e13..a8a39e6481 100644 --- a/holoviews/tests/plotting/bokeh/testbarplot.py +++ b/holoviews/tests/plotting/bokeh/testbarplot.py @@ -244,7 +244,7 @@ def test_bars_color_index_color_clash(self): bars = Bars([(0, 0, 0), (0, 1, 1), (0, 2, 2)], vdims=['y', 'color']).options(color='color', color_index='color') with ParamLogStream() as log: - plot = bokeh_renderer.get_plot(bars) + bokeh_renderer.get_plot(bars) log_msg = log.stream.read() warning = ("Cannot declare style mapping for 'color' option " "and declare a color_index; ignoring the color_index.\n") diff --git a/holoviews/tests/plotting/bokeh/testlabels.py b/holoviews/tests/plotting/bokeh/testlabels.py index d93b1462f6..99fc3a89eb 100644 --- a/holoviews/tests/plotting/bokeh/testlabels.py +++ b/holoviews/tests/plotting/bokeh/testlabels.py @@ -179,7 +179,7 @@ def test_labels_color_index_color_clash(self): labels = Labels([(0, 0, 0), (0, 1, 1), (0, 2, 2)], vdims='color').options(text_color='color', color_index='color') with ParamLogStream() as log: - plot = bokeh_renderer.get_plot(labels) + bokeh_renderer.get_plot(labels) log_msg = log.stream.read() warning = ("Cannot declare style mapping for 'text_color' option " "and declare a color_index; ignoring the color_index.\n") diff --git a/holoviews/tests/plotting/bokeh/testpointplot.py b/holoviews/tests/plotting/bokeh/testpointplot.py index 7578933836..3ff4da7dba 100644 --- a/holoviews/tests/plotting/bokeh/testpointplot.py +++ b/holoviews/tests/plotting/bokeh/testpointplot.py @@ -167,7 +167,7 @@ def test_points_non_numeric_size_warning(self): data = (np.arange(10), np.arange(10), list(map(chr, range(94,104)))) points = Points(data, vdims=['z']).opts(plot=dict(size_index=2)) with ParamLogStream() as log: - plot = bokeh_renderer.get_plot(points) + bokeh_renderer.get_plot(points) log_msg = log.stream.read() warning = ('z dimension is not numeric, ' 'cannot use to scale Points size.\n') @@ -474,7 +474,7 @@ def test_point_color_index_color_clash(self): points = Points([(0, 0, 0), (0, 1, 1), (0, 2, 2)], vdims='color').options(color='color', color_index='color') with ParamLogStream() as log: - plot = bokeh_renderer.get_plot(points) + bokeh_renderer.get_plot(points) log_msg = log.stream.read() warning = ("Cannot declare style mapping for 'color' option " "and declare a color_index; ignoring the color_index.\n") @@ -494,7 +494,7 @@ def test_point_size_index_size_clash(self): points = Points([(0, 0, 0), (0, 1, 1), (0, 2, 2)], vdims='size').options(size='size', size_index='size') with ParamLogStream() as log: - plot = bokeh_renderer.get_plot(points) + bokeh_renderer.get_plot(points) log_msg = log.stream.read() warning = ("Cannot declare style mapping for 'size' option " "and declare a size_index; ignoring the size_index.\n") diff --git a/holoviews/tests/plotting/bokeh/testspikesplot.py b/holoviews/tests/plotting/bokeh/testspikesplot.py index c4028dba76..c199e12305 100644 --- a/holoviews/tests/plotting/bokeh/testspikesplot.py +++ b/holoviews/tests/plotting/bokeh/testspikesplot.py @@ -216,7 +216,7 @@ def test_spikes_color_index_color_clash(self): spikes = Spikes([(0, 0, 0), (0, 1, 1), (0, 2, 2)], vdims=['y', 'color']).options(color='color', color_index='color') with ParamLogStream() as log: - plot = bokeh_renderer.get_plot(spikes) + bokeh_renderer.get_plot(spikes) log_msg = log.stream.read() warning = ("Cannot declare style mapping for 'color' option " "and declare a color_index; ignoring the color_index.\n") diff --git a/holoviews/tests/plotting/bokeh/testvectorfieldplot.py b/holoviews/tests/plotting/bokeh/testvectorfieldplot.py index 5cbf841d3d..6c8d3b2fad 100644 --- a/holoviews/tests/plotting/bokeh/testvectorfieldplot.py +++ b/holoviews/tests/plotting/bokeh/testvectorfieldplot.py @@ -74,7 +74,7 @@ def test_vectorfield_color_index_color_clash(self): vectorfield = VectorField([(0, 0, 0), (0, 1, 1), (0, 2, 2)], vdims='color').options(line_color='color', color_index='color') with ParamLogStream() as log: - plot = bokeh_renderer.get_plot(vectorfield) + bokeh_renderer.get_plot(vectorfield) log_msg = log.stream.read() warning = ("Cannot declare style mapping for 'line_color' option " "and declare a color_index; ignoring the color_index.\n") diff --git a/holoviews/tests/plotting/matplotlib/testpointplot.py b/holoviews/tests/plotting/matplotlib/testpointplot.py index 37c97379ff..e82fc54db2 100644 --- a/holoviews/tests/plotting/matplotlib/testpointplot.py +++ b/holoviews/tests/plotting/matplotlib/testpointplot.py @@ -19,7 +19,7 @@ def test_points_non_numeric_size_warning(self): data = (np.arange(10), np.arange(10), list(map(chr, range(94,104)))) points = Points(data, vdims=['z']).opts(plot=dict(size_index=2)) with ParamLogStream() as log: - plot = mpl_renderer.get_plot(points) + mpl_renderer.get_plot(points) log_msg = log.stream.read() warning = ('z dimension is not numeric, ' 'cannot use to scale Points size.\n') @@ -303,7 +303,7 @@ def test_point_color_index_color_clash(self): points = Points([(0, 0, 0), (0, 1, 1), (0, 2, 2)], vdims='color').options(color='color', color_index='color') with ParamLogStream() as log: - plot = mpl_renderer.get_plot(points) + mpl_renderer.get_plot(points) log_msg = log.stream.read() warning = ("Cannot declare style mapping for 'color' option " "and declare a color_index; ignoring the color_index.\n") @@ -313,7 +313,7 @@ def test_point_size_index_size_clash(self): points = Points([(0, 0, 0), (0, 1, 1), (0, 2, 2)], vdims='size').options(s='size', size_index='size') with ParamLogStream() as log: - plot = mpl_renderer.get_plot(points) + mpl_renderer.get_plot(points) log_msg = log.stream.read() warning = ("Cannot declare style mapping for 's' option " "and declare a size_index; ignoring the size_index.\n") diff --git a/holoviews/tests/plotting/matplotlib/testspikeplot.py b/holoviews/tests/plotting/matplotlib/testspikeplot.py index ae6913b9aa..5e63efc519 100644 --- a/holoviews/tests/plotting/matplotlib/testspikeplot.py +++ b/holoviews/tests/plotting/matplotlib/testspikeplot.py @@ -192,7 +192,7 @@ def test_spikes_color_index_color_clash(self): spikes = Spikes([(0, 0, 0), (0, 1, 1), (0, 2, 2)], vdims=['y', 'color']).options(color='color', color_index='color') with ParamLogStream() as log: - plot = mpl_renderer.get_plot(spikes) + mpl_renderer.get_plot(spikes) log_msg = log.stream.read() warning = ("Cannot declare style mapping for 'color' option " "and declare a color_index; ignoring the color_index.\n") diff --git a/holoviews/tests/plotting/matplotlib/testvectorfieldplot.py b/holoviews/tests/plotting/matplotlib/testvectorfieldplot.py index 2c58f8cc95..47f8756854 100644 --- a/holoviews/tests/plotting/matplotlib/testvectorfieldplot.py +++ b/holoviews/tests/plotting/matplotlib/testvectorfieldplot.py @@ -95,7 +95,7 @@ def test_vectorfield_color_index_color_clash(self): vectorfield = VectorField([(0, 0, 0, 1, 0), (0, 1, 0, 1, 1), (0, 2, 0, 1, 2)], vdims=['A', 'M', 'color']).options(color='color', color_index='A') with ParamLogStream() as log: - plot = mpl_renderer.get_plot(vectorfield) + mpl_renderer.get_plot(vectorfield) log_msg = log.stream.read() warning = ("Cannot declare style mapping for 'color' option " "and declare a color_index; ignoring the color_index.\n")