atomec-project / atoMEC

Python-based average-atom code for simulations of high energy density phenomena such as in warm dense matter.
https://atomec-project.github.io/atoMEC/
BSD 3-Clause "New" or "Revised" License
17 stars 12 forks source link

Add unit tests #135

Closed timcallow closed 2 years ago

timcallow commented 2 years ago

In this PR we will add unit tests. Ultimately we should aim for (almost) full coverage.

timcallow commented 2 years ago

@DanielKotik this is now ready for your review.

Output from pytest --cov=atoMEC --random-order: test_results_statements

Output from pytest --cov=atoMEC --cov-branch --random-order: Branch_coverage

Warnings seem to be caused (at least mostly) by use of np.matrix (#136). This will be fixed in a new PR.

I guess we need to add the various pytest dependencies to the Pipfile @DanielKotik?

pytest_deps

(I think pytest-mock, pytest-forked and pytest-xdist are installed with the main pytest package anyway).

timcallow commented 2 years ago

I've recently noticed I'm getting a bunch of warnings like this as well:

Other_warning

I've been trying but so far failing to figure out the problem / solution. There are some mentions of this issue online (e.g. here) but it didn't really help me yet. Do you also see these warnings @DanielKotik?