Skip to content

Commit 14648a5

Browse files
committed
Fix bugs on python 2.7
- assertRegex is since python 3 - Do not pass fig, ax parameter when binding axesplot
1 parent 6b351bd commit 14648a5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tfplot/wrapper.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,7 @@ def _wrapped_plot_fn(*args, **kwargs_call):
284284

285285
# (2) body
286286
if is_axesplot_bind: # e.g. Axesplot.scatter -> bind 'ax' as self
287-
ret = plot_func.__get__(ax)(
288-
*args, **merge_kwargs(kwargs_call, fig_ax_kwargs))
287+
ret = plot_func.__get__(ax)(*args, **kwargs_call)
289288
else:
290289
ret = plot_func(*args, **merge_kwargs(kwargs_call, fig_ax_kwargs)) # TODO conflict??
291290

tfplot/wrapper_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import types
99
import sys
1010
import os
11+
import re
1112

1213
import tensorflow as tf
1314
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # filter out INFO and WARN logs
@@ -64,7 +65,7 @@ def test_wrap_axesplot_axes(self):
6465

6566
plot_op = tf_scatter([1, 2, 3], [1, 4, 9])
6667
self._check_plot_op_shape(plot_op)
67-
self.assertRegex(plot_op.name, 'scatter(_\d)?:0')
68+
self.assertTrue(re.match('scatter(_\d)?:0', plot_op.name))
6869

6970
def test_wrap_axesplot_kwarg(self):
7071
'''Basic functionality test of tfplot.wrap_axesplot() in successful cases.'''

0 commit comments

Comments
 (0)