VlachosGroup / pMuTT

Python Multiscale Thermochemistry Toolbox (pMuTT)
https://vlachosgroup.github.io/pMuTT/
40 stars 23 forks source link

Unit tests failed #164

Closed MCVifpen closed 4 years ago

MCVifpen commented 4 years ago

Version of pMuTT 1.2.18

Describe the bug Hello, I ran the pmutt.run_tests() procedure after installation and it sent an error message:

To Reproduce

import pmutt pmutt.run_tests()

Screenshots

......................................................E.......................................................................................................................................................................................................
======================================================================
ERROR: test_set_vib_wavenumbers_from_outcar (input_output.test_pmutt_io_vasp.TestVasp)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/soft/irsrvsoft1/expl/eb/centos_7/software/MPI/GCC/8.2.0-2.31.1/OpenMPI/3.1.3/pMuTT/1.2.18-Python-3.7.2/lib/python3.7/site-packages/pmutt/tests/input_output/test_pmutt_io_vasp.py", line 23, in test_set_vib_wavenumbers_from_outcar
    vasp.set_vib_wavenumbers_from_outcar(test_file, out_dict, 0.)
  File "/soft/irsrvsoft1/expl/eb/centos_7/software/MPI/GCC/8.2.0-2.31.1/OpenMPI/3.1.3/pMuTT/1.2.18-Python-3.7.2/lib/python3.7/site-packages/pmutt/io/vasp.py", line 61, in set_vib_wavenumbers_from_outcar
    raise FileNotFoundError(err_msg)
FileNotFoundError: Invalid OUTCAR filename: /soft/irsrvsoft1/expl/eb/centos_7/software/MPI/GCC/8.2.0-2.31.1/OpenMPI/3.1.3/pMuTT/1.2.18-Python-3.7.2/lib/python3.7/site-packages/pmutt/tests/input_output/test_OUTCAR

----------------------------------------------------------------------
Ran 254 tests in 1.701s

FAILED (errors=1)

Additional context

I've checked the "pmutt/tests/input_output/ "folder and there aren't any VASP OUTCAR files (nor there are any other simulation code output files).

My system administrator installed pmutt on a linux machine. I did the same on my laptop windows pc (by using ananconda) and obtained the same result on both machines and environments.

I copied an OUTCAR file from my own calculations to the abovementioned folder. I obtained a different error message as the pmutt.run_tests() gets different numbers (form my calculation) as those expected (from your tabulated results).

Did we actually, for some reason, downdloaded pmutt without the necessary files to run the tests ?

Thank you very much for your help. Kind regards, Manuel

jonlym commented 4 years ago

Thanks for your interest in pMuTT and for reporting this. I can confirm that the test_OUTCAR file is not present when downloading pMuTT from pip so you did everything completely fine. We will fix this for the next release.

I copied an OUTCAR file from my own calculations to the abovementioned folder. I obtained a different error message as the pmutt.run_tests() gets different numbers (form my calculation) as those expected (from your tabulated results).

That's interesting. Could you share the error message, OUTCAR file, and your expected answer?

MCVifpen commented 4 years ago

Dear Jonathan,

Thank you for your quick response.

I reproduced the error with my own OUTCAR file. The expected answer is a simple « ok », which is what I got in my former laptop, when I installed the package for the Chicago NAM workshop one year ago.

This is the error I get now with my own file :

pmutt.run_tests() ......................................................F..........................................................................................................................................................C:\ProgramData\Anaconda3\lib\site-packages\xlrd\xlsx.py:266: PendingDeprecationWarning: This method will be removed in future versions. Use 'tree.iter()' or 'list(tree.iter())' instead. for elem in self.tree.iter() if Element_has_iter else self.tree.getiterator(): C:\ProgramData\Anaconda3\lib\site-packages\xlrd\xlsx.py:312: PendingDeprecationWarning: This method will be removed in future versions. Use 'tree.iter()' or 'list(tree.iter())' instead. for elem in self.tree.iter() if Element_has_iter else self.tree.getiterator(): .............................................

FAIL: test_set_vib_wavenumbers_from_outcar (input_output.test_pmutt_io_vasp.TestVasp)

