Skip to content

Commit

Permalink
merge proper pyscf systems into bond-atom expansion branch
Browse files Browse the repository at this point in the history
  • Loading branch information
liam-o-marsh committed Dec 12, 2023
2 parents 962651d + f597fbb commit f33afe6
Show file tree
Hide file tree
Showing 55 changed files with 4,739 additions and 544 deletions.
12 changes: 4 additions & 8 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
coverage:
ignore:
- tests/.*
status:
project:
default:
target: 80%
patch: off
ignore:
- "tests/.*"
- "examples/.*"

comment: off

fixes:
# map coverage collected inside tox virtual environments
# to the source dir in git
- ".tox/all-deps/lib/*/site-packages/::python/"
comment: false
22 changes: 18 additions & 4 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: install python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
python -m pip install tox coverage
- name: install lcov
run: sudo apt install -y lcov
Expand All @@ -47,10 +47,12 @@ jobs:
uses: actions/cache@v3
with:
path: .tox
key: tox-${{ matrix.os }}-${{ hashFiles('pyproject.toml', 'setup.cfg', 'tox.ini') }}
key: tox-${{ hashFiles('pyproject.toml', 'setup.cfg', 'tox.ini') }}

- name: Setup sccache
uses: mozilla-actions/[email protected]
with:
version: "v0.5.4"

- name: Setup sccache environnement variables
run: |
Expand All @@ -69,10 +71,22 @@ jobs:
lcov --remove coverage.info '/usr/*' "$(pwd)/rascaline-c-api/tests/*" "$(pwd)/rascaline-c-api/examples/*" --output-file coverage.info
- name: collect Python coverage
run: tox -e all-deps
run: |
tox -e all-deps
tox -e torch-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: combine Python coverage files
run: |
coverage combine --append \
./.coverage \
./python/rascaline-torch/.coverage
coverage xml
- name: upload to codecov.io
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
files: target/tarpaulin/cobertura.xml,.tox/coverage.xml,coverage.info
files: target/tarpaulin/cobertura.xml,coverage.xml,coverage.info
6 changes: 4 additions & 2 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
matrix:
include:
- os: ubuntu-20.04
python-version: "3.7"
python-version: "3.8"
- os: ubuntu-20.04
python-version: "3.11"
- os: macos-11
Expand Down Expand Up @@ -47,6 +47,8 @@ jobs:
- name: Setup sccache
uses: mozilla-actions/[email protected]
with:
version: "v0.5.4"

- name: Setup sccache environnement variables
run: |
Expand All @@ -73,7 +75,7 @@ jobs:
name: Python ${{ matrix.python-version }} / check build
strategy:
matrix:
python-version: ['3.7', '3.11']
python-version: ['3.8', '3.11']
os: [ubuntu-20.04]
steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/rust-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ jobs:
- name: Setup sccache
uses: mozilla-actions/[email protected]
with:
version: "v0.5.4"

- name: Setup sccache environnement variables
run: |
Expand Down Expand Up @@ -140,6 +142,8 @@ jobs:

- name: Setup sccache
uses: mozilla-actions/[email protected]
with:
version: "v0.5.4"

- name: Setup sccache environnement variables
run: |
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/torch-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
include:
- os: ubuntu-20.04
torch-version: 1.11.*
python-version: "3.7"
python-version: "3.8"
cargo-test-flags: --release

- os: ubuntu-20.04
Expand Down Expand Up @@ -60,6 +60,8 @@ jobs:
- name: Setup sccache
uses: mozilla-actions/[email protected]
with:
version: "v0.5.4"

- name: Setup sccache environnement variables
run: |
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ target/
Cargo.lock

.tox/
.coverage
build/
dist/
*.egg-info
__pycache__/
.vscode
*.DS_Store
htmlcov/
.coverage
coverage.xml
18 changes: 18 additions & 0 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,24 @@ of just testing it.
.. _`cargo` : https://doc.rust-lang.org/cargo/
.. _valgrind: https://valgrind.org/

Inspecting Python code coverage
-------------------------------

The code coverage is reported at `codecov`_. You can also inspect the coverage locally.
To get the full coverage first combine all reports and open produced html file in a
browser

.. code-block:: bash
tox
coverage combine --append \
./.coverage \
./python/rascaline-torch/.coverage
coverage html
firefox htmlcov/index.html
.. _codecov: https://codecov.io/gh/lab-cosmo/metatensor

Writing your own calculator
---------------------------

Expand Down
1 change: 1 addition & 0 deletions docs/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ def setup(app):
"metatensor": ("https://lab-cosmo.github.io/metatensor/latest/", None),
"matplotlib": ("https://matplotlib.org/stable/", None),
"numpy": ("https://numpy.org/doc/stable/", None),
"scipy": ("https://docs.scipy.org/doc/scipy/", None),
"skmatter": ("https://scikit-matter.readthedocs.io/en/latest/", None),
"torch": ("https://pytorch.org/docs/stable/", None),
"python": ("https://docs.python.org/3", None),
Expand Down
1 change: 1 addition & 0 deletions docs/src/devdoc/explanations/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ to give you more clarity and understanding of what rascaline is all about.

architecture
interfaces
radial-integral
Loading

0 comments on commit f33afe6

Please sign in to comment.