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

Add Python 3.9 Support #64

Closed tylerwmarrs closed 3 years ago

tylerwmarrs commented 3 years ago

This is a fairly easy task for anyone that has the time to handle it. Basically, we need to see if all of our unit tests work on Python 3.9 and update the TravisCI configuration within the code.

This is where the Python 3.9 version will live. https://github.com/matrix-profile-foundation/matrixprofile/blob/master/.travis.yml#L14

lmmentel commented 3 years ago

I'm happy to help with that, will report back once I run the test against 3.9.

lmmentel commented 3 years ago

I have a working venv under python 3.9.1 and tried running the tests (from the master), following the code in travis, but all the tests failed trying to import a module that does not exist:

Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_visualize.py:17: in <module>
    from matrixprofile.algorithms.stomp import stomp
matrixprofile/__init__.py:6: in <module>
    from matrixprofile.version import __version__, __version_info__
E   ModuleNotFoundError: No module named 'matrixprofile.version'

Is that module deprecated or not added yet? I'm happy to add it or update the tests. Let me know what's the plan.

tylerwmarrs commented 3 years ago

@lmmentel Take a peek at the installation documentation. This is pointing to Linux, but we have MacOS and Windows instructions too.

https://matrixprofile.docs.matrixprofile.org/installation/Linux_Installation.html#Install-matrixprofile-for-Development

At first glance, it looks like you did not run:

pip install -e .

within the source directory.

lmmentel commented 3 years ago

Thanks @tylerwmarrs, I did install the package without the the -e flag and since version.py is outside of the package it couldn't import.

It seems all tests are passing under 3.9.1:

(venv)  ✘  ~/projects/matrixprofile   python39 ●  pytest tests  
Test session starts (platform: linux, Python 3.9.1, pytest 6.2.1, pytest-sugar 0.9.4)
rootdir: /home/lukasz/projects/matrixprofile
plugins: sugar-0.9.4
collecting ... 
 tests/test_analyze.py ✓✓✓✓✓✓✓                                                                                                                                          5% ▌         
 tests/test_annotation_vector.py ✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓                                                                                                                      15% █▌        
 tests/test_compute.py ✓✓✓✓✓✓✓✓✓                                                                                                                                       21% ██▏       
 tests/test_core.py ✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓                                                                                                                 43% ████▍     
 tests/test_cycore.py ✓✓✓✓                                                                                                                                             45% ████▌     
 tests/test_datasets.py ✓✓✓✓✓                                                                                                                                          48% ████▉     
 tests/test_hierarchical_clustering.py ✓✓✓                                                                                                                             50% █████     
 tests/test_io.py ✓✓✓✓                                                                                                                                                 53% █████▍    
 tests/test_mass2.py ✓                                                                                                                                                 54% █████▍    
 tests/test_mpdist.py ✓✓✓✓✓✓✓                                                                                                                                          58% █████▊    
 tests/test_mpx.py ✓✓✓✓✓✓✓✓                                                                                                                                            63% ██████▍   
 tests/test_pairwise_dist.py ✓✓✓                                                                                                                                       65% ██████▌   
 tests/test_preprocess.py ✓✓✓✓✓✓                                                                                                                                       69% ██████▉   
 tests/test_regimes.py ✓                                                                                                                                               70% ███████   
 tests/test_scrimp.py ✓✓✓✓✓✓✓                                                                                                                                          74% ███████▌  
 tests/test_skimp.py ✓✓✓✓✓                                                                                                                                             77% ███████▊  
 tests/test_snippets.py ✓✓✓✓                                                                                                                                           80% ████████  
 tests/test_statistics.py ✓✓✓✓✓✓                                                                                                                                       84% ████████▍ 
 tests/test_stomp.py ✓✓✓✓                                                                                                                                              86% ████████▋ 
 tests/test_top_k_discords.py ✓✓✓✓                                                                                                                                     89% ████████▉ 
 tests/test_top_k_motifs.py ✓                                                                                                                                          90% █████████ 
 tests/test_utils.py ✓✓                                                                                                                                                91% █████████▏
 tests/test_visualize.py ✓✓✓✓✓✓✓✓✓✓✓✓✓✓                                                                                                                               100% ██████████

I'll update travis.yml and README.md and submit a PR .