Traceback (most recent call last): File "C:\ProgramData\Anaconda3\lib\site-packages\pmutt\tests\input_output\test_pmutt_io_vasp.py", line 24, in test_set_vib_wavenumbers_from_outcar self.assertDictEqual(out_dict, expected_wavenumber_nocutoff) AssertionError: {'vib_wavenumbers': [3779.526464, 2902.586968, 1097.421179, 974[814 chars]286]} != {'vib_wavenumbers': [3821.717493, 3703.479948, 1535.727129, 115[27 chars]843]} Diff is 3080 characters long. Set self.maxDiff to None to see it.


Ran 254 tests in 1.307s

FAILED (failures=1)

I might be wrong but this is what I deduce from this error message : from the line in bold, I guess that the program is comparing my frequencies (square bracked vector on the left) with something else already tabulted in the script’s program (water ?). Since both lists do not match, the program crashes and ends with an error message.

Regards, Manuel

De : Jonathan Lym [mailto:notifications@github.com] Envoyé : lundi 29 juin 2020 14:45 À : VlachosGroup/pMuTT Cc : CORRAL VALERO Manuel; Author Objet : Re: [VlachosGroup/pMuTT] Unit tests failed (#164)

Thanks for your interest in pMuTT and for reporting this. I can confirm that the test_OUTCAR file is not present when downloading pMuTT from pip so you did everything completely fine. We will fix this for the next release.

I copied an OUTCAR file from my own calculations to the abovementioned folder. I obtained a different error message as the pmutt.run_tests() gets different numbers (form my calculation) as those expected (from your tabulated results).

That's interesting. Could you share the error message, OUTCAR file, and your expected answer?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/VlachosGroup/pMuTT/issues/164#issuecomment-651095106, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQDTCERTNGBFWOFHUB5TRG3RZCEGHANCNFSM4OLBA6VA.


Avant d'imprimer, pensez à l'environnement ! Please consider the environment before printing ! Ce message et toutes ses pièces jointes sont confidentiels et établis à l'intention exclusive de ses destinataires. Toute utilisation non conforme à sa destination, toute diffusion ou toute publication, totale ou partielle, est interdite, sauf autorisation expresse. IFP Energies nouvelles décline toute responsabilité au titre de ce message. This message and any attachments are confidential and intended solely for the addressees. Any unauthorised use or dissemination is prohibited. IFP Energies nouvelles should not be liable for this message.


jonlym commented 4 years ago

Yup, you're exactly right. The test is expecting some specific frequencies so it will fail with a different OUTCAR.

I just wanted to point out the original bug is related to the unit tests (and not the pMuTT code) so you can still use pMuTT for your needs!

MCVifpen commented 4 years ago

Ok, then. Thank you very much ! Manuel

De : Jonathan Lym [mailto:notifications@github.com] Envoyé : lundi 29 juin 2020 15:30 À : VlachosGroup/pMuTT Cc : CORRAL VALERO Manuel; Author Objet : Re: [VlachosGroup/pMuTT] Unit tests failed (#164)

Yup, you're exactly right. The test is expecting some specific frequencies so it will fail with a different OUTCAR.

I just wanted to point out the original bug is related to the unit tests (and not the pMuTT code) so you can still use pMuTT for your needs!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/VlachosGroup/pMuTT/issues/164#issuecomment-651121186, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQDTCESSMQERI6HCBWSZDVDRZCJL3ANCNFSM4OLBA6VA.


Avant d'imprimer, pensez à l'environnement ! Please consider the environment before printing ! Ce message et toutes ses pièces jointes sont confidentiels et établis à l'intention exclusive de ses destinataires. Toute utilisation non conforme à sa destination, toute diffusion ou toute publication, totale ou partielle, est interdite, sauf autorisation expresse. IFP Energies nouvelles décline toute responsabilité au titre de ce message. This message and any attachments are confidential and intended solely for the addressees. Any unauthorised use or dissemination is prohibited. IFP Energies nouvelles should not be liable for this message.


jonlym commented 4 years ago

Updated pMuTT to version 1.2.21 to include OUTCAR file. After installing pMuTT to a new Anaconda environment, I confirmed that the tests folder was the necessary OUTCAR file and the tests seemed to pass.

>>> import pmutt
>>> print(pmutt.__file__)
C:\Users\jonat\.conda\envs\pmutt_1221\lib\site-packages\pmutt\__init__.py
>>> pmutt.run_tests()
..............................................................................................................................................................................................................................................................
----------------------------------------------------------------------
Ran 254 tests in 1.700s

OK