Skip to content

Commit

Permalink
Merge pull request #52 from firedrakeproject/ksagiyam/merge_upstream
Browse files Browse the repository at this point in the history
Merge upstream
  • Loading branch information
pbrubeck authored Nov 15, 2024
2 parents c1a8afb + 2ec570a commit 0ae483b
Show file tree
Hide file tree
Showing 194 changed files with 7,173 additions and 3,898 deletions.
6 changes: 0 additions & 6 deletions .flake8

This file was deleted.

15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
50 changes: 33 additions & 17 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ on:
default: "main"
type: string
test_pypi_publish:
description: "Publish to Test PyPi (true | false)"
description: "Publish to Test PyPi"
default: false
type: boolean
pypi_publish:
description: "Publish to PyPi (true | false)"
description: "Publish to PyPi"
default: false
type: boolean

Expand All @@ -26,11 +26,11 @@ on:
default: "main"
type: string
test_pypi_publish:
description: "Publish to Test PyPi (true | false)"
description: "Publish to Test PyPi"
default: false
type: boolean
pypi_publish:
description: "Publish to PyPi (true | false))"
description: "Publish to PyPi"
default: false
type: boolean

Expand All @@ -54,28 +54,44 @@ jobs:
with:
path: dist/*

upload_pypi:
name: Upload to PyPI (optional)
upload_test_pypi:
name: Upload to test PyPI (optional)
if: ${{ github.event.inputs.test_pypi_publish == 'true' }}
needs: [build]
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/fenics-ufl
permissions:
id-token: write

steps:
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist

- name: Push to PyPI
- name: Push to test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: ${{ github.event.inputs.pypi_publish == 'true' }}
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
repository_url: https://upload.pypi.org/legacy/
repository-url: https://test.pypi.org/legacy/

upload_pypi:
name: Upload to PyPI (optional)
if: ${{ github.event.inputs.pypi_publish == 'true' }}
needs: [build]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/fenics-ufl
permissions:
id-token: write

steps:
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist

- name: Push to Test PyPI
- name: Push to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: ${{ github.event.inputs.test_pypi_publish == 'true' }}
with:
user: __token__
password: ${{ secrets.PYPI_TEST_TOKEN }}
repository_url: https://test.pypi.org/legacy/
13 changes: 7 additions & 6 deletions .github/workflows/fenicsx-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: 3.12

- name: Install test dependencies
run: |
sudo apt-get install -y graphviz libgraphviz-dev ninja-build pkg-config
- name: Install UFL
run: |
pip3 install .
pip3 install --break-system-packages .
- name: Install Basix
run: |
Expand Down Expand Up @@ -65,12 +65,12 @@ jobs:

- name: Install UFL
run: |
pip3 install .
pip3 install --break-system-packages .
- name: Install Basix and FFCx
run: |
python3 -m pip install git+https://github.com/FEniCS/basix.git
python3 -m pip install git+https://github.com/FEniCS/ffcx.git
python3 -m pip install --break-system-packages git+https://github.com/FEniCS/basix.git
python3 -m pip install --break-system-packages git+https://github.com/FEniCS/ffcx.git
- name: Clone DOLFINx
uses: actions/checkout@v4
Expand All @@ -83,6 +83,7 @@ jobs:
cmake -G Ninja -DCMAKE_BUILD_TYPE=Developer -B build -S dolfinx/cpp/
cmake --build build
cmake --install build
python3 -m pip -v install --no-build-isolation --check-build-dependencies --config-settings=cmake.build-type="Developer" dolfinx/python/
python3 -m pip install --break-system-packages -r dolfinx/python/build-requirements.txt
python3 -m pip -v install --break-system-packages --no-build-isolation --check-build-dependencies --config-settings=cmake.build-type="Developer" dolfinx/python/[ci]
- name: Run DOLFINx unit tests
run: python3 -m pytest -n auto dolfinx/python/test/unit
30 changes: 18 additions & 12 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,35 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
exclude:
- os: macos-latest
python-version: '3.8'
- os: macos-latest
python-version: '3.9'
include:
- os: windows-latest
python-version: '3.11'

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Lint with flake8
- name: Lint with ruff
run: |
python -m pip install flake8
flake8 --statistics .
- name: Check documentation style
run: |
python -m pip install pydocstyle[toml]
python -m pydocstyle ufl/
pip install ruff
ruff check .
ruff format --check .
- name: Install UFL
run: python -m pip install .[ci]
- name: Run unit tests
run: |
python -m pytest -n auto --cov=ufl/ --junitxml=junit/test-results-${{ matrix.os }}-${{ matrix.python-version }}.xml test/
- name: Upload to Coveralls
if: ${{ github.repository == 'FEniCS/ufl' && github.head_ref == '' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8' }}
if: ${{ github.repository == 'FEniCS/ufl' && github.head_ref == '' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: coveralls

Expand All @@ -61,25 +67,25 @@ jobs:
if-no-files-found: error

- name: Checkout FEniCS/docs
if: ${{ github.repository == 'FEniCS/ufl' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') ) && runner.os == 'Linux' && matrix.python-version == 3.8 }}
if: ${{ github.repository == 'FEniCS/ufl' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') ) && runner.os == 'Linux' && matrix.python-version == 3.12 }}
uses: actions/checkout@v4
with:
repository: "FEniCS/docs"
path: "docs"
ssh-key: "${{ secrets.SSH_GITHUB_DOCS_PRIVATE_KEY }}"
- name: Set version name
if: ${{ github.repository == 'FEniCS/ufl' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') ) && runner.os == 'Linux' && matrix.python-version == 3.8 }}
if: ${{ github.repository == 'FEniCS/ufl' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') ) && runner.os == 'Linux' && matrix.python-version == 3.12 }}
run: |
echo "VERSION_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Copy documentation into repository
if: ${{ github.repository == 'FEniCS/ufl' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') ) && runner.os == 'Linux' && matrix.python-version == 3.8 }}
if: ${{ github.repository == 'FEniCS/ufl' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') ) && runner.os == 'Linux' && matrix.python-version == 3.12 }}
run: |
cd docs
git rm -r --ignore-unmatch ufl/${{ env.VERSION_NAME }}
mkdir -p ufl/${{ env.VERSION_NAME }}
cp -r ../doc/sphinx/build/html/* ufl/${{ env.VERSION_NAME }}
- name: Commit and push documentation to FEniCS/docs
if: ${{ github.repository == 'FEniCS/ufl' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') ) && runner.os == 'Linux' && matrix.python-version == 3.8 }}
if: ${{ github.repository == 'FEniCS/ufl' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') ) && runner.os == 'Linux' && matrix.python-version == 3.12 }}
run: |
cd docs
git config --global user.email "[email protected]"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tsfc-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
CXX: g++-10

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: 3.9

Expand All @@ -28,7 +28,7 @@ jobs:
pip3 install .
- name: Clone tsfc
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: ./tsfc
repository: firedrakeproject/tsfc
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ https://www.fenicsproject.org

[![UFL CI](https://github.com/FEniCS/ufl/workflows/UFL%20CI/badge.svg)](https://github.com/FEniCS/ufl/workflows/UFL%20CI)
[![Coverage Status](https://coveralls.io/repos/github/FEniCS/ufl/badge.svg?branch=master)](https://coveralls.io/github/FEniCS/ufl?branch=master)
[![Documentation Status](https://readthedocs.org/projects/fenics-ufl/badge/?version=latest)](https://fenics.readthedocs.io/projects/ufl/en/latest/?badge=latest)

## Documentation

Documentation can be viewed at https://fenics-ufl.readthedocs.org/.

Documentation can be viewed at https://docs.fenicsproject.org

## License

Expand Down
18 changes: 15 additions & 3 deletions demo/Constant.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,27 @@
# Modified by Martin Sandve Alnes, 2009
#
# Test form for scalar and vector constants.
from ufl import (Coefficient, Constant, FunctionSpace, Mesh, TestFunction, TrialFunction, VectorConstant, dot, dx, grad,
inner, triangle)
from ufl import (
Coefficient,
Constant,
FunctionSpace,
Mesh,
TestFunction,
TrialFunction,
VectorConstant,
dot,
dx,
grad,
inner,
triangle,
)
from ufl.finiteelement import FiniteElement
from ufl.pullback import identity_pullback
from ufl.sobolevspace import H1

cell = triangle
element = FiniteElement("Lagrange", cell, 1, (), identity_pullback, H1)
domain = Mesh(FiniteElement("Lagrange", cell, 1, (2, ), identity_pullback, H1))
domain = Mesh(FiniteElement("Lagrange", cell, 1, (2,), identity_pullback, H1))
space = FunctionSpace(domain, element)

v = TestFunction(space)
Expand Down
16 changes: 13 additions & 3 deletions demo/ConvectionJacobi.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,23 @@
# Author: Martin Sandve Alnes
# Date: 2008-10-03
#
from ufl import Coefficient, FunctionSpace, Mesh, TestFunction, TrialFunction, dot, dx, grad, triangle
from ufl import (
Coefficient,
FunctionSpace,
Mesh,
TestFunction,
TrialFunction,
dot,
dx,
grad,
triangle,
)
from ufl.finiteelement import FiniteElement
from ufl.pullback import identity_pullback
from ufl.sobolevspace import H1

element = FiniteElement("Lagrange", triangle, 1, (2, ), identity_pullback, H1)
domain = Mesh(FiniteElement("Lagrange", triangle, 1, (2, ), identity_pullback, H1))
element = FiniteElement("Lagrange", triangle, 1, (2,), identity_pullback, H1)
domain = Mesh(FiniteElement("Lagrange", triangle, 1, (2,), identity_pullback, H1))
space = FunctionSpace(domain, element)

u = TrialFunction(space)
Expand Down
4 changes: 2 additions & 2 deletions demo/ConvectionJacobi2.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from ufl.pullback import identity_pullback
from ufl.sobolevspace import H1

element = FiniteElement("Lagrange", triangle, 1, (2, ), identity_pullback, H1)
domain = Mesh(FiniteElement("Lagrange", triangle, 1, (2, ), identity_pullback, H1))
element = FiniteElement("Lagrange", triangle, 1, (2,), identity_pullback, H1)
domain = Mesh(FiniteElement("Lagrange", triangle, 1, (2,), identity_pullback, H1))
space = FunctionSpace(domain, element)

u = TrialFunction(space)
Expand Down
4 changes: 2 additions & 2 deletions demo/ConvectionVector.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from ufl.pullback import identity_pullback
from ufl.sobolevspace import H1

element = FiniteElement("Lagrange", triangle, 1, (2, ), identity_pullback, H1)
domain = Mesh(FiniteElement("Lagrange", triangle, 1, (2, ), identity_pullback, H1))
element = FiniteElement("Lagrange", triangle, 1, (2,), identity_pullback, H1)
domain = Mesh(FiniteElement("Lagrange", triangle, 1, (2,), identity_pullback, H1))
space = FunctionSpace(domain, element)

v = TestFunction(space)
Expand Down
4 changes: 2 additions & 2 deletions demo/Elasticity.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
from ufl.pullback import identity_pullback
from ufl.sobolevspace import H1

element = FiniteElement("Lagrange", tetrahedron, 1, (3, ), identity_pullback, H1)
domain = Mesh(FiniteElement("Lagrange", tetrahedron, 1, (3, ), identity_pullback, H1))
element = FiniteElement("Lagrange", tetrahedron, 1, (3,), identity_pullback, H1)
domain = Mesh(FiniteElement("Lagrange", tetrahedron, 1, (3,), identity_pullback, H1))
space = FunctionSpace(domain, element)

v = TestFunction(space)
Expand Down
2 changes: 1 addition & 1 deletion demo/EnergyNorm.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from ufl.sobolevspace import H1

element = FiniteElement("Lagrange", tetrahedron, 1, (), identity_pullback, H1)
domain = Mesh(FiniteElement("Lagrange", tetrahedron, 1, (3, ), identity_pullback, H1))
domain = Mesh(FiniteElement("Lagrange", tetrahedron, 1, (3,), identity_pullback, H1))
space = FunctionSpace(domain, element)

v = Coefficient(space)
Expand Down
16 changes: 14 additions & 2 deletions demo/Equation.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,25 @@
# the unknown u to the right-hand side, all terms may
# be listed on one line and left- and right-hand sides
# extracted by lhs() and rhs().
from ufl import Coefficient, FunctionSpace, Mesh, TestFunction, TrialFunction, dot, dx, grad, lhs, rhs, triangle
from ufl import (
Coefficient,
FunctionSpace,
Mesh,
TestFunction,
TrialFunction,
dot,
dx,
grad,
lhs,
rhs,
triangle,
)
from ufl.finiteelement import FiniteElement
from ufl.pullback import identity_pullback
from ufl.sobolevspace import H1

element = FiniteElement("Lagrange", triangle, 1, (), identity_pullback, H1)
domain = Mesh(FiniteElement("Lagrange", triangle, 1, (2, ), identity_pullback, H1))
domain = Mesh(FiniteElement("Lagrange", triangle, 1, (2,), identity_pullback, H1))
space = FunctionSpace(domain, element)

k = 0.1
Expand Down
Loading

0 comments on commit 0ae483b

Please sign in to comment.