Skip to content

Commit

Permalink
Merge e5befb8 into ddb527e
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Mar 30, 2019
2 parents ddb527e + e5befb8 commit ffb39e9
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 46 deletions.
7 changes: 3 additions & 4 deletions holoviews/tests/plotting/bokeh/testbarplot.py
Expand Up @@ -244,9 +244,8 @@ 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 = ("%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)
7 changes: 3 additions & 4 deletions holoviews/tests/plotting/bokeh/testlabels.py
Expand Up @@ -179,9 +179,8 @@ 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 = ("%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)
20 changes: 9 additions & 11 deletions holoviews/tests/plotting/bokeh/testpointplot.py
Expand Up @@ -167,10 +167,10 @@ 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 = ('%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):
Expand Down Expand Up @@ -474,11 +474,10 @@ 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 = ("%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):
Expand All @@ -495,9 +494,8 @@ 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 = ("%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)
7 changes: 3 additions & 4 deletions holoviews/tests/plotting/bokeh/testspikesplot.py
Expand Up @@ -216,9 +216,8 @@ 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 = ("%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)
7 changes: 3 additions & 4 deletions holoviews/tests/plotting/bokeh/testvectorfieldplot.py
Expand Up @@ -74,9 +74,8 @@ 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 = ("%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)
20 changes: 9 additions & 11 deletions holoviews/tests/plotting/matplotlib/testpointplot.py
Expand Up @@ -19,10 +19,10 @@ 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 = ('%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):
Expand Down Expand Up @@ -303,20 +303,18 @@ 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 = ("%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):
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 = ("%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)
7 changes: 3 additions & 4 deletions holoviews/tests/plotting/matplotlib/testspikeplot.py
Expand Up @@ -192,10 +192,9 @@ 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 = ("%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)

7 changes: 3 additions & 4 deletions holoviews/tests/plotting/matplotlib/testvectorfieldplot.py
Expand Up @@ -95,9 +95,8 @@ 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 = ("%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)

0 comments on commit ffb39e9

Please sign in to comment.