matrix-profile-foundation / matrixprofile

A Python 3 library making time series data mining tasks, utilizing matrix profile algorithms, accessible to everyone.
https://matrixprofile.org
Apache License 2.0
360 stars 62 forks source link

Replaced n_jobs=-1 with n_jobs=1 #60

Closed Bruno-Hanzen closed 3 years ago

Bruno-Hanzen commented 3 years ago

As discussed, in analyze.py; most calls use n_jobs=-1. changed them to n_jobs=1 , which should be the default option. n-jobs=-1 can lead to exaggerate resource consumption and decreased speed.

codecov[bot] commented 3 years ago

Codecov Report

Merging #60 (ef728b9) into master (c265aa9) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #60   +/-   ##
=======================================
  Coverage   92.18%   92.18%           
=======================================
  Files          30       30           
  Lines        2316     2316           
=======================================
  Hits         2135     2135           
  Misses        181      181           
Impacted Files Coverage Δ
matrixprofile/analyze.py 96.82% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c265aa9...ef728b9. Read the comment docs.

tylerwmarrs commented 3 years ago

Thank you for these changes. These function calls are not directly exposed in the API, however, someone could call them and have more resource usage as discussed. If you look at the API docs, you will see that the common way to call these functions is through the higher level "mp.analyze" function. That function has the n_jobs set to 1 by default. Regardless, it is better to have them consistent. :+1: