Skip to content

Commit 568345e

Browse files
committed
Fix pure python fastdtw
Signed-off-by: Vadim Markovtsev <[email protected]>
1 parent 39212b1 commit 568345e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

python/labours/labours.py

+7
Original file line numberDiff line numberDiff line change
@@ -1349,6 +1349,13 @@ def order_commits(chosen_people, days, people):
13491349
except ImportError as e:
13501350
print("Cannot import fastdtw: %s\nInstall it from https://github.com/slaypni/fastdtw" % e)
13511351
sys.exit(1)
1352+
# FIXME(vmarkovtsev): remove once https://github.com/slaypni/fastdtw/pull/28 is merged&released
1353+
try:
1354+
sys.modules["fastdtw.fastdtw"].__norm = lambda p: lambda a, b: numpy.linalg.norm(
1355+
numpy.atleast_1d(a) - numpy.atleast_1d(b), p)
1356+
except KeyError:
1357+
# the native extension does not have this bug
1358+
pass
13521359

13531360
devseries = defaultdict(list)
13541361
devstats = defaultdict(lambda: DevDay(0, 0, 0, 0, {}))

0 commit comments

Comments
 (0)