Commit 2dae6bca authored by Franck Thollard's avatar Franck Thollard

fixing pb with import... still freezing

parent 097262e7
......@@ -7,8 +7,7 @@ import dask
from dask import delayed
from dask.distributed import Client
import numpy as np
from dtw_cort import cort, DTWDistance
from dtw_cort import cort, dtw_distance
util = run_path(Path(__file__).absolute().parent.parent / "util.py")
......@@ -35,7 +34,7 @@ def distances(series, idx_s1, idx_s2, res_dtw, res_cort):
:idx_s2: index of second serie in series
:res_sult: (tuple) idx_s1, idx_s2, dtw and cort between series[s1] and series[s2]
"""
dist_dtw = DTWDistance(series[idx_s1], series[idx_s2])
dist_dtw = dtw_distance(series[idx_s1], series[idx_s2])
dist_cort = 0.5 * (1 - cort(series[idx_s1], series[idx_s2]))
res_dtw[idx_s1, idx_s2] = dist_dtw
res_dtw[idx_s2, idx_s1] = dist_dtw
......@@ -52,7 +51,7 @@ def compute(series, nb_series):
inputs = ((series, t1, t2) for t1, t2 in gen)
res = [delayed(distances)(s, t1, t2, _dist_mat_dtw, _dist_mat_cort)
for s, t1, t2 in inputs]
dask.compute(res)
client.compute(res)
return _dist_mat_dtw, _dist_mat_cort
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment