tslearn-team / tslearn

The machine learning toolkit for time series analysis in Python
https://tslearn.readthedocs.io
BSD 2-Clause "Simplified" License
2.92k stars 342 forks source link

Fix KShape failing continuous integration test on MacOS #430

Closed YannCabanes closed 2 years ago

YannCabanes commented 2 years ago

The KShape test is failing on MacOS.

YannCabanes commented 2 years ago

The error message for the MacOS failing test is the following:

tslearn/clustering/kshape.py::tslearn.clustering.kshape.KShape Terminating: Nested parallel kernel launch detected, the workqueue threading layer does not supported nested parallelism. Try the TBB threading layer. Terminating: Nested parallel kernel launch detected, the workqueue threading layer does not supported nested parallelism. Try the TBB threading layer. Fatal Python error: /Users/runner/work/_temp/80fdeb9b-4d51-474f-9f05-fa436689cb97.sh: line 3: 2668 Abort trap: 6 python -m pytest -v tslearn/ --doctest-modules -k 'not test_all_estimators'

[error]Bash exited with code '134'.

YannCabanes commented 2 years ago

All the tests are failing due to the print function in the file kshape.py.

YannCabanes commented 2 years ago

The error message was related to a: Nested parallel kernel launch detected during the test of the file kshape.py.

In the imports of the file kshape.py, there is: from tslearn.metrics import cdist_normalized_cc, y_shifted_sbd_vec.

The functions cdist_normalized_cc and y_shifted_sbd_vec both call the function normalized_cc. Removing the option parallel=True from the jit decorator of the function normalized_cc solved the problem.