Skip to content

Commit

Permalink
Adapt GA workflows (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinfriede authored Apr 26, 2024
1 parent f260687 commit 26d4656
Show file tree
Hide file tree
Showing 6 changed files with 271 additions and 47 deletions.
95 changes: 95 additions & 0 deletions .github/workflows/macos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# This file is part of tad-dftd3.
# SPDX-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Tests (macOS)

on:
push:
branches:
- main
- master
paths-ignore:
- "doc*/**"
- "./*.ya?ml"
- "**/*.md"
- "**/*.rst"

pull_request:
paths-ignore:
- "doc*/**"
- "./*.ya?ml"
- "**/*.md"
- "**/*.rst"

workflow_dispatch:

jobs:
main:
strategy:
fail-fast: false
matrix:
os: [macos-12, macos-13, macos-14]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
# only test oldest and newest version of torch
torch-version: ["1.11.0", "2.2.2"]
exclude:
# PyTorch now fully supports Python=<3.11
# see: https://github.com/pytorch/pytorch/issues/86566
#
# PyTorch does not support Python 3.12 (all platforms)
# see: https://github.com/pytorch/pytorch/issues/110436
- python-version: "3.12"
# PyTorch<1.13.0 does only support Python=<3.10
# On macOS and Windows, 1.13.x is also not supported for Python>=3.10
- python-version: "3.11"
torch-version: "1.11.0"
- python-version: "3.11"
torch-version: "1.12.1"
- python-version: "3.11"
torch-version: "1.13.1"
# Python 3.8/3.9 is not on macos-latest (macos-14-arm64)
# https://github.com/actions/setup-python/issues/696
- os: macos-14
python-version: "3.8"
- os: macos-14
python-version: "3.9"

runs-on: ${{ matrix.os }}

defaults:
run:
shell: bash {0}

steps:
- name: Checkout code
uses: actions/checkout@v3

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

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install tox
- name: Determine TOXENV
run: echo "TOXENV=py$(echo ${{ matrix.python-version }} | tr -d '.')-torch$(echo ${{ matrix.torch-version }} | tr -d '.')" >> $GITHUB_ENV

- name: Print TOXENV
run: echo "TOXENV is set to '${{ env.TOXENV }}'."

- name: Unittests with tox
run: tox -e ${{ env.TOXENV }}
20 changes: 4 additions & 16 deletions .github/workflows/python.yaml → .github/workflows/ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Tests
name: Tests (Ubuntu)

on:
push:
Expand All @@ -39,7 +39,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
torch-version: ["1.11.0", "1.12.1", "1.13.1", "2.0.1", "2.1.2", "2.2.2"]
exclude:
Expand All @@ -48,24 +48,12 @@ jobs:
#
# PyTorch does not support Python 3.12 (all platforms)
# see: https://github.com/pytorch/pytorch/issues/110436
- os: ubuntu-latest
python-version: "3.12"
- os: macos-latest
python-version: "3.12"
- os: windows-latest
python-version: "3.12"
- python-version: "3.12"
# PyTorch<1.13.0 does only support Python=<3.10
- python-version: "3.11"
torch-version: "1.11.0"
- python-version: "3.11"
torch-version: "1.12.1"
# On macOS and Windows, 1.13.x is also not supported for Python>=3.10
- os: macos-latest
python-version: "3.11"
torch-version: "1.13.1"
- os: windows-latest
python-version: "3.11"
torch-version: "1.13.1"

runs-on: ${{ matrix.os }}

Expand All @@ -78,7 +66,7 @@ jobs:
uses: actions/checkout@v3

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

Expand Down
91 changes: 91 additions & 0 deletions .github/workflows/windows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# This file is part of tad-dftd3.
# SPDX-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Tests (Windows)

on:
push:
branches:
- main
- master
paths-ignore:
- "doc*/**"
- "./*.ya?ml"
- "**/*.md"
- "**/*.rst"

pull_request:
paths-ignore:
- "doc*/**"
- "./*.ya?ml"
- "**/*.md"
- "**/*.rst"

workflow_dispatch:

jobs:
main:
strategy:
fail-fast: false
matrix:
os: [windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
# only test oldest and newest version of torch
torch-version: ["1.11.0", "2.2.2"]
exclude:
# PyTorch now fully supports Python=<3.11
# see: https://github.com/pytorch/pytorch/issues/86566
#
# PyTorch does not support Python 3.12 (all platforms)
# see: https://github.com/pytorch/pytorch/issues/110436
- os: windows-latest
python-version: "3.12"
# PyTorch<1.13.0 does only support Python=<3.10
- python-version: "3.11"
torch-version: "1.11.0"
- python-version: "3.11"
torch-version: "1.12.1"
# On macOS and Windows, 1.13.x is also not supported for Python>=3.10
- os: windows-latest
python-version: "3.11"
torch-version: "1.13.1"

runs-on: ${{ matrix.os }}

defaults:
run:
shell: bash {0}

steps:
- name: Checkout code
uses: actions/checkout@v3

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

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install tox
- name: Determine TOXENV
run: echo "TOXENV=py$(echo ${{ matrix.python-version }} | tr -d '.')-torch$(echo ${{ matrix.torch-version }} | tr -d '.')" >> $GITHUB_ENV

- name: Print TOXENV
run: echo "TOXENV is set to '${{ env.TOXENV }}'."

- name: Unittests with tox
run: tox -e ${{ env.TOXENV }}
90 changes: 62 additions & 28 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,34 +1,14 @@
Torch autodiff for DFT-D3
=========================

.. image:: https://img.shields.io/github/v/release/dftd3/tad-dftd3
:target: https://github.com/dftd3/tad-dftd3/releases/latest
:alt: Release

.. image:: https://img.shields.io/pypi/v/tad-dftd3
:target: https://pypi.org/project/tad-dftd3/
:alt: PyPI

.. image:: https://img.shields.io/github/license/dftd3/tad-dftd3
:target: LICENSE
:alt: Apache-2.0

.. image:: https://github.com/dftd3/tad-dftd3/actions/workflows/python.yaml/badge.svg
:target: https://github.com/dftd3/tad-dftd3/actions/workflows/python.yaml
:alt: CI

.. image:: https://readthedocs.org/projects/tad-dftd3/badge/?version=latest
:target: https://tad-dftd3.readthedocs.io
:alt: Documentation Status

.. image:: https://codecov.io/gh/dftd3/tad-dftd3/branch/main/graph/badge.svg?token=D3rMNnl26t
:target: https://codecov.io/gh/dftd3/tad-dftd3
:alt: Coverage

.. image:: https://results.pre-commit.ci/badge/github/dftd3/tad-dftd3/main.svg
:target: https://results.pre-commit.ci/latest/github/dftd3/tad-dftd3/main
:alt: pre-commit.ci status

|release|
|license|
|testubuntu|
|testmacos|
|testwindows|
|docs|
|coverage|
|precommit|

Implementation of the DFT-D3 dispersion model in PyTorch.
This module allows to process a single structure or a batch of structures for the calculation of atom-resolved dispersion energies.
Expand Down Expand Up @@ -56,12 +36,25 @@ Installation
pip
~~~

|pypi|

The project can easily be installed with ``pip``.

.. code::
pip install tad-dftd3
conda
~~~~~

|conda|

*tad-dftd3* is also available from ``conda``.

.. code::
conda install tad-dftd3
From source
~~~~~~~~~~~

Expand Down Expand Up @@ -292,3 +285,44 @@ Unless you explicitly state otherwise, any contribution intentionally
submitted for inclusion in this project by you, as defined in the
Apache-2.0 license, shall be licensed as above, without any additional
terms or conditions.


.. |release| image:: https://img.shields.io/github/v/release/dftd3/tad-dftd3
:target: https://github.com/dftd3/tad-dftd3/releases/latest
:alt: Release

.. |pypi| image:: https://img.shields.io/pypi/v/tad-dftd3
:target: https://pypi.org/project/tad-dftd3/
:alt: PyPI

.. |conda| image:: https://img.shields.io/conda/vn/conda-forge/tad-dftd3.svg
:target: https://anaconda.org/conda-forge/tad-dftd3
:alt: Conda Version

.. |license| image:: https://img.shields.io/github/license/dftd3/tad-dftd3
:target: LICENSE
:alt: Apache-2.0

.. |testubuntu| image:: https://github.com/dftd3/tad-dftd3/actions/workflows/ubuntu.yaml/badge.svg
:target: https://github.com/dftd3/tad-dftd3/actions/workflows/ubuntu.yaml
:alt: Tests Ubuntu

.. |testmacos| image:: https://github.com/dftd3/tad-dftd3/actions/workflows/macos.yaml/badge.svg
:target: https://github.com/dftd3/tad-dftd3/actions/workflows/macos.yaml
:alt: Tests macOS

.. |testwindows| image:: https://github.com/dftd3/tad-dftd3/actions/workflows/windows.yaml/badge.svg
:target: https://github.com/dftd3/tad-dftd3/actions/workflows/windows.yaml
:alt: Tests Windows

.. |docs| image:: https://readthedocs.org/projects/tad-dftd3/badge/?version=latest
:target: https://tad-dftd3.readthedocs.io
:alt: Documentation Status

.. |coverage| image:: https://codecov.io/gh/dftd3/tad-dftd3/branch/main/graph/badge.svg?token=D3rMNnl26t
:target: https://codecov.io/gh/dftd3/tad-dftd3
:alt: Coverage

.. |precommit| image:: https://results.pre-commit.ci/badge/github/dftd3/tad-dftd3/main.svg
:target: https://results.pre-commit.ci/latest/github/dftd3/tad-dftd3/main
:alt: pre-commit.ci status
3 changes: 1 addition & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,11 @@
extensions = [
"sphinx_design",
"sphinx_copybutton",
"sphinx_design",
"sphinx.ext.autosummary",
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.viewcode",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
]

html_theme = "sphinx_book_theme"
Expand Down
19 changes: 18 additions & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,29 @@ Installation
pip
~~~

The project can easily be installed with ``pip``.
.. image:: https://img.shields.io/pypi/v/tad-dftd3
:target: https://pypi.org/project/tad-dftd3/
:alt: PyPI

*tad-dftd3* can easily be installed with ``pip``.

.. code::
pip install tad-dftd3
conda
~~~~~

.. image:: https://img.shields.io/conda/vn/conda-forge/tad-dftd3.svg
:target: https://anaconda.org/conda-forge/tad-dftd3
:alt: Conda Version

*tad-dftd3* is also available from ``conda``.

.. code::
conda install tad-dftd3
From source
~~~~~~~~~~~

Expand Down

0 comments on commit 26d4656

Please sign in to comment.