Skip to content

Commit

Permalink
Update the bond-atom PR branch with upstream progress
Browse files Browse the repository at this point in the history
  • Loading branch information
liam-o-marsh committed Apr 8, 2024
2 parents 892a3a9 + 5c2a798 commit bd8fe3f
Show file tree
Hide file tree
Showing 192 changed files with 5,791 additions and 4,459 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build Python wheels
on:
push:
branches: [master]
tags: "*"
tags: ["*"]
pull_request:
# Check all PR

Expand Down Expand Up @@ -36,7 +36,7 @@ jobs:
rust-target: x86_64-pc-windows-msvc
cibw_arch: AMD64
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -47,9 +47,9 @@ jobs:
target: ${{ matrix.rust-target }}

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"

- name: install dependencies
run: python -m pip install cibuildwheel
Expand Down Expand Up @@ -85,17 +85,17 @@ jobs:
runs-on: ubuntu-20.04
name: sdist
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"
- name: build sdist
run: |
pip install wheel
python setup.py sdist
pip install build
python -m build --sdist .
- uses: actions/upload-artifact@v3
with:
name: wheels
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:
- name: free disk space
run: sudo rm -rf /usr/share/dotnet /usr/local/lib/android || true

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"

- name: setup rust
uses: dtolnay/rust-toolchain@master
Expand All @@ -38,7 +38,9 @@ jobs:
- name: install python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox coverage
# https://github.com/tox-dev/tox/issues/3238
python -m pip install tox==4.14.0
python -m pip install coverage
- name: install lcov
run: sudo apt install -y lcov
Expand Down Expand Up @@ -86,7 +88,8 @@ jobs:
coverage xml
- name: upload to codecov.io
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
files: target/tarpaulin/cobertura.xml,coverage.xml,coverage.info
token: ${{ secrets.CODECOV_TOKEN }}
9 changes: 5 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,22 @@ jobs:
- name: free disk space
run: sudo rm -rf /usr/share/dotnet /usr/local/lib/android || true

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: setup rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable

- name: setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"

- name: install dependencies
run: |
pip install tox
# https://github.com/tox-dev/tox/issues/3238
python -m pip install tox==4.14.0
sudo apt install doxygen
- name: build documentation
Expand Down
24 changes: 14 additions & 10 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ jobs:
- os: ubuntu-20.04
python-version: "3.8"
- os: ubuntu-20.04
python-version: "3.11"
python-version: "3.12"
- os: macos-11
python-version: "3.11"
python-version: "3.12"
- os: windows-2019
python-version: "3.11"
python-version: "3.12"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -42,7 +42,9 @@ jobs:
- name: install python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
# https://github.com/tox-dev/tox/issues/3238
python -m pip install tox==4.14.0
echo "tox_version=$(python -c 'import tox; print(tox.__version__)')" >> $GITHUB_ENV
- name: Setup sccache
Expand Down Expand Up @@ -75,13 +77,13 @@ jobs:
name: Python ${{ matrix.python-version }} / check build
strategy:
matrix:
python-version: ['3.8', '3.11']
python-version: ['3.8', '3.12']
os: [ubuntu-20.04]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -94,7 +96,9 @@ jobs:
- name: install python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
# https://github.com/tox-dev/tox/issues/3238
python -m pip install tox==4.14.0
echo "tox_version=$(python -c 'import tox; print(tox.__version__)')" >> $GITHUB_ENV
- name: cache tox environments
Expand Down
15 changes: 5 additions & 10 deletions .github/workflows/rust-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,18 @@ jobs:
if: matrix.os == 'ubuntu-20.04'
run: sudo rm -rf /usr/share/dotnet /usr/local/lib/android || true

- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: "copy the code to C: drive"
if: matrix.os == 'windows-2019'
run: cp -r ${{ github.workspace }} ${{ matrix.working-directory }}
working-directory: /

- name: setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
if: "!matrix.container"
with:
python-version: "3.11"
python-version: "3.12"

- name: setup rust
uses: dtolnay/rust-toolchain@master
Expand Down Expand Up @@ -127,13 +127,8 @@ jobs:
prevent-bitrot:
runs-on: ubuntu-20.04
name: check examples / benchmarks
strategy:
matrix:
include:
- rust-version:
rust-target:
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: setup rust
uses: dtolnay/rust-toolchain@master
Expand Down Expand Up @@ -168,7 +163,7 @@ jobs:
- rust-version: stable
rust-target: x86_64-unknown-linux-gnu
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: setup rust
uses: dtolnay/rust-toolchain@master
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/torch-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
cargo-test-flags: --release

