-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'pyop2/master' into JDBetteridge/merge_p…
…yop2_tsfc
- Loading branch information
Showing
100 changed files
with
47,307 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,9 @@ | ||
# Set default behaviour, in case users don't have core.autocrlf set. | ||
* text=auto | ||
|
||
# Whitespace | ||
* whitespace=tab-in-indent,space-before-tab,trailing-space,tabwidth=2 | ||
*.{py,pyx,pxd,pxi} whitespace=tab-in-indent,space-before-tab,trailing-space,tabwidth=4 | ||
Makefile whitespace=space-before-tab,trailing-space,tabwidth=2 | ||
pyop2/_version.py export-subst | ||
firedrake/_version.py export-subst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
name: CI | ||
|
||
# Trigger the workflow on push or pull request, | ||
# but only for the master branch | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
# Don't immediately kill all if one Python version fails | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.9', '3.10', '3.11', '3.12'] | ||
env: | ||
CC: mpicc | ||
PETSC_DIR: ${{ github.workspace }}/petsc | ||
PETSC_ARCH: default | ||
PETSC_CONFIGURE_OPTIONS: --with-debugging=1 --with-shared-libraries=1 --with-c2html=0 --with-fortran-bindings=0 | ||
RDMAV_FORK_SAFE: 1 | ||
PYOP2_CI_TESTS: 1 | ||
timeout-minutes: 60 | ||
|
||
steps: | ||
- name: Install system dependencies | ||
shell: bash | ||
run: | | ||
sudo apt update | ||
sudo apt install build-essential mpich libmpich-dev \ | ||
libblas-dev liblapack-dev gfortran | ||
- name: Set correct Python version | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Clone PETSc | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: firedrakeproject/petsc | ||
path: ${{ env.PETSC_DIR }} | ||
|
||
- name: Build and install PETSc | ||
shell: bash | ||
working-directory: ${{ env.PETSC_DIR }} | ||
run: | | ||
./configure ${PETSC_CONFIGURE_OPTIONS} | ||
make | ||
- name: Build and install petsc4py | ||
shell: bash | ||
working-directory: ${{ env.PETSC_DIR }}/src/binding/petsc4py | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install --upgrade wheel cython numpy | ||
python -m pip install --no-deps . | ||
- name: Checkout PyOP2 | ||
uses: actions/checkout@v2 | ||
with: | ||
path: PyOP2 | ||
|
||
- name: Install PyOP2 dependencies | ||
shell: bash | ||
working-directory: PyOP2 | ||
run: | | ||
# xargs is used to force installation of requirements in the order we specified. | ||
xargs -l1 python -m pip install < requirements-ext.txt | ||
xargs -l1 python -m pip install < requirements-git.txt | ||
python -m pip install pulp | ||
python -m pip install -U flake8 | ||
python -m pip install -U pytest-timeout | ||
- name: Install PyOP2 (Python <3.12) | ||
if: ${{ matrix.python-version != '3.12' }} | ||
shell: bash | ||
working-directory: PyOP2 | ||
run: python -m pip install . | ||
|
||
# Not sure if this is a bug in setuptools or something PyOP2 is doing wrong | ||
- name: Install PyOP2 (Python == 3.12) | ||
if: ${{ matrix.python-version == '3.12' }} | ||
shell: bash | ||
working-directory: PyOP2 | ||
run: | | ||
python -m pip install -U setuptools | ||
python setup.py install | ||
- name: Run linting | ||
shell: bash | ||
working-directory: PyOP2 | ||
run: make lint | ||
|
||
- name: Run tests | ||
shell: bash | ||
working-directory: PyOP2 | ||
run: | | ||
# Running parallel test cases separately works around a bug in pytest-mpi | ||
pytest -k "not parallel" --tb=native --timeout=480 --timeout-method=thread -o faulthandler_timeout=540 -v test | ||
mpiexec -n 3 pytest -k "parallel[3]" --tb=native --timeout=480 --timeout-method=thread -o faulthandler_timeout=540 -v test | ||
timeout-minutes: 10 | ||
|
||
- name: Build documentation | ||
if: ${{ matrix.python-version == '3.10' }} | ||
shell: bash | ||
working-directory: PyOP2 | ||
run: | | ||
python -m pip install sphinx | ||
make -C doc/sphinx html | ||
- name: Upload to github pages | ||
if: ${{ github.ref == 'refs/heads/master' && github.event_name == 'push' && matrix.python-version== '3.10' }} | ||
uses: crazy-max/[email protected] | ||
with: | ||
build_dir: PyOP2/doc/sphinx/build/html | ||
jekyll: false | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
PyOP2 has received contributions from the following: | ||
|
||
Institutions | ||
------------ | ||
|
||
Imperial College London | ||
The University of Edinburgh | ||
|
||
Individuals | ||
----------- | ||
|
||
Gheorghe-Teodor Bercea <[email protected]> | ||
Simon Funke <[email protected]> | ||
Ben Grabham <[email protected]> | ||
David A Ham <[email protected]> | ||
Nicolas Loriant <[email protected]> | ||
Fabio Luporini <[email protected]> | ||
Graham Markall <[email protected]> | ||
Lawrence Mitchell <[email protected]> | ||
Florian Rathgeber <[email protected]> | ||
Francis Russell <[email protected]> | ||
Kaho Sato <[email protected]> | ||
Reuben W. Nixon-Hill <[email protected]> | ||
Nacime Bouziani <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Contributing to PyOP2 | ||
|
||
We value third-party contributions. To keep things simple for you and us, | ||
please adhere to the following contributing guidelines. | ||
|
||
## Getting Started | ||
|
||
* You will need a [GitHub account](https://github.com/signup/free). | ||
* Submit a [ticket for your issue][0], assuming one does not already exist. | ||
* Clearly describe the issue including steps to reproduce when it is a bug. | ||
* Make sure you specify the version that you know has the issue. | ||
* Bonus points for submitting a failing test along with the ticket. | ||
* If you don't have push access, fork the repository on GitHub. | ||
|
||
## Making Changes | ||
|
||
* Create a topic branch for your feature or bug fix. | ||
* Make commits of logical units. | ||
* Make sure your commits adhere to the coding guidelines below. | ||
* Make sure your commit messages are in the [proper format][1]: The first line | ||
of the message should have 50 characters or less, separated by a blank line | ||
from the (optional) body. The body should be wrapped at 70 characters and | ||
paragraphs separated by blank lines. Bulleted lists are also fine. | ||
* Make sure you have added the necessary tests for your changes. | ||
* Run _all_ the tests to assure nothing else was accidentally broken. | ||
|
||
## Coding guidelines | ||
|
||
[PEP 0008][2] is enforced, with the exception of [E501][3] and [E226][3]: | ||
* Indent by 4 spaces, tabs are *strictly forbidden*. | ||
* Lines should not exceed 79 characters where possible without severely | ||
impacting legibility. If breaking a line would make the code much less | ||
readable it's fine to overrun by a little bit. | ||
* No trailing whitespace at EOL or trailing blank lines at EOF. | ||
|
||
## Checking your commit conforms to coding guidelines | ||
|
||
Install a Git pre-commit hook automatically checking for tab and whitespace | ||
errors before committing and also calls `flake8` on your changed files. In the | ||
`.git/hooks` directory of your local Git repository, run the following: | ||
|
||
``` | ||
git config --local core.whitespace "space-before-tab, tab-in-indent, trailing-space, tabwidth=4" | ||
wget https://gist.github.com/kynan/d233073b66e860c41484/raw/pre-commit | ||
chmod +x pre-commit | ||
``` | ||
|
||
Make sure the `pre-commit.sample` hook is still in place, since it is required. | ||
|
||
## Submitting Changes | ||
|
||
* We can only accept your contribution if you have signed the Contributor | ||
License Agreement (CLA). | ||
* Push your changes to a topic branch in your fork of the repository. | ||
* Submit a pull request to the repository in the OP2 organization. | ||
|
||
[0]: https://github.com/OP2/PyOP2/issues | ||
[1]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html | ||
[2]: http://www.python.org/dev/peps/pep-0008/ | ||
[3]: http://pep8.readthedocs.org/en/latest/intro.html#error-codes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
include versioneer.py | ||
include firedrake/_version.py | ||
recursive-include pyop2 *.c | ||
include pyop2/_version.py | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
all: | ||
pdflatex pyop2.tex |
Oops, something went wrong.