Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added test for the lattice thermal conductivity #88

Merged
merged 6 commits into from
Feb 9, 2024

Conversation

DjordjeDangic
Copy link
Collaborator

Added a test for the lattice thermal conductivity in tests/TestTC. Also changed the compilation flags for thermal conductivity which should quiet warnings during execution of the code (see #86 ).

@mesonepigreco
Copy link
Collaborator

Hi, it seems the test is failing because it does not find a file:

=========================== short test summary info ============================
FAILED tests/TestTC/test_tc.py::test_tc - ValueError: Error, file final_dyn1 does not exist.
====== 1 failed, 72 passed, 6 skipped, 1109 warnings in 358.39s (0:05:58) ======

Have you included it with git add?

@diegomartinez2
Copy link
Contributor

Strange, I can see the file in tests/TestTC/final_dyn1

@diegomartinez2
Copy link
Contributor

You need

total_path = os.path.dirname(os.path.abspath(__file__))
os.chdir(total_path)

@mesonepigreco
Copy link
Collaborator

As Diego mentioned, you need to add those lines at the beginning of your testing function. This happens because the test executes all the Python files from the project's root, not from the directory in which the test is located. This way, the relative paths are broken. Those lines change the path for that script to the one in which the script is located, thus enabling you to use relative paths in your testing function.

@mesonepigreco
Copy link
Collaborator

Ok, test are passing! Can I merge?

@DjordjeDangic
Copy link
Collaborator Author

Yes, please.

@mesonepigreco mesonepigreco merged commit 33ab3ce into SSCHAcode:master Feb 9, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants