From 3f4308ac16574dcbf0cf5981eb744259fdbce910 Mon Sep 17 00:00:00 2001 From: JosePizarro3 Date: Wed, 5 Jun 2024 18:10:10 +0200 Subject: [PATCH] Added sh script to generate coverage.txt in the project --- .gitignore | 1 - coverage.txt | 55 ++++++++++++++++++++++++++++++++ scripts/generate_coverage_txt.sh | 9 ++++++ 3 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 coverage.txt create mode 100755 scripts/generate_coverage_txt.sh diff --git a/.gitignore b/.gitignore index 65d09cd0..e744d987 100644 --- a/.gitignore +++ b/.gitignore @@ -45,7 +45,6 @@ htmlcov/ .cache nosetests.xml coverage.xml -coverage.txt *.cover *.py,cover .hypothesis/ diff --git a/coverage.txt b/coverage.txt new file mode 100644 index 00000000..c4293a71 --- /dev/null +++ b/coverage.txt @@ -0,0 +1,55 @@ +============================= test session starts ============================== +platform linux -- Python 3.9.19, pytest-5.4.3, py-1.11.0, pluggy-0.13.1 +rootdir: /home/josepizarro/nomad, inifile: pytest.ini +plugins: xdist-1.34.0, timeout-1.4.2, anyio-4.3.0, devtools-0.12.2, forked-1.6.0, cov-2.7.1 +collected 299 items + +tests/test_atoms_state.py ............................................. [ 15%] +tests/test_band_gap.py ..................... [ 22%] +tests/test_band_structure.py ................................ [ 32%] +tests/test_energies.py .. [ 33%] +tests/test_fermi_surface.py .. [ 34%] +tests/test_general.py .......... [ 37%] +tests/test_hopping_matrix.py .... [ 38%] +tests/test_model_method.py ........................................... [ 53%] +tests/test_model_system.py ........................ [ 61%] +tests/test_numerical_settings.py ................................ [ 71%] +tests/test_outputs.py ......................... [ 80%] +tests/test_permittivity.py .......... [ 83%] +tests/test_physical_properties.py ................... [ 89%] +tests/test_spectral_profile.py .................. [ 95%] +tests/test_utils.py ....... [ 98%] +tests/test_variables.py ..... [100%] + +---------- coverage: platform linux, python 3.9.19-final-0 ----------- +Name Stmts Miss Cover +-------------------------------------------------------------------------- +src/nomad_simulations/__init__.py 1 0 100% +src/nomad_simulations/atoms_state.py 187 18 90% +src/nomad_simulations/general.py 68 5 93% +src/nomad_simulations/model_method.py 259 74 71% +src/nomad_simulations/model_system.py 257 19 93% +src/nomad_simulations/numerical_settings.py 260 62 76% +src/nomad_simulations/outputs.py 89 6 93% +src/nomad_simulations/physical_property.py 90 1 99% +src/nomad_simulations/properties/__init__.py 7 0 100% +src/nomad_simulations/properties/band_gap.py 48 2 96% +src/nomad_simulations/properties/band_structure.py 107 20 81% +src/nomad_simulations/properties/energies.py 21 2 90% +src/nomad_simulations/properties/fermi_surface.py 12 1 92% +src/nomad_simulations/properties/hopping_matrix.py 24 2 92% +src/nomad_simulations/properties/permittivity.py 45 5 89% +src/nomad_simulations/properties/spectral_profile.py 254 123 52% +src/nomad_simulations/utils/__init__.py 1 0 100% +src/nomad_simulations/utils/utils.py 66 11 83% +src/nomad_simulations/variables.py 61 8 87% +-------------------------------------------------------------------------- +TOTAL 1857 359 81% + + +============================= 299 passed in 2.18s ============================== + + + + +Generated using './scripts/generate_coverage_txt.sh' in the terminal in the root folder of the project diff --git a/scripts/generate_coverage_txt.sh b/scripts/generate_coverage_txt.sh new file mode 100755 index 00000000..7ae97f91 --- /dev/null +++ b/scripts/generate_coverage_txt.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# Run pytest with coverage +python -m pytest --cov=src | tee coverage.txt + +# Append the generation message +echo " " >> coverage.txt +echo " " >> coverage.txt +echo -e "\n\nGenerated using './scripts/generate_coverage_txt.sh' in the terminal in the root folder of the project" >> coverage.txt