- os: ubuntu-20.04
# These should be updated to torch 2.2 and Python 3.12 once
# https://github.com/pytorch/pytorch/issues/118862 is solved
torch-version: 2.1.*
python-version: "3.11"
cargo-test-flags: --release
Expand All @@ -39,7 +41,7 @@ jobs:
cargo-test-flags: --release

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: setup rust
uses: dtolnay/rust-toolchain@master
Expand All @@ -48,7 +50,7 @@ jobs:

# we get torch from pip to run the C++ test
- name: setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand Down
4 changes: 2 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ build:
apt_packages:
- cmake
tools:
python: "3.11"
rust: "1.70"
python: "3.12"
rust: "1.75"
jobs:
post_install:
# install rascaline-torch with the CPU version of PyTorch. We can not use
Expand Down
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ List of implemented representations
- Core of representations in LODE (Long distance equivariant)
- positions
* - Sorted distances
- Each atomic center is represented by a vector of distance to its
neighbors within the spherical cutoff
- Each atom is represented by a vector of distance to its neighbors within
the spherical cutoff
- no
* - Neighbor List
- Each pair is represented by the vector between the atoms. This is
intended to be used as a starting point for more complex representations
- positions
* - AtomicComposition
- Obtaining the stoichiometric information of a structure
- Obtaining the stoichiometric information of a system
- positions and cell

.. inclusion-marker-representations-end
Expand Down
7 changes: 4 additions & 3 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# sphinx dependencies
sphinx < 7.2 # breathe is not compatible with sphinx 7.2 yet
# sphinx and dependencies
sphinx == 7.2.6
furo # sphinx theme
breathe >=4.33 # C and C++ => sphinx through doxygen
sphinx-gallery # convert python files into nice documentation
Expand All @@ -10,7 +10,8 @@ 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] >=0.1.0,<0.2.0
metatensor
metatensor-torch >= 0.3.0,<0.4.0
torch
chemfiles
matplotlib
Expand Down
1 change: 1 addition & 0 deletions docs/src/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
examples
sg_execution_times.rst
8 changes: 6 additions & 2 deletions docs/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@ def setup(app):
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ["Thumbs.db", ".DS_Store"]
exclude_patterns = [
"Thumbs.db",
".DS_Store",
"sg_execution_times.rst",
]


autoclass_content = "both"
Expand All @@ -120,7 +124,7 @@ def setup(app):
"filename_pattern": "/*",
"examples_dirs": ["../../python/rascaline/examples"],
"gallery_dirs": ["examples"],
"min_reported_time": 60,
"min_reported_time": 5,
# Make the code snippet for rascaline functions clickable
"reference_url": {"rascaline": None},
"prefer_full_module": ["rascaline"],
Expand Down
10 changes: 5 additions & 5 deletions docs/src/devdoc/explanations/radial-integral.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ determined by specifying two ingredients:

- the atomic density function :math:`g(r)` as implemented in
:ref:`python-atomic-density`, often chosen to be a Gaussian or Delta function, that
defined the type of density under consideration. For a given center atom :math:`i` in
the structure, the total density function :math:`\rho_i(\boldsymbol{r})` around is
defined the type of density under consideration. For a given central atom :math:`i` in
the system, the total density function :math:`\rho_i(\boldsymbol{r})` around is
then defined as :math:`\rho_i(\boldsymbol{r}) = \sum_{j} g(\boldsymbol{r} -
\boldsymbol{r}_{ij})`.

Expand All @@ -37,8 +37,8 @@ determined by specifying two ingredients:
:math:`\hat{r}`, i.e. at the spherical angles :math:`(\theta, \phi)` that determine
the orientation of the unit vector :math:`\hat{r} = \boldsymbol{r}/r`.

The spherical expansion coefficient :math:`\langle nlm | \rho_i \rangle` (we ommit the
chemical species index :math:`a` for simplicity) is then defined as
The spherical expansion coefficient :math:`\langle nlm | \rho_i \rangle` (we omit the
atom type index :math:`a` for simplicity) is then defined as

.. math::
Expand Down Expand Up @@ -110,7 +110,7 @@ The key point is that the dependence on the vectorial position
:math:`\boldsymbol{r}_{ij}` is split into a factor that contains information about the
orientation of this vector, namely :math:`Y_{lm}(\hat{r}_{ij})`, which is just the
spherical harmonic evaluated at :math:`\hat{r}_{ij}`, and a remaining part that captures
the dependence on the distance of atom :math:`j` from the center atom :math:`i`, namely
the dependence on the distance of atom :math:`j` from the central atom :math:`i`, namely
:math:`I_{nl}(r_{ij})`, which we shall call the radial integral. The radial integral
class computes and outputs this radial part :math:`I_{nl}(r_{ij})`. Since the angular
part is just the usual spherical harmonic, this is the part that also depends on the
Expand Down
Loading

0 comments on commit bd8fe3f

Please sign in to comment.