From b149a06ab0e5b68615dbb8539fc9088ae44a4601 Mon Sep 17 00:00:00 2001 From: Sofiia Chorna Date: Wed, 8 Oct 2025 11:25:26 +0200 Subject: [PATCH 01/28] Change coverage configuration file --- .codecov.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.codecov.yml b/.codecov.yml index 6e139f8d45..c141750f2c 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -1,8 +1,20 @@ coverage: status: project: - default: + default: false + coverage: target: 88% + paths: + - "src/metatrain/utils/.*" + - "src/metatrain/cli/.*" + coverage_architectures: + paths: + - "src/metatrain/deprecated/.*" + - "src/metatrain/experimental/.*" + - "src/metatrain/gap/.*" + - "src/metatrain/pet/.*" + - "src/metatrain/soap_bpnn/.*" + - "src/metatrain/llpr/.*" patch: default: informational: true @@ -11,13 +23,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/.*" From 6f6132554cc0f80ed79c9ebaeac6a8fffeef40ca Mon Sep 17 00:00:00 2001 From: Sofiia Chorna Date: Wed, 8 Oct 2025 11:55:13 +0200 Subject: [PATCH 02/28] Include pytest-cov to architecture tests --- tox.ini | 45 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/tox.ini b/tox.ini index 8c5860ee6c..57cb307301 100644 --- a/tox.ini +++ b/tox.ini @@ -105,12 +105,19 @@ description = Run SOAP-BPNN tests with pytest passenv = * deps = pytest + pytest-cov spherical # tensor target tests cmake changedir = src/metatrain/soap_bpnn/tests/ +setenv = + COVERAGE_RUN = 1 commands = python -m pip install --no-build-isolation sphericart torch-spex>=0.1,<0.2 wigners cmake - pytest {posargs} + pytest \ + --cov=metatrain \ + --cov-append \ + --cov-report= \ + {posargs} [testenv:pet-tests] @@ -118,20 +125,34 @@ description = Run PET tests with pytest passenv = * deps = pytest + pytest-cov extras = pet changedir = src/metatrain/pet/tests/ +setenv = + COVERAGE_RUN = 1 commands = - pytest {posargs} + pytest \ + --cov=metatrain \ + --cov-append \ + --cov-report= \ + {posargs} [testenv:gap-tests] description = Run GAP tests with pytest passenv = * deps = pytest + pytest-cov extras = gap changedir = src/metatrain/gap/tests/ +setenv = + COVERAGE_RUN = 1 commands = - pytest {posargs} + pytest \ + --cov=metatrain \ + --cov-append \ + --cov-report= \ + {posargs} [testenv:nanopet-tests] description = Run NanoPET tests with pytest @@ -139,20 +160,34 @@ passenv = * deps = pytest spherical # for nanoPET spherical target + pytest-cov extras = nanopet changedir = src/metatrain/deprecated/nanopet/tests/ +setenv = + COVERAGE_RUN = 1 commands = - pytest {posargs} + pytest \ + --cov=metatrain \ + --cov-append \ + --cov-report= \ + {posargs} [testenv:llpr] description = Run LLPR tests with pytest passenv = * deps = pytest + pytest-cov extras = llpr changedir = src/metatrain/experimental/llpr/tests/ +setenv = + COVERAGE_RUN = 1 commands = - pytest {posargs} + pytest \ + --cov=metatrain \ + --cov-append \ + --cov-report= \ + {posargs} [testenv:docs] description = builds the documentation with sphinx From 48707f7ef6624d31b42b1a79ab074a7933b7ed63 Mon Sep 17 00:00:00 2001 From: Sofiia Chorna Date: Wed, 8 Oct 2025 11:56:35 +0200 Subject: [PATCH 03/28] Add llpr to envlist --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index 57cb307301..971862aefd 100644 --- a/tox.ini +++ b/tox.ini @@ -10,6 +10,7 @@ envlist = soap-bpnn-tests pet-tests nanopet-tests + llpr [testenv] package = editable From ffe3471c14961f3918086d09a98e3755609e5428 Mon Sep 17 00:00:00 2001 From: Sofiia Chorna Date: Wed, 8 Oct 2025 12:04:42 +0200 Subject: [PATCH 04/28] Add architecture tests to github ci steps --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6e98cbd68f..e4e00f47c8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -41,7 +41,7 @@ jobs: - name: run Python tests and collect coverage run: | - tox -e tests + tox -e tests,gap-tests,soap-bpnn-tests,pet-tests,nanopet-tests,llpr coverage xml --data-file tests/.coverage env: # Use the CPU only version of torch when building/running the code From 1171997e0e979bd63df64295c775702eed0edb84 Mon Sep 17 00:00:00 2001 From: Sofiia Chorna Date: Wed, 8 Oct 2025 12:34:37 +0200 Subject: [PATCH 05/28] Add badge to doc --- docs/src/architectures/index.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/src/architectures/index.rst b/docs/src/architectures/index.rst index 26592310e8..f978eff2ab 100644 --- a/docs/src/architectures/index.rst +++ b/docs/src/architectures/index.rst @@ -3,6 +3,8 @@ Available Architectures ======================= +[![architecture coverage](https://codecov.io/gh/metatensor/metatrain/branch/main/graph/badge.svg?flag=coverage_architectures)](https://codecov.io/gh/metatensor/metatrain) + This is a list of all architectures available in ``metatrain``. .. toctree:: From e0d3c189bec9a96e6457264bfefff74b8eca3a72 Mon Sep 17 00:00:00 2001 From: Sofiia Chorna Date: Wed, 8 Oct 2025 13:22:24 +0200 Subject: [PATCH 06/28] Rename llpr to llpr-tests --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 971862aefd..09c0d7b0cc 100644 --- a/tox.ini +++ b/tox.ini @@ -10,7 +10,7 @@ envlist = soap-bpnn-tests pet-tests nanopet-tests - llpr + llpr-tests [testenv] package = editable @@ -173,7 +173,7 @@ commands = --cov-report= \ {posargs} -[testenv:llpr] +[testenv:llpr-tests] description = Run LLPR tests with pytest passenv = * deps = From d83af02b3b932146c58872b6777eee91fc8f6add Mon Sep 17 00:00:00 2001 From: Sofiia Chorna Date: Wed, 8 Oct 2025 13:41:01 +0200 Subject: [PATCH 07/28] Separate coverage configs and badges --- .codecov.yml | 13 ++++++++++--- docs/src/architectures/gap.rst | 2 ++ docs/src/architectures/index.rst | 2 -- docs/src/architectures/llpr.rst | 2 ++ docs/src/architectures/nanopet.rst | 2 ++ docs/src/architectures/pet.rst | 2 ++ docs/src/architectures/soap-bpnn.rst | 2 ++ 7 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.codecov.yml b/.codecov.yml index c141750f2c..b3148f0fb1 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -7,14 +7,21 @@ coverage: paths: - "src/metatrain/utils/.*" - "src/metatrain/cli/.*" - coverage_architectures: + coverage_gap: paths: - - "src/metatrain/deprecated/.*" - - "src/metatrain/experimental/.*" - "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 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/index.rst b/docs/src/architectures/index.rst index f978eff2ab..26592310e8 100644 --- a/docs/src/architectures/index.rst +++ b/docs/src/architectures/index.rst @@ -3,8 +3,6 @@ Available Architectures ======================= -[![architecture coverage](https://codecov.io/gh/metatensor/metatrain/branch/main/graph/badge.svg?flag=coverage_architectures)](https://codecov.io/gh/metatensor/metatrain) - This is a list of all architectures available in ``metatrain``. .. toctree:: 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 From 774b33bc2e8e672d9b10da9a047186ff896d9d45 Mon Sep 17 00:00:00 2001 From: Sofiia Chorna Date: Wed, 8 Oct 2025 14:19:56 +0200 Subject: [PATCH 08/28] Move coverage checks to architectures test workflow --- .github/workflows/architecture-tests.yml | 23 ++++++++++-- .github/workflows/tests.yml | 2 +- tox.ini | 46 ++++-------------------- 3 files changed, 27 insertions(+), 44 deletions(-) diff --git a/.github/workflows/architecture-tests.yml b/.github/workflows/architecture-tests.yml index 4f412c5f49..ca1fccd442 100644 --- a/.github/workflows/architecture-tests.yml +++ b/.github/workflows/architecture-tests.yml @@ -18,6 +18,12 @@ jobs: - llpr - pet - nanopet + codecov-flag: + - coverage_gap + - coverage_soap_bpnn + - coverage_llpr + - coverage_pet + - coverage_nanopet runs-on: ubuntu-22.04 @@ -28,10 +34,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: ${{ matrix.codecov-flag }} + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e4e00f47c8..6e98cbd68f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -41,7 +41,7 @@ jobs: - name: run Python tests and collect coverage run: | - tox -e tests,gap-tests,soap-bpnn-tests,pet-tests,nanopet-tests,llpr + tox -e tests coverage xml --data-file tests/.coverage env: # Use the CPU only version of torch when building/running the code diff --git a/tox.ini b/tox.ini index 09c0d7b0cc..4802d50c5e 100644 --- a/tox.ini +++ b/tox.ini @@ -106,19 +106,13 @@ description = Run SOAP-BPNN tests with pytest passenv = * deps = pytest - pytest-cov spherical # tensor target tests cmake changedir = src/metatrain/soap_bpnn/tests/ -setenv = - COVERAGE_RUN = 1 commands = python -m pip install --no-build-isolation sphericart torch-spex>=0.1,<0.2 wigners cmake - pytest \ - --cov=metatrain \ - --cov-append \ - --cov-report= \ - {posargs} + pytest {posargs} + [testenv:pet-tests] @@ -126,34 +120,20 @@ description = Run PET tests with pytest passenv = * deps = pytest - pytest-cov extras = pet changedir = src/metatrain/pet/tests/ -setenv = - COVERAGE_RUN = 1 commands = - pytest \ - --cov=metatrain \ - --cov-append \ - --cov-report= \ - {posargs} + pytest {posargs} [testenv:gap-tests] description = Run GAP tests with pytest passenv = * deps = pytest - pytest-cov extras = gap changedir = src/metatrain/gap/tests/ -setenv = - COVERAGE_RUN = 1 commands = - pytest \ - --cov=metatrain \ - --cov-append \ - --cov-report= \ - {posargs} + pytest {posargs} [testenv:nanopet-tests] description = Run NanoPET tests with pytest @@ -161,34 +141,20 @@ passenv = * deps = pytest spherical # for nanoPET spherical target - pytest-cov extras = nanopet changedir = src/metatrain/deprecated/nanopet/tests/ -setenv = - COVERAGE_RUN = 1 commands = - pytest \ - --cov=metatrain \ - --cov-append \ - --cov-report= \ - {posargs} + pytest {posargs} [testenv:llpr-tests] description = Run LLPR tests with pytest passenv = * deps = pytest - pytest-cov extras = llpr changedir = src/metatrain/experimental/llpr/tests/ -setenv = - COVERAGE_RUN = 1 commands = - pytest \ - --cov=metatrain \ - --cov-append \ - --cov-report= \ - {posargs} + pytest {posargs} [testenv:docs] description = builds the documentation with sphinx From cc16998774f067369cd9fa9a450dfdc117fc29a2 Mon Sep 17 00:00:00 2001 From: Sofiia Chorna Date: Wed, 8 Oct 2025 14:32:47 +0200 Subject: [PATCH 09/28] Fix path to llpr --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 4802d50c5e..230f03793c 100644 --- a/tox.ini +++ b/tox.ini @@ -152,7 +152,7 @@ passenv = * deps = pytest extras = llpr -changedir = src/metatrain/experimental/llpr/tests/ +changedir = src/metatrain/llpr/tests/ commands = pytest {posargs} From e96653a3e1ce0aaf3ad4e2ac37da3d57208a913f Mon Sep 17 00:00:00 2001 From: Sofiia Chorna Date: Wed, 8 Oct 2025 14:49:39 +0200 Subject: [PATCH 10/28] Fix codecov-flag duplications --- .github/workflows/architecture-tests.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/architecture-tests.yml b/.github/workflows/architecture-tests.yml index ca1fccd442..e81e15aab9 100644 --- a/.github/workflows/architecture-tests.yml +++ b/.github/workflows/architecture-tests.yml @@ -18,12 +18,6 @@ jobs: - llpr - pet - nanopet - codecov-flag: - - coverage_gap - - coverage_soap_bpnn - - coverage_llpr - - coverage_pet - - coverage_nanopet runs-on: ubuntu-22.04 @@ -50,5 +44,5 @@ jobs: with: fail_ci_if_error: false files: .coverage - flags: ${{ matrix.codecov-flag }} + flags: coverage_${{ matrix.architecture-name }} token: ${{ secrets.CODECOV_TOKEN }} From 0f625a220b0924d93a267193adcf40bc6f7d5eac Mon Sep 17 00:00:00 2001 From: Sofiia Chorna Date: Wed, 8 Oct 2025 14:50:26 +0200 Subject: [PATCH 11/28] Delete additional spacing --- tox.ini | 2 -- 1 file changed, 2 deletions(-) diff --git a/tox.ini b/tox.ini index 230f03793c..91b78015b0 100644 --- a/tox.ini +++ b/tox.ini @@ -113,8 +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 = * From d5eacd9e77dff4f1b2758a07bbc6bd193750bb77 Mon Sep 17 00:00:00 2001 From: Sofiia Chorna Date: Thu, 6 Nov 2025 12:26:25 +0100 Subject: [PATCH 12/28] Replace markdown with rst --- docs/src/architectures/gap.rst | 3 ++- docs/src/architectures/llpr.rst | 3 ++- docs/src/architectures/nanopet.rst | 3 ++- docs/src/architectures/pet.rst | 3 ++- docs/src/architectures/soap-bpnn.rst | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/src/architectures/gap.rst b/docs/src/architectures/gap.rst index 0dbcdcbb31..11df961677 100644 --- a/docs/src/architectures/gap.rst +++ b/docs/src/architectures/gap.rst @@ -3,7 +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) +.. image:: https://codecov.io/gh/metatensor/metatrain/branch/main/graph/badge.svg?flag=coverage_gap + :target: 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 diff --git a/docs/src/architectures/llpr.rst b/docs/src/architectures/llpr.rst index 70ed20aba6..6965fe242b 100644 --- a/docs/src/architectures/llpr.rst +++ b/docs/src/architectures/llpr.rst @@ -3,7 +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) +.. image:: https://codecov.io/gh/metatensor/metatrain/branch/main/graph/badge.svg?flag=coverage_llpr + :target: 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 diff --git a/docs/src/architectures/nanopet.rst b/docs/src/architectures/nanopet.rst index ab53a14a9c..a7ba640bbc 100644 --- a/docs/src/architectures/nanopet.rst +++ b/docs/src/architectures/nanopet.rst @@ -3,7 +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) +.. image:: https://codecov.io/gh/metatensor/metatrain/branch/main/graph/badge.svg?flag=coverage_nanopet + :target: https://codecov.io/gh/metatensor/metatrain/tree/main/src/metatrain/deprecated/nanopet .. warning:: diff --git a/docs/src/architectures/pet.rst b/docs/src/architectures/pet.rst index 1ba12c2b61..b7b72ee32b 100644 --- a/docs/src/architectures/pet.rst +++ b/docs/src/architectures/pet.rst @@ -3,7 +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) +.. image:: https://codecov.io/gh/metatensor/metatrain/branch/main/graph/badge.svg?flag=coverage_pet + :target: 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 diff --git a/docs/src/architectures/soap-bpnn.rst b/docs/src/architectures/soap-bpnn.rst index f9977aa4cf..04c65501a5 100644 --- a/docs/src/architectures/soap-bpnn.rst +++ b/docs/src/architectures/soap-bpnn.rst @@ -3,7 +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) +.. image:: https://codecov.io/gh/metatensor/metatrain/branch/main/graph/badge.svg?flag=coverage_soap_bpnn + :target: 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 From cb78198c24877a65e4585b24ad8f940ae5c861df Mon Sep 17 00:00:00 2001 From: Sofiia Chorna Date: Thu, 6 Nov 2025 12:29:33 +0100 Subject: [PATCH 13/28] Move coverage to tox.ini to have it locally --- .codecov.yml | 12 ++++++++++ .github/workflows/architecture-tests.yml | 7 +++--- .github/workflows/tests.yml | 6 ++--- tox.ini | 30 +++++++++++++++--------- 4 files changed, 36 insertions(+), 19 deletions(-) diff --git a/.codecov.yml b/.codecov.yml index b3148f0fb1..386d417593 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -7,21 +7,33 @@ coverage: paths: - "src/metatrain/utils/.*" - "src/metatrain/cli/.*" + flags: + - coverage_tests coverage_gap: paths: - "src/metatrain/gap/.*" + flags: + - coverage_gap coverage_pet: paths: - "src/metatrain/pet/.*" + flags: + - coverage_pet coverage_soap_bpnn: paths: - "src/metatrain/soap_bpnn/.*" + flags: + - coverage_soap_bpnn coverage_llpr: paths: - "src/metatrain/llpr/.*" + flags: + - coverage_llpr coverage_nanopet: paths: - "src/metatrain/deprecated/nanopet/.*" + flags: + - coverage_nanopet patch: default: informational: true diff --git a/.github/workflows/architecture-tests.yml b/.github/workflows/architecture-tests.yml index e81e15aab9..a4783641e6 100644 --- a/.github/workflows/architecture-tests.yml +++ b/.github/workflows/architecture-tests.yml @@ -32,9 +32,8 @@ jobs: - name: run architecture tests and generate coverage run: | - coverage erase - coverage run --source src/metatrain \ - $(which tox) -e ${{ matrix.architecture-name }}-tests + tox -e ${{ matrix.architecture-name }}-tests + coverage xml -o coverage.xml env: # Use the CPU only version of torch when building/running the code PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu @@ -43,6 +42,6 @@ jobs: uses: codecov/codecov-action@v5 with: fail_ci_if_error: false - files: .coverage + files: coverage.xml flags: coverage_${{ matrix.architecture-name }} token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index dd8d14339b..773f1bd768 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,10 +39,8 @@ jobs: python-version: ${{ matrix.python-version }} - run: pip install tox coverage[toml] - - name: run Python tests and collect coverage - run: | - tox -e tests - coverage xml --data-file tests/.coverage + - name: run Python tests + run: tox -e tests env: # Use the CPU only version of torch when building/running the code PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu diff --git a/tox.ini b/tox.ini index 91b78015b0..1bd2a3f7bd 100644 --- a/tox.ini +++ b/tox.ini @@ -21,6 +21,8 @@ lint_folders = "{toxinidir}/src/" \ "{toxinidir}/tests/" \ "{toxinidir}/docs/src/" +setenv = + COVERAGE_FILE = {toxinidir}/.coverage [testenv:lint] description = Run linters and type checks @@ -79,7 +81,7 @@ commands = --numprocesses=auto \ --cov=metatrain \ --cov-append \ - --cov-report= \ + --cov-report=term \ --import-mode=append \ {posargs} @@ -102,57 +104,63 @@ commands = check-manifest {toxinidir} [testenv:soap-bpnn-tests] -description = Run SOAP-BPNN tests with pytest +description = Run SOAP-BPNN tests with pytest and collect coverage passenv = * deps = pytest + pytest-cov spherical # tensor target tests cmake +extras = soap-bpnn changedir = src/metatrain/soap_bpnn/tests/ commands = python -m pip install --no-build-isolation sphericart torch-spex>=0.1,<0.2 wigners cmake - pytest {posargs} + pytest --cov=metatrain.soap_bpnn --cov-append --cov-report= {posargs} [testenv:pet-tests] -description = Run PET tests with pytest +description = Run PET tests with pytest and collect coverage passenv = * deps = pytest + pytest-cov extras = pet changedir = src/metatrain/pet/tests/ commands = - pytest {posargs} + pytest --cov=metatrain.pet --cov-append --cov-report=term {posargs} [testenv:gap-tests] -description = Run GAP tests with pytest +description = Run GAP tests with pytest and collect coverage passenv = * deps = pytest + pytest-cov extras = gap changedir = src/metatrain/gap/tests/ commands = - pytest {posargs} + pytest --cov=metatrain.gap --cov-append --cov-report=term {posargs} [testenv:nanopet-tests] -description = Run NanoPET tests with pytest +description = Run NanoPET tests with pytest and collect coverage passenv = * deps = pytest + pytest-cov spherical # for nanoPET spherical target extras = nanopet changedir = src/metatrain/deprecated/nanopet/tests/ commands = - pytest {posargs} + pytest --cov=metatrain.deprecated.nanopet --cov-append --cov-report=term {posargs} [testenv:llpr-tests] -description = Run LLPR tests with pytest +description = Run LLPR tests with pytest and collect coverage passenv = * deps = pytest + pytest-cov extras = llpr changedir = src/metatrain/llpr/tests/ commands = - pytest {posargs} + pytest --cov=metatrain.llpr --cov-append --cov-report=term {posargs} [testenv:docs] description = builds the documentation with sphinx From e30967e793f67aab9f58043fbe3eafff5dc44637 Mon Sep 17 00:00:00 2001 From: Sofiia Chorna Date: Thu, 6 Nov 2025 13:06:02 +0100 Subject: [PATCH 14/28] Remove already deleted command from main --- tox.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/tox.ini b/tox.ini index 15e1acdc5e..18ad756861 100644 --- a/tox.ini +++ b/tox.ini @@ -159,7 +159,6 @@ deps = extras = soap-bpnn changedir = src/metatrain/soap_bpnn/tests/ commands = - python -m pip install --no-build-isolation sphericart torch-spex>=0.1,<0.2 wigners cmake pytest --cov=metatrain.soap_bpnn --cov-append --cov-report=term {posargs} [testenv:pet-tests] From 1162c518b3c2382adef9393405222b2c5acb70df Mon Sep 17 00:00:00 2001 From: Sofiia Chorna Date: Thu, 6 Nov 2025 13:14:53 +0100 Subject: [PATCH 15/28] Added flashmd --- .codecov.yml | 5 +++++ docs/src/architectures/flashmd.rst | 3 +++ tox.ini | 5 +++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.codecov.yml b/.codecov.yml index 386d417593..dadeb3be98 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -34,6 +34,11 @@ coverage: - "src/metatrain/deprecated/nanopet/.*" flags: - coverage_nanopet + coverage_flashmd: + paths: + - "src/metatrain/experimental/flashmd/.*" + flags: + - coverage_flashmd patch: default: informational: true diff --git a/docs/src/architectures/flashmd.rst b/docs/src/architectures/flashmd.rst index 79aed303e3..30155ca9d4 100644 --- a/docs/src/architectures/flashmd.rst +++ b/docs/src/architectures/flashmd.rst @@ -3,6 +3,9 @@ FlashMD ======= +.. image:: https://codecov.io/gh/metatensor/metatrain/branch/main/graph/badge.svg?flag=coverage_flashmd + :target: https://codecov.io/gh/metatensor/metatrain/tree/main/src/metatrain/flashmd + FlashMD is a method for the direct prediction of positions and momenta in a molecular dynamics simulation, presented in :footcite:p:`bigi_flashmd_2025`. When compared to traditional molecular dynamics methods, it predicts the positions and momenta of atoms diff --git a/tox.ini b/tox.ini index 18ad756861..da12e42a39 100644 --- a/tox.ini +++ b/tox.ini @@ -207,14 +207,15 @@ commands = pytest --cov=metatrain.llpr --cov-append --cov-report=term {posargs} [testenv:flashmd-tests] -description = Run FlashMD tests with pytest +description = Run FlashMD tests with pytest and collect coverage passenv = * deps = pytest + pytest-cov extras = flashmd changedir = src/metatrain/experimental/flashmd/tests/ commands = - pytest {posargs} + pytest --cov=metatrain.experimental.flashmd --cov-append --cov-report=term {posargs} [testenv:docs] description = builds the documentation with sphinx From 08f303e1324a605c2ed46b36b0d1decd6703c991 Mon Sep 17 00:00:00 2001 From: Sofiia Chorna Date: Fri, 7 Nov 2025 11:37:01 +0100 Subject: [PATCH 16/28] Failling llpr checkpoint to be fixed separatelly --- tox.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/tox.ini b/tox.ini index 18ad756861..acc67b6a80 100644 --- a/tox.ini +++ b/tox.ini @@ -13,7 +13,6 @@ envlist = soap-bpnn-tests pet-tests nanopet-tests - llpr-tests flashmd-tests [testenv] From 6f5644412d155f3fccabaf9f15f096d351e8e62b Mon Sep 17 00:00:00 2001 From: Sofiia Chorna Date: Fri, 7 Nov 2025 12:08:34 +0100 Subject: [PATCH 17/28] Centrize coverage ignore --- .codecov.yml | 14 ++++++++++---- pyproject.toml | 5 +++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.codecov.yml b/.codecov.yml index dadeb3be98..b1269a2785 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -2,6 +2,8 @@ coverage: status: project: default: false + + # core package coverage: target: 88% paths: @@ -9,6 +11,8 @@ coverage: - "src/metatrain/cli/.*" flags: - coverage_tests + + # stable architectures coverage_gap: paths: - "src/metatrain/gap/.*" @@ -29,24 +33,26 @@ coverage: - "src/metatrain/llpr/.*" flags: - coverage_llpr + + # deprecated architectures coverage_nanopet: paths: - "src/metatrain/deprecated/nanopet/.*" flags: - coverage_nanopet + + # experimental architectures coverage_flashmd: paths: - "src/metatrain/experimental/flashmd/.*" flags: - coverage_flashmd + patch: default: informational: true + ignore: - # no need to report coverage of the test code themself - - "tests/.*" - - "examples/.*" - - "src/metatrain/utils/testing/.*" # we don't currently run distributed tests on CI - "src/metatrain/utils/distributed/.*" diff --git a/pyproject.toml b/pyproject.toml index 356b319f4a..07da64e224 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -91,8 +91,9 @@ exclude_lines = [ ] omit = [ "*/site-packages/*", - "*/metatrain/experimental/*", - "*/metatrain/utils/testing/*" + "*/metatrain/utils/testing/*", + "tests/*", + "examples/*" ] [tool.coverage.paths] From d6c4fdf352426be0c2dc57a2666e52249ff135a0 Mon Sep 17 00:00:00 2001 From: Sofiia Chorna Date: Fri, 7 Nov 2025 13:21:03 +0100 Subject: [PATCH 18/28] llpr-tests to be done in separate PR --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 178cdf31cd..fdac6a4ea8 100644 --- a/tox.ini +++ b/tox.ini @@ -194,7 +194,7 @@ changedir = src/metatrain/deprecated/nanopet/tests/ commands = pytest --cov=metatrain.deprecated.nanopet --cov-append --cov-report=term {posargs} -[testenv:llpr-tests] +[testenv:llpr] description = Run LLPR tests with pytest and collect coverage passenv = * deps = From 64804cf01bfad84825aacd011000a343b4255951 Mon Sep 17 00:00:00 2001 From: Sofiia Chorna Date: Thu, 13 Nov 2025 17:34:25 +0100 Subject: [PATCH 19/28] Delete llpr from architectural test --- .github/workflows/architecture-tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/architecture-tests.yml b/.github/workflows/architecture-tests.yml index 6ccbd93a72..917867aa7f 100644 --- a/.github/workflows/architecture-tests.yml +++ b/.github/workflows/architecture-tests.yml @@ -15,7 +15,6 @@ jobs: architecture-name: - gap - soap-bpnn - - llpr - pet - nanopet - flashmd From 2e2695745b66b3396d64aaa0b8ac4e65e4f8d2a6 Mon Sep 17 00:00:00 2001 From: Sofiia Chorna Date: Wed, 19 Nov 2025 15:18:46 +0100 Subject: [PATCH 20/28] Added llpr to architecture tests --- .github/workflows/architecture-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/architecture-tests.yml b/.github/workflows/architecture-tests.yml index 917867aa7f..fd05edb6f1 100644 --- a/.github/workflows/architecture-tests.yml +++ b/.github/workflows/architecture-tests.yml @@ -18,6 +18,7 @@ jobs: - pet - nanopet - flashmd + - llpr runs-on: ubuntu-22.04 From 8f98cd19b2a42f8adf2d1b2fee10323682485e93 Mon Sep 17 00:00:00 2001 From: Sofiia Chorna Date: Wed, 19 Nov 2025 15:19:25 +0100 Subject: [PATCH 21/28] Add badge to pet --- src/metatrain/pet/documentation.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/metatrain/pet/documentation.py b/src/metatrain/pet/documentation.py index afa6feed80..950f96fdbf 100644 --- a/src/metatrain/pet/documentation.py +++ b/src/metatrain/pet/documentation.py @@ -2,6 +2,9 @@ PET === +.. image:: https://codecov.io/gh/metatensor/metatrain/branch/main/graph/badge.svg?flag=coverage_pet + :target: 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 From b1b793fcc299fc9878989d3707bc23f90dfb8f1e Mon Sep 17 00:00:00 2001 From: Sofiia Chorna Date: Wed, 19 Nov 2025 15:47:18 +0100 Subject: [PATCH 22/28] Exclude tests in architectures from coverage report, clean up --- .github/workflows/architecture-tests.yml | 3 +-- pyproject.toml | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/architecture-tests.yml b/.github/workflows/architecture-tests.yml index fd05edb6f1..d10c0747f7 100644 --- a/.github/workflows/architecture-tests.yml +++ b/.github/workflows/architecture-tests.yml @@ -15,10 +15,10 @@ jobs: architecture-name: - gap - soap-bpnn + - llpr - pet - nanopet - flashmd - - llpr runs-on: ubuntu-22.04 @@ -52,4 +52,3 @@ jobs: fail_ci_if_error: false files: coverage.xml flags: coverage_${{ matrix.architecture-name }} - token: ${{ secrets.CODECOV_TOKEN }} diff --git a/pyproject.toml b/pyproject.toml index 69ebb8ce74..2c6c3ae1f8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -96,6 +96,7 @@ omit = [ "*/site-packages/*", "*/metatrain/utils/testing/*", "tests/*", + "*/tests/*", "examples/*" ] From 2351e2fe223c9d2c0d9d6dded64ce0aa1c16b7d8 Mon Sep 17 00:00:00 2001 From: Sofiia Chorna Date: Wed, 19 Nov 2025 16:10:53 +0100 Subject: [PATCH 23/28] Fix paths in omit coverage --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2c6c3ae1f8..4caacb378c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -94,9 +94,9 @@ exclude_lines = [ ] omit = [ "*/site-packages/*", - "*/metatrain/utils/testing/*", "tests/*", - "*/tests/*", + "src/metatrain/**/tests/*", + "src/metatrain/utils/testing/*", "examples/*" ] From ba787c6e696de070998ec957f3e8f0511fc7c70e Mon Sep 17 00:00:00 2001 From: Sofiia Chorna Date: Wed, 19 Nov 2025 16:30:22 +0100 Subject: [PATCH 24/28] Ignore tests in codecov --- .codecov.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.codecov.yml b/.codecov.yml index b1269a2785..969b4573c6 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -53,6 +53,9 @@ coverage: informational: true ignore: + # no need to report coverage of the test code themself + - "src/metatrain/utils/testing/.*" + - "src/metatrain/**/tests/.*" # we don't currently run distributed tests on CI - "src/metatrain/utils/distributed/.*" From b962f8cba7986ef3115c9c997c96977b8e97ff9e Mon Sep 17 00:00:00 2001 From: Sofiia Chorna Date: Fri, 5 Dec 2025 19:46:24 +0100 Subject: [PATCH 25/28] Change to components, omit nested test folders, generate rst automatically --- .codecov.yml | 36 ++++++++----------- .github/workflows/architecture-tests.yml | 1 - docs/src/architectures/generate.py | 19 +++++++++- pyproject.toml | 5 +-- .../deprecated/nanopet/documentation.py | 3 -- .../experimental/flashmd/documentation.py | 3 -- src/metatrain/gap/documentation.py | 3 -- src/metatrain/llpr/documentation.py | 3 -- src/metatrain/pet/documentation.py | 3 -- src/metatrain/soap_bpnn/documentation.py | 3 -- 10 files changed, 35 insertions(+), 44 deletions(-) diff --git a/.codecov.yml b/.codecov.yml index 969b4573c6..427179e97c 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -4,49 +4,41 @@ coverage: default: false # core package - coverage: - target: 88% + utils_cli: paths: - "src/metatrain/utils/.*" - "src/metatrain/cli/.*" - flags: - - coverage_tests + target: 88% # stable architectures - coverage_gap: + gap: paths: - "src/metatrain/gap/.*" - flags: - - coverage_gap - coverage_pet: + component: gap + pet: paths: - "src/metatrain/pet/.*" - flags: - - coverage_pet - coverage_soap_bpnn: + component: pet + soap_bpnn: paths: - "src/metatrain/soap_bpnn/.*" - flags: - - coverage_soap_bpnn - coverage_llpr: + component: soap_bpnn + llpr: paths: - "src/metatrain/llpr/.*" - flags: - - coverage_llpr + component: llpr # deprecated architectures - coverage_nanopet: + nanopet: paths: - "src/metatrain/deprecated/nanopet/.*" - flags: - - coverage_nanopet + component: nanopet # experimental architectures - coverage_flashmd: + flashmd: paths: - "src/metatrain/experimental/flashmd/.*" - flags: - - coverage_flashmd + component: flashmd patch: default: diff --git a/.github/workflows/architecture-tests.yml b/.github/workflows/architecture-tests.yml index 43810d38c5..3ecab1e771 100644 --- a/.github/workflows/architecture-tests.yml +++ b/.github/workflows/architecture-tests.yml @@ -51,4 +51,3 @@ jobs: with: fail_ci_if_error: false files: coverage.xml - flags: coverage_${{ matrix.architecture-name }} diff --git a/docs/src/architectures/generate.py b/docs/src/architectures/generate.py index 3c22f350d8..3cda4d3b9b 100644 --- a/docs/src/architectures/generate.py +++ b/docs/src/architectures/generate.py @@ -216,10 +216,27 @@ def generate_rst( **template_variables ) + codecov_arch_path = architecture_name.replace(".", "/") + badge_string = ( + f".. image:: https://codecov.io/gh/metatensor/metatrain/branch/architecture-coverage-test/graph/badge.svg?component={architecture_real_name}" + f"\n :target: https://codecov.io/gh/metatensor/metatrain/tree/architecture-coverage-test/src/metatrain/{codecov_arch_path}" + ) + # Prepend docstring with reference and append missing sections + lines = docstring.split("\n") + title_id = 0 + underline_id = 1 docstring = ( - f".. _architecture-{template_variables['architecture']}:" + "\n\n" + docstring + f".. _architecture-{template_variables['architecture']}:\n\n" + + lines[title_id] + + "\n" + + lines[underline_id] + + "\n\n" + + badge_string + + "\n" + + "\n".join(lines[2:]) ) + # Check for missing sections and add them to the end of the docstring for section in SECTIONS: section_var = "{{SECTION_" + section.upper() + "}}" diff --git a/pyproject.toml b/pyproject.toml index 34361e362e..a685373801 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -94,8 +94,9 @@ exclude_lines = [ ] omit = [ "*/site-packages/*", - "tests/*", - "src/metatrain/**/tests/*", + "*/tests/*", + "src/metatrain/*/tests/*", + "src/metatrain/*/*/tests/*", "src/metatrain/utils/testing/*", "examples/*" ] diff --git a/src/metatrain/deprecated/nanopet/documentation.py b/src/metatrain/deprecated/nanopet/documentation.py index 11691830de..ad7655698a 100644 --- a/src/metatrain/deprecated/nanopet/documentation.py +++ b/src/metatrain/deprecated/nanopet/documentation.py @@ -2,9 +2,6 @@ NanoPET (deprecated) ====================== -.. image:: https://codecov.io/gh/metatensor/metatrain/branch/main/graph/badge.svg?flag=coverage_nanopet - :target: https://codecov.io/gh/metatensor/metatrain/tree/main/src/metatrain/deprecated/nanopet - .. warning:: This is a **deprecated model**. You should not use it for anything important, and diff --git a/src/metatrain/experimental/flashmd/documentation.py b/src/metatrain/experimental/flashmd/documentation.py index 2de662632e..b002bd89c3 100644 --- a/src/metatrain/experimental/flashmd/documentation.py +++ b/src/metatrain/experimental/flashmd/documentation.py @@ -2,9 +2,6 @@ FlashMD ======= -.. image:: https://codecov.io/gh/metatensor/metatrain/branch/main/graph/badge.svg?flag=coverage_flashmd - :target: https://codecov.io/gh/metatensor/metatrain/tree/main/src/metatrain/flashmd - FlashMD is a method for the direct prediction of positions and momenta in a molecular dynamics simulation, presented in :footcite:p:`bigi_flashmd_2025`. When compared to traditional molecular dynamics methods, it predicts the positions and momenta of atoms diff --git a/src/metatrain/gap/documentation.py b/src/metatrain/gap/documentation.py index 8934b8200c..0fe5c09ba7 100644 --- a/src/metatrain/gap/documentation.py +++ b/src/metatrain/gap/documentation.py @@ -2,9 +2,6 @@ GAP === -.. image:: https://codecov.io/gh/metatensor/metatrain/branch/main/graph/badge.svg?flag=coverage_gap - :target: 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/src/metatrain/llpr/documentation.py b/src/metatrain/llpr/documentation.py index 49a3f3b1ad..0904db2a75 100644 --- a/src/metatrain/llpr/documentation.py +++ b/src/metatrain/llpr/documentation.py @@ -2,9 +2,6 @@ LLPR ==== -.. image:: https://codecov.io/gh/metatensor/metatrain/branch/main/graph/badge.svg?flag=coverage_llpr - :target: 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/src/metatrain/pet/documentation.py b/src/metatrain/pet/documentation.py index ea76ae1e7e..fe60466a44 100644 --- a/src/metatrain/pet/documentation.py +++ b/src/metatrain/pet/documentation.py @@ -2,9 +2,6 @@ PET === -.. image:: https://codecov.io/gh/metatensor/metatrain/branch/main/graph/badge.svg?flag=coverage_pet - :target: 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/src/metatrain/soap_bpnn/documentation.py b/src/metatrain/soap_bpnn/documentation.py index 8604d838da..564f76d9d1 100644 --- a/src/metatrain/soap_bpnn/documentation.py +++ b/src/metatrain/soap_bpnn/documentation.py @@ -2,9 +2,6 @@ SOAP-BPNN ========= -.. image:: https://codecov.io/gh/metatensor/metatrain/branch/main/graph/badge.svg?flag=coverage_soap_bpnn - :target: 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 From 4db0a00b157f5cc6f41763110428d50f5d04b68b Mon Sep 17 00:00:00 2001 From: Sofiia Chorna Date: Sat, 6 Dec 2025 01:16:23 +0100 Subject: [PATCH 26/28] Add component_ids --- .codecov.yml | 82 +++++++++++++++++++++++++++------------------------- 1 file changed, 42 insertions(+), 40 deletions(-) diff --git a/.codecov.yml b/.codecov.yml index 427179e97c..d2c648bfd0 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -3,46 +3,48 @@ coverage: project: default: false - # core package - utils_cli: - paths: - - "src/metatrain/utils/.*" - - "src/metatrain/cli/.*" - target: 88% - - # stable architectures - gap: - paths: - - "src/metatrain/gap/.*" - component: gap - pet: - paths: - - "src/metatrain/pet/.*" - component: pet - soap_bpnn: - paths: - - "src/metatrain/soap_bpnn/.*" - component: soap_bpnn - llpr: - paths: - - "src/metatrain/llpr/.*" - component: llpr - - # deprecated architectures - nanopet: - paths: - - "src/metatrain/deprecated/nanopet/.*" - component: nanopet - - # experimental architectures - flashmd: - paths: - - "src/metatrain/experimental/flashmd/.*" - component: flashmd - - patch: - default: - informational: true + # core package + core: + target: 88% + paths: + - "src/metatrain/utils/.*" + - "src/metatrain/cli/.*" + +component_management: + individual_components: + + # stable architectures + - component_id: gap + name: GAP + paths: + - "src/metatrain/gap/.*" + + - component_id: soap_bpnn + name: SOAP-BPNN + paths: + - "src/metatrain/soap_bpnn/.*" + + - component_id: pet + name: PET + paths: + - "src/metatrain/pet/.*" + + - component_id: llpr + name: LLPR + paths: + - "src/metatrain/llpr/.*" + + # deprecated architectures + - component_id: nanopet + name: NanoPET + paths: + - "src/metatrain/deprecated/nanopet/.*" + + # experimental architectures + - component_id: flashmd + name: FlashMD + paths: + - "src/metatrain/experimental/flashmd/.*" ignore: # no need to report coverage of the test code themself From f8bff80bee29e35ba31ec1b7ba850c8c91351be8 Mon Sep 17 00:00:00 2001 From: Sofiia Chorna Date: Sat, 6 Dec 2025 11:08:45 +0100 Subject: [PATCH 27/28] Try relative path --- .codecov.yml | 4 ++++ pyproject.toml | 1 + 2 files changed, 5 insertions(+) diff --git a/.codecov.yml b/.codecov.yml index d2c648bfd0..976c4f618b 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -10,6 +10,10 @@ coverage: - "src/metatrain/utils/.*" - "src/metatrain/cli/.*" + patch: + default: + informational: true + component_management: individual_components: diff --git a/pyproject.toml b/pyproject.toml index a685373801..aa9c435ffa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -109,6 +109,7 @@ source = [ [tool.coverage.run] patch = ["subprocess"] +relative_files = true [tool.ruff] exclude = ["docs/src/examples/**", "src/metatrain/_version.py"] From 363a0ec74f7155ac2e9f9caadf65269f07cca8e9 Mon Sep 17 00:00:00 2001 From: Sofiia Chorna Date: Sat, 6 Dec 2025 12:46:29 +0100 Subject: [PATCH 28/28] Try to add component reporting --- .codecov.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.codecov.yml b/.codecov.yml index 976c4f618b..4f534ce77d 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -14,6 +14,9 @@ coverage: default: informational: true + component: + default: true + component_management: individual_components: