fhalab / MLDE

A machine-learning package for navigating combinatorial protein fitness landscapes.
Other
120 stars 26 forks source link

pytest problems #1

Closed ChristophKnapp closed 3 years ago

ChristophKnapp commented 3 years ago

Hi, I followed your guide to install MLDE. The installation was successful and I run the first 2 data test. As far as I could tell everything was fine. When I started the pytest scripts it run into problems. It seems it can't locate the Support module. Inside the MLDE directory is a directory called Support though.

Do you have any idea what could have gone wrong?

Regards Christoph

(mlde) christoph@computer:~/bioinformatik/MLDE/MLDE$ PYTHONPATH=\$home/christoph/bioinformatik/MLDE/MLDE/ pytest ============================================================================================= test session starts ============================================================================================= platform linux -- Python 3.7.3, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 rootdir: /home/christoph/bioinformatik/MLDE/MLDE, configfile: pytest.ini plugins: cov-2.12.1 collected 1 item / 7 errors

=================================================================================================== ERRORS ==================================================================================================== ___ ERROR collecting Validation/pytest/Encode/testEncodingGenerator.py ____ ImportError while importing test module '/home/christoph/bioinformatik/MLDE/MLDE/Validation/pytest/Encode/test_EncodingGenerator.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: ../../../anaconda3/envs/mlde/lib/python3.7/importlib/init.py:127: in import_module return _bootstrap._gcd_import(name[level:], package, level) Validation/pytest/Encode/test_EncodingGenerator.py:16: in from Support.Encode.EncodingGenerator import EncodingGenerator E ModuleNotFoundError: No module named 'Support' __ ERROR collecting Validation/pytest/Run/test_FinalizeX.py ___ ImportError while importing test module '/home/christoph/bioinformatik/MLDE/MLDE/Validation/pytest/Run/test_FinalizeX.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: ../../../anaconda3/envs/mlde/lib/python3.7/importlib/init.py:127: in import_module return _bootstrap._gcd_import(name[level:], package, level) Validation/pytest/Run/test_FinalizeX.py:5: in from Support.Params.Defaults import cpu_models, gpu_models E ModuleNotFoundError: No module named 'Support' __ ERROR collecting Validation/pytest/Run/test_LossFuncs.py ___ ImportError while importing test module '/home/christoph/bioinformatik/MLDE/MLDE/Validation/pytest/Run/test_LossFuncs.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: ../../../anaconda3/envs/mlde/lib/python3.7/importlib/init.py:127: in import_module return _bootstrap._gcd_import(name[level:], package, level) Validation/pytest/Run/test_LossFuncs.py:5: in from Support.RunMlde.LossFuncs import mse E ModuleNotFoundError: No module named 'Support' ___ ERROR collecting Validation/pytest/Run/test_MldeClasses.py __ ImportError while importing test module '/home/christoph/bioinformatik/MLDE/MLDE/Validation/pytest/Run/test_MldeClasses.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: ../../../anaconda3/envs/mlde/lib/python3.7/importlib/init.py:127: in import_module return _bootstrap._gcd_import(name[level:], package, level) Validation/pytest/Run/testMldeClasses.py:5: in from Support.RunMlde.MldeClasses import (MldeModel, KerasModel, E ModuleNotFoundError: No module named 'Support' ____ ERROR collecting Validation/pytest/Run/testMldeHyperopt.py ____ ImportError while importing test module '/home/christoph/bioinformatik/MLDE/MLDE/Validation/pytest/Run/test_MldeHyperopt.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: ../../../anaconda3/envs/mlde/lib/python3.7/importlib/init.py:127: in import_module return _bootstrap._gcd_import(name[level:], package, level) Validation/pytest/Run/test_MldeHyperopt.py:12: in from Support.Params.Defaults import (cpu_models, gpu_models, default_model_params, E ModuleNotFoundError: No module named 'Support' _____ ERROR collecting Validation/pytest/Run/test_RunFuncs.py ___ ImportError while importing test module '/home/christoph/bioinformatik/MLDE/MLDE/Validation/pytest/Run/test_RunFuncs.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: ../../../anaconda3/envs/mlde/lib/python3.7/importlib/init.py:127: in import_module return _bootstrap._gcd_import(name[level:], package, level) Validation/pytest/Run/test_RunFuncs.py:14: in from Support.RunMlde.RunFuncs import (process_results, get_training_fromdesign, E ModuleNotFoundError: No module named 'Support' ____ ERROR collecting Validation/pytest/Run/test_TrainAndPredict.py ____ ImportError while importing test module '/home/christoph/bioinformatik/MLDE/MLDE/Validation/pytest/Run/test_TrainAndPredict.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: ../../../anaconda3/envs/mlde/lib/python3.7/importlib/init.py:127: in import_module return _bootstrap._gcd_import(name[level:], package, level) Validation/pytest/Run/test_TrainAndPredict.py:6: in from Support.Params.Defaults import (gpu_models, cpu_models, E ModuleNotFoundError: No module named 'Support' ============================================================================================== warnings summary =============================================================================================== ../../../anaconda3/envs/mlde/lib/python3.7/site-packages/Bio/Alphabet/init.py:26 /home/christoph/anaconda3/envs/mlde/lib/python3.7/site-packages/Bio/Alphabet/init.py:26: PendingDeprecationWarning: We intend to remove or replace Bio.Alphabet in 2020, ideally avoid using it explicitly in your code. Please get in touch if you will be adversely affected by this. https://github.com/biopython/biopython/issues/2046 PendingDeprecationWarning)

-- Docs: https://docs.pytest.org/en/stable/warnings.html =========================================================================================== short test summary info =========================================================================================== ERROR Validation/pytest/Encode/test_EncodingGenerator.py ERROR Validation/pytest/Run/test_FinalizeX.py ERROR Validation/pytest/Run/test_LossFuncs.py ERROR Validation/pytest/Run/test_MldeClasses.py ERROR Validation/pytest/Run/test_MldeHyperopt.py ERROR Validation/pytest/Run/test_RunFuncs.py ERROR Validation/pytest/Run/test_TrainAndPredict.py !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 7 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ======================================================================================== 1 warning, 7 errors in 0.75s =========================================================================================

brucejwittmann commented 3 years ago

Hi Christoph,

So sorry it's taken so long to get back to you. For whatever reason this issue was not pushed to my email. Are you running pytest out of the provided mlde environment? Pytest has a number of PATH-related issues depending on the version. Also make sure that you are running pytest out of the top-level directory and that your PYTHONPATH points to the top level directory.

brucejwittmann commented 3 years ago

The pytest implementation has been overhauled in v1.0.0, so I'm going to close this. If it's still a problem in the new version let me know and we can look into it more.