Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pyscf systems [CI-debugging PR] #2

Closed
wants to merge 30 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f2299e5
Fix new clippy warnings for rustc 1.73
Luthaf Oct 6, 2023
e723afd
Update metatensor
Luthaf Oct 6, 2023
29d8a7b
Update to C++17 for torch>=2.1
Luthaf Oct 6, 2023
365e79f
Exploited subtraction theorem in LODE structure factor (#242)
andreagrisafi Oct 6, 2023
7107376
Update Python installation instruction
Luthaf Oct 6, 2023
b3e095b
Allow to disable valgrind when for C/C++ API tests
Luthaf Oct 6, 2023
e8265ec
Bump rustc to 1.65
PicoCentauri Oct 10, 2023
449ac37
Update metatensor
Luthaf Oct 10, 2023
434f923
Apply linter suggestions for C++ and Rust code
Luthaf Oct 11, 2023
14d2a72
Use the released version of metatensor
Luthaf Oct 12, 2023
581d0ca
Added real and Fourier space spliner base classes (#235)
PicoCentauri Oct 17, 2023
7384f7a
Add coverage for Python torch bindings (#234)
PicoCentauri Oct 18, 2023
c62302b
rascaline-torch depends on metatensor-torch
Luthaf Sep 8, 2023
ad8a967
Add rascaline-torch as optional dependency of rascaline
Luthaf Sep 8, 2023
e961e15
Add a (-1)^l factor to the power spectrum invariants
Luthaf Oct 18, 2023
b8bb5cc
rename cutoff -> k_cutoff
PicoCentauri Oct 25, 2023
e5dc30c
Fix the version of sccache we pull from github
Luthaf Oct 27, 2023
30592db
Disable coverage reporting in terminal (#252)
Luthaf Oct 30, 2023
fca103e
Fix serialization of calculators in torch
Luthaf Nov 1, 2023
2851d47
Fix access to rascaline-torch cmake_prefix_path from Python
Luthaf Nov 3, 2023
1c06940
Redesigned metatensor-based Clebsch Gordan iterations (#237)
jwa7 Nov 30, 2023
10c663e
Bump min Python version 3.7
PicoCentauri Dec 6, 2023
8f1de18
Various tox.ini improvments
PicoCentauri Dec 6, 2023
6c76b77
added pyscf system
liam-o-marsh Dec 7, 2023
46364c7
fix flake8/black linting and tox integration
liam-o-marsh Dec 7, 2023
0bd5ab4
pyscf systems: changed management of length units, added tests [WIP]
liam-o-marsh Dec 8, 2023
dba772d
fixed tests
liam-o-marsh Dec 8, 2023
7773971
fix dependency management for tox
liam-o-marsh Dec 11, 2023
24363ad
fix tox dependencies again
liam-o-marsh Dec 11, 2023
f597fbb
pyscf systems: add explicit test for unit management
liam-o-marsh Dec 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/sccache-action@v0.0.3
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/sccache-action@v0.0.3
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
6 changes: 5 additions & 1 deletion .github/workflows/rust-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:

# check the build on a stock Ubuntu 20.04, including cmake 3.16
- os: ubuntu-20.04
rust-version: "1.64"
rust-version: "1.65"
container: ubuntu:20.04
rust-target: x86_64-unknown-linux-gnu
build-type: debug
Expand Down Expand Up @@ -100,6 +100,8 @@ jobs:

- name: Setup sccache
uses: mozilla-actions/sccache-action@v0.0.3
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/sccache-action@v0.0.3
with:
version: "v0.5.4"

- name: Setup sccache environnement variables
run: |
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/torch-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,22 @@ 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
torch-version: 2.0.*
torch-version: 2.1.*
python-version: "3.11"
cargo-test-flags: --release
do-valgrind: true

- os: macos-11
torch-version: 2.0.*
torch-version: 2.1.*
python-version: "3.11"
cargo-test-flags: --release

- os: windows-2019
torch-version: 2.0.*
torch-version: 2.1.*
python-version: "3.11"
cargo-test-flags: --release

Expand All @@ -60,6 +60,8 @@ jobs:

- name: Setup sccache
uses: mozilla-actions/sccache-action@v0.0.3
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
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ build:
- cmake
tools:
python: "3.11"
rust: "1.64"
rust: "1.70"
jobs:
post_install:
# install rascaline-torch with the CPU version of PyTorch. We can not use
Expand Down
53 changes: 45 additions & 8 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ on rascaline:
- **the rust compiler**: you will need both ``rustc`` (the compiler) and
``cargo`` (associated build tool). You can install both using `rustup`_, or
use a version provided by your operating system. We need at least Rust version
1.64 to build rascaline.
1.65 to build rascaline.
- **Python**: you can install ``Python`` and ``pip`` from your operating system.
We require a Python version of at least 3.6.
- **tox**: a Python test runner, cf https://tox.readthedocs.io/en/latest/. You
Expand Down Expand Up @@ -123,9 +123,29 @@ Github CI workflows.
You can also run only a subset of tests with one of these commands:

- ``cargo test`` runs everything
- ``cargo test --test=<test-name>`` to run only the tests in ``tests/<test-name>.rs``;
- ``cargo test --test=python-api`` (or ``tox`` directly) to run Python tests only;
- ``cargo test --test=c-api`` to run the C API tests only;
- ``cargo test --package=rascaline`` to run the calculators tests;
- ``cargo test --package=rascaline-c-api`` to run the C/C++ tests only;

- ``cargo test --test=run-cxx-tests`` will run the unit tests for the C/C++
API. If `valgrind`_ is installed, it will be used to check for memory
errors. You can disable this by setting the `RASCALINE_DISABLE_VALGRIND`
environment variable to 1 (`export RASCALINE_DISABLE_VALGRIND=1` for most
Linux/macOS shells);
- ``cargo test --test=check-cxx-install`` will build the C/C++ interfaces,
install them and the associated CMake files and then try to build a basic
project depending on this interface with CMake;

- ``cargo test --package=rascaline-torch`` to run the C++ TorchScript extension
tests only;

- ``cargo test --test=run-torch-tests`` will run the unit tests for the
TorchScript C++ extension;
- ``cargo test --test=check-cxx-install`` will build the C++ TorchScript
extension, install it and then try to build a basic project depending on
this extension with CMake;

- ``cargo test --package=rascaline-python`` (or ``tox`` directly, see below) to
run Python tests only;
- ``cargo test --lib`` to run unit tests;
- ``cargo test --doc`` to run documentation tests;
- ``cargo bench --test`` compiles and run the benchmarks once, to quickly ensure
Expand All @@ -135,10 +155,8 @@ You can add some flags to any of above commands to further refine which tests
should run:

- ``--release`` to run tests in release mode (default is to run tests in debug mode)
- ``-- <filter>`` to only run tests whose name contains filter, for example ``cargo test -- spherical_harmonics``
- ``--package rascaline`` to run tests defined in the rascaline crate (the core implementation)
- ``--package rascaline-c-api`` to run tests defined in the rascaline-c-api
crate (the C API implementation)
- ``-- <filter>`` to only run tests whose name contains filter, for example
``cargo test -- spherical_harmonics``

Also, you can run individual python tests using `tox`_
if you wish to test only specific functionalities, for example:
Expand All @@ -156,6 +174,25 @@ The latter command ``tox -e format`` will use tox to do actual formatting instea
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
2 changes: 1 addition & 1 deletion docs/rascaline-json-schema/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Luthaf <luthaf@luthaf.fr>"]
edition = "2021"
publish = false
rust-version = "1.64"
rust-version = "1.65"

[[bin]]
name = "rascaline-json-schema"
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ myst-parser # markdown => rst translation, used in extensions/rascaline_json

# dependencies for the tutorials
--extra-index-url https://download.pytorch.org/whl/cpu
metatensor[torch] @ https://github.com/lab-cosmo/metatensor/archive/2248a3c.zip
metatensor[torch] >=0.1.0,<0.2.0
torch
chemfiles
matplotlib
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
Loading