diff --git a/dtw/countPaths.py b/dtw/countPaths.py index 2ca550b..fdf92eb 100644 --- a/dtw/countPaths.py +++ b/dtw/countPaths.py @@ -58,7 +58,7 @@ def countPaths(d, debug=False): >>> ds = dtw( numpy.arange(3,10), numpy.arange(1,9), ... keep_internals=True, step_pattern=asymmetric); >>> countPaths(ds) -126.0 +126 """ # ENDIMPORT @@ -104,6 +104,7 @@ def countPaths(d, debug=False): return m if d.openEnd: - return numpy.sum(m[-1,]) + r = numpy.sum(m[-1,]) else: - return m[-1, -1] + r = m[-1, -1] + return int(r) diff --git a/dtw/dtw.py b/dtw/dtw.py index 292e896..9ad0965 100644 --- a/dtw/dtw.py +++ b/dtw/dtw.py @@ -342,9 +342,9 @@ def dtw(x, y=None, >>> plt.plot(da.index1,da.index2,'ro') # doctest: +SKIP ->>> ds.distance +>>> float(ds.distance) 2.0 ->>> da.distance +>>> float(da.distance) 2.0 """