diff --git a/.codecov.yml b/.codecov.yml index 6e139f8d45..b3148f0fb1 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -1,8 +1,27 @@ coverage: status: project: - default: + default: false + coverage: target: 88% + paths: + - "src/metatrain/utils/.*" + - "src/metatrain/cli/.*" + coverage_gap: + paths: + - "src/metatrain/gap/.*" + coverage_pet: + paths: + - "src/metatrain/pet/.*" + coverage_soap_bpnn: + paths: + - "src/metatrain/soap_bpnn/.*" + coverage_llpr: + paths: + - "src/metatrain/llpr/.*" + coverage_nanopet: + paths: + - "src/metatrain/deprecated/nanopet/.*" patch: default: informational: true @@ -11,13 +30,6 @@ coverage: - "tests/.*" - "examples/.*" - "src/metatrain/utils/testing/.*" - # we don't check coverage for the architectures - - "src/metatrain/deprecated/.*" - - "src/metatrain/experimental/.*" - - "src/metatrain/gap/.*" - - "src/metatrain/pet/.*" - - "src/metatrain/soap_bpnn/.*" - - "src/metatrain/llpr/.*" # we don't currently run distributed tests on CI - "src/metatrain/utils/distributed/.*" diff --git a/.github/workflows/architecture-tests.yml b/.github/workflows/architecture-tests.yml index 4f412c5f49..e81e15aab9 100644 --- a/.github/workflows/architecture-tests.yml +++ b/.github/workflows/architecture-tests.yml @@ -28,10 +28,21 @@ jobs: uses: actions/setup-python@v6 with: python-version: "3.13" - - run: pip install tox + - run: pip install tox coverage[toml] - - name: run architecture tests - run: tox -e ${{ matrix.architecture-name }}-tests + - name: run architecture tests and generate coverage + run: | + coverage erase + coverage run --source src/metatrain \ + $(which tox) -e ${{ matrix.architecture-name }}-tests env: # Use the CPU only version of torch when building/running the code PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu + + - name: upload to codecov.io + uses: codecov/codecov-action@v5 + with: + fail_ci_if_error: false + files: .coverage + flags: coverage_${{ matrix.architecture-name }} + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/docs/src/architectures/gap.rst b/docs/src/architectures/gap.rst index edd6afd05f..0dbcdcbb31 100644 --- a/docs/src/architectures/gap.rst +++ b/docs/src/architectures/gap.rst @@ -3,6 +3,8 @@ GAP === +[![GAP coverage](https://codecov.io/gh/metatensor/metatrain/branch/main/graph/badge.svg?flag=coverage_gap)](https://codecov.io/gh/metatensor/metatrain/tree/main/src/metatrain/gap) + This is an implementation of the sparse Gaussian Approximation Potential (GAP) :footcite:p:`bartok_representing_2013` using Smooth Overlap of Atomic Positions (SOAP) :footcite:p:`bartok_gaussian_2010` implemented in `featomic `_. diff --git a/docs/src/architectures/llpr.rst b/docs/src/architectures/llpr.rst index 4ba5a5a3b0..70ed20aba6 100644 --- a/docs/src/architectures/llpr.rst +++ b/docs/src/architectures/llpr.rst @@ -3,6 +3,8 @@ LLPR ==== +[![LLPR coverage](https://codecov.io/gh/metatensor/metatrain/branch/main/graph/badge.svg?flag=coverage_llpr)](https://codecov.io/gh/metatensor/metatrain/tree/main/src/metatrain/llpr) + The LLPR architecture is a "wrapper" architecture that enables cheap uncertainty quantification (UQ) via the last-layer prediction rigidity (LLPR) approach proposed by Bigi et al. :footcite:p:`bigi_mlst_2024` It is compatible with the following diff --git a/docs/src/architectures/nanopet.rst b/docs/src/architectures/nanopet.rst index 821c93a004..ab53a14a9c 100644 --- a/docs/src/architectures/nanopet.rst +++ b/docs/src/architectures/nanopet.rst @@ -3,6 +3,8 @@ NanoPET (deprecated) ====================== +[![NanoPET coverage](https://codecov.io/gh/metatensor/metatrain/branch/main/graph/badge.svg?flag=coverage_nanopet)](https://codecov.io/gh/metatensor/metatrain/tree/main/src/metatrain/deprecated/nanopet) + .. warning:: This is an **deprecated model**. You should not use it for anything important, and diff --git a/docs/src/architectures/pet.rst b/docs/src/architectures/pet.rst index ddf04a9879..1ba12c2b61 100644 --- a/docs/src/architectures/pet.rst +++ b/docs/src/architectures/pet.rst @@ -3,6 +3,8 @@ PET === +[![PET coverage](https://codecov.io/gh/metatensor/metatrain/branch/main/graph/badge.svg?flag=coverage_pet)](https://codecov.io/gh/metatensor/metatrain/tree/main/src/metatrain/pet) + PET is a cleaner, more user-friendly reimplementation of the original PET model :footcite:p:`pozdnyakov_smooth_2023`. It is designed for better modularity and maintainability, while preseving compatibility with the original diff --git a/docs/src/architectures/soap-bpnn.rst b/docs/src/architectures/soap-bpnn.rst index fd79440d31..f9977aa4cf 100644 --- a/docs/src/architectures/soap-bpnn.rst +++ b/docs/src/architectures/soap-bpnn.rst @@ -3,6 +3,8 @@ SOAP-BPNN ========= +[![SOAP-BPNN coverage](https://codecov.io/gh/metatensor/metatrain/branch/main/graph/badge.svg?flag=coverage_soap_bpnn)](https://codecov.io/gh/metatensor/metatrain/tree/main/src/metatrain/soap_bpnn) + This is a Behler-Parrinello type neural network :footcite:p:`behler_generalized_2007`, which, instead of their original atom-centered symmetry functions, we use the Smooth overlap of atomic positions (SOAP) :footcite:p:`bartok_representing_2013` as the atomic diff --git a/tox.ini b/tox.ini index 8c5860ee6c..91b78015b0 100644 --- a/tox.ini +++ b/tox.ini @@ -10,6 +10,7 @@ envlist = soap-bpnn-tests pet-tests nanopet-tests + llpr-tests [testenv] package = editable @@ -112,7 +113,6 @@ commands = python -m pip install --no-build-isolation sphericart torch-spex>=0.1,<0.2 wigners cmake pytest {posargs} - [testenv:pet-tests] description = Run PET tests with pytest passenv = * @@ -144,13 +144,13 @@ changedir = src/metatrain/deprecated/nanopet/tests/ commands = pytest {posargs} -[testenv:llpr] +[testenv:llpr-tests] description = Run LLPR tests with pytest passenv = * deps = pytest extras = llpr -changedir = src/metatrain/experimental/llpr/tests/ +changedir = src/metatrain/llpr/tests/ commands = pytest {posargs}