Skip to content

Commit

Permalink
Merge c130103 into 32b1782
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Apr 24, 2020
2 parents 32b1782 + c130103 commit d4358d8
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion holoviews/core/util.py
Expand Up @@ -877,7 +877,7 @@ def isfinite(val):
return finite
elif isinstance(val, datetime_types+timedelta_types):
return not isnat(val)
elif isinstance(val, basestring):
elif isinstance(val, (basestring, bytes)):
return True
finite = np.isfinite(val)
if pd and pandas_version >= '1.0.0':
Expand Down
4 changes: 2 additions & 2 deletions holoviews/plotting/bokeh/element.py
Expand Up @@ -371,12 +371,12 @@ def _axes_props(self, plots, subplots, element, ranges):
if xdims is not None and any(xdim.name in ranges and 'factors' in ranges[xdim.name] for xdim in xdims):
categorical_x = True
else:
categorical_x = any(isinstance(x, util.basestring) for x in (l, r))
categorical_x = any(isinstance(x, (util.basestring, bytes)) for x in (l, r))

if ydims is not None and any(ydim.name in ranges and 'factors' in ranges[ydim.name] for ydim in ydims):
categorical_y = True
else:
categorical_y = any(isinstance(y, util.basestring) for y in (b, t))
categorical_y = any(isinstance(y, (util.basestring, bytes)) for y in (b, t))

range_types = (self._x_range_type, self._y_range_type)
if self.invert_axes: range_types = range_types[::-1]
Expand Down
20 changes: 10 additions & 10 deletions holoviews/tests/plotting/bokeh/testelementplot.py
Expand Up @@ -36,10 +36,10 @@ def test_element_font_scaling(self):
xaxis = plot.handles['xaxis']
yaxis = plot.handles['yaxis']
self.assertEqual(fig.title.text_font_size, {'value': '24pt'})
self.assertEqual(xaxis.axis_label_text_font_size, '20pt')
self.assertEqual(yaxis.axis_label_text_font_size, '20pt')
self.assertEqual(xaxis.major_label_text_font_size, '16pt')
self.assertEqual(yaxis.major_label_text_font_size, '16pt')
self.assertEqual(xaxis.axis_label_text_font_size, '26px')
self.assertEqual(yaxis.axis_label_text_font_size, '26px')
self.assertEqual(xaxis.major_label_text_font_size, '22px')
self.assertEqual(yaxis.major_label_text_font_size, '22px')

def test_element_font_scaling_fontsize_override_common(self):
curve = Curve(range(10)).options(fontscale=2, fontsize='14pt', title='A title')
Expand All @@ -50,8 +50,8 @@ def test_element_font_scaling_fontsize_override_common(self):
self.assertEqual(fig.title.text_font_size, {'value': '28pt'})
self.assertEqual(xaxis.axis_label_text_font_size, '28pt')
self.assertEqual(yaxis.axis_label_text_font_size, '28pt')
self.assertEqual(xaxis.major_label_text_font_size, '16pt')
self.assertEqual(yaxis.major_label_text_font_size, '16pt')
self.assertEqual(xaxis.major_label_text_font_size, '22px')
self.assertEqual(yaxis.major_label_text_font_size, '22px')

def test_element_font_scaling_fontsize_override_specific(self):
curve = Curve(range(10)).options(
Expand All @@ -63,9 +63,9 @@ def test_element_font_scaling_fontsize_override_specific(self):
yaxis = plot.handles['yaxis']
self.assertEqual(fig.title.text_font_size, {'value': '200%'})
self.assertEqual(xaxis.axis_label_text_font_size, '24pt')
self.assertEqual(yaxis.axis_label_text_font_size, '20pt')
self.assertEqual(yaxis.axis_label_text_font_size, '26px')
self.assertEqual(xaxis.major_label_text_font_size, '2.4em')
self.assertEqual(yaxis.major_label_text_font_size, '16pt')
self.assertEqual(yaxis.major_label_text_font_size, '22px')

def test_element_xaxis_top(self):
curve = Curve(range(10)).options(xaxis='top')
Expand Down Expand Up @@ -798,8 +798,8 @@ def test_colorbar_fontsize_scaling(self):
img = Image(np.array([[0, 1], [2, 3]])).opts(colorbar=True, fontscale=2)
plot = bokeh_renderer.get_plot(img)
colorbar = plot.handles['colorbar']
self.assertEqual(colorbar.title_text_font_size, '20pt')
self.assertEqual(colorbar.major_label_text_font_size, '16pt')
self.assertEqual(colorbar.title_text_font_size, '26px')
self.assertEqual(colorbar.major_label_text_font_size, '22px')

def test_explicit_categorical_cmap_on_integer_data(self):
explicit_mapping = OrderedDict([(0, 'blue'), (1, 'red'), (2, 'green'), (3, 'purple')])
Expand Down
2 changes: 1 addition & 1 deletion holoviews/tests/plotting/bokeh/testgridplot.py
Expand Up @@ -65,7 +65,7 @@ def test_gridspace_sparse(self):
for j in range(2,4) if not (i==1 and j == 2)})
plot = bokeh_renderer.get_plot(grid)
size = bokeh_renderer.get_size(plot.state)
self.assertEqual(size, (318, 310))
self.assertEqual(size, (320, 311))

def test_grid_shared_source_synced_update(self):
hmap = HoloMap({i: Dataset({chr(65+j): np.random.rand(i+2)
Expand Down
2 changes: 1 addition & 1 deletion holoviews/tests/plotting/bokeh/testrenderer.py
Expand Up @@ -73,7 +73,7 @@ def test_get_size_grid_plot(self):
grid = GridSpace({(i, j): self.image1 for i in range(3) for j in range(3)})
plot = self.renderer.get_plot(grid)
w, h = self.renderer.get_size(plot)
self.assertEqual((w, h), (444, 436))
self.assertEqual((w, h), (446, 437))

def test_get_size_table(self):
table = Table(range(10), kdims=['x'])
Expand Down

0 comments on commit d4358d8

Please sign in to comment.