Skip to content

Added test for the lattice thermal conductivity - #88

Merged
mesonepigreco merged 6 commits into
SSCHAcode:masterfrom
DjordjeDangic:master
Feb 9, 2024
Merged

mesonepigreco merged 6 commits into
SSCHAcode:masterfrom
DjordjeDangic:master

Conversation

@DjordjeDangic

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

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

@diegomartinez2

Copy link
Copy Markdown
Contributor

You need

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

@mesonepigreco

Copy link
Copy Markdown
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
Copy Markdown
Collaborator

Ok, test are passing! Can I merge?

@DjordjeDangic

Copy link
Copy Markdown
Collaborator Author

Yes, please.

@mesonepigreco
mesonepigreco merged commit 33ab3ce into SSCHAcode:master Feb 9, 2024
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