fenicsx-compat 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fenicsx_compat-0.1.0/.devcontainer/nightly/devcontainer.json +51 -0
- fenicsx_compat-0.1.0/.devcontainer/setup-claude-plugins.sh +47 -0
- fenicsx_compat-0.1.0/.devcontainer/setup.sh +15 -0
- fenicsx_compat-0.1.0/.devcontainer/stable/devcontainer.json +50 -0
- fenicsx_compat-0.1.0/.github/workflows/check.yml +32 -0
- fenicsx_compat-0.1.0/.github/workflows/test.yml +36 -0
- fenicsx_compat-0.1.0/.gitignore +182 -0
- fenicsx_compat-0.1.0/.pre-commit-config.yaml +28 -0
- fenicsx_compat-0.1.0/LICENSE +21 -0
- fenicsx_compat-0.1.0/PKG-INFO +34 -0
- fenicsx_compat-0.1.0/README.md +9 -0
- fenicsx_compat-0.1.0/handoff-fenicsx-compat-2026-10-07.md +123 -0
- fenicsx_compat-0.1.0/pyproject.toml +62 -0
- fenicsx_compat-0.1.0/src/fenicsx_compat/__init__.py +72 -0
- fenicsx_compat-0.1.0/src/fenicsx_compat/_dolfinx_version.py +14 -0
- fenicsx_compat-0.1.0/src/fenicsx_compat/fem.py +211 -0
- fenicsx_compat-0.1.0/src/fenicsx_compat/io.py +17 -0
- fenicsx_compat-0.1.0/src/fenicsx_compat/la.py +74 -0
- fenicsx_compat-0.1.0/src/fenicsx_compat/mesh.py +277 -0
- fenicsx_compat-0.1.0/src/fenicsx_compat/optional.py +12 -0
- fenicsx_compat-0.1.0/src/fenicsx_compat/petsc.py +151 -0
- fenicsx_compat-0.1.0/src/fenicsx_compat/py.typed +0 -0
- fenicsx_compat-0.1.0/src/fenicsx_compat/ufl.py +58 -0
- fenicsx_compat-0.1.0/tests/conftest.py +8 -0
- fenicsx_compat-0.1.0/tests/test_dolfinx_version.py +22 -0
- fenicsx_compat-0.1.0/tests/test_fem.py +230 -0
- fenicsx_compat-0.1.0/tests/test_init.py +40 -0
- fenicsx_compat-0.1.0/tests/test_io.py +47 -0
- fenicsx_compat-0.1.0/tests/test_la.py +62 -0
- fenicsx_compat-0.1.0/tests/test_mesh.py +223 -0
- fenicsx_compat-0.1.0/tests/test_optional.py +18 -0
- fenicsx_compat-0.1.0/tests/test_package.py +6 -0
- fenicsx_compat-0.1.0/tests/test_petsc.py +174 -0
- fenicsx_compat-0.1.0/tests/test_ufl.py +82 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "fenicsx-compat-nightly",
|
|
3
|
+
"image": "ghcr.io/fenics/dolfinx/dolfinx:nightly",
|
|
4
|
+
"workspaceFolder": "/home/shared",
|
|
5
|
+
"workspaceMount": "source=${localWorkspaceFolder},target=/home/shared,type=bind",
|
|
6
|
+
|
|
7
|
+
"runArgs": [
|
|
8
|
+
"--name", "fenicsx-compat-nightly"
|
|
9
|
+
],
|
|
10
|
+
|
|
11
|
+
"containerEnv": {
|
|
12
|
+
"PYVISTA_OFF_SCREEN": "false",
|
|
13
|
+
"PYVISTA_JUPYTER_BACKEND": "html",
|
|
14
|
+
"CI": "0",
|
|
15
|
+
"DISPLAY": ":99.0",
|
|
16
|
+
"LIBGL_ALWAYS_SOFTWARE": "1"
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
// Install Zsh as the default shell inside the container
|
|
20
|
+
"features": {
|
|
21
|
+
"ghcr.io/devcontainers/features/common-utils:2": {
|
|
22
|
+
"installZsh": true,
|
|
23
|
+
"configureZshAsDefaultShell": true
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
// Automatically run your editable install every time the container is built/started
|
|
28
|
+
"postAttachCommand": "bash .devcontainer/setup.sh; bash .devcontainer/setup-claude-plugins.sh",
|
|
29
|
+
|
|
30
|
+
// Recommended VS Code extensions to run inside the container
|
|
31
|
+
"customizations": {
|
|
32
|
+
"vscode": {
|
|
33
|
+
"extensions": [
|
|
34
|
+
"ms-python.python",
|
|
35
|
+
"ms-python.vscode-pylance",
|
|
36
|
+
"tamasfe.even-better-toml",
|
|
37
|
+
"streetsidesoftware.code-spell-checker",
|
|
38
|
+
"anthropic.claude-code"
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
// Mount local Zsh configs into the container
|
|
44
|
+
"mounts": [
|
|
45
|
+
"source=${localEnv:HOME}/.zshrc,target=/root/.zshrc,type=bind,readonly",
|
|
46
|
+
"source=${localEnv:HOME}/.oh-my-zsh,target=/root/.oh-my-zsh,type=bind,readonly",
|
|
47
|
+
"source=${localEnv:HOME}/.ssh,target=/root/.ssh,type=bind,readonly"
|
|
48
|
+
],
|
|
49
|
+
|
|
50
|
+
"remoteUser": "root"
|
|
51
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -uo pipefail
|
|
3
|
+
|
|
4
|
+
# Ensures the superpowers and mattpocock-skills Claude Code plugins are
|
|
5
|
+
# installed and enabled (user scope) whenever this devcontainer is attached
|
|
6
|
+
# to. Idempotent: safe to re-run.
|
|
7
|
+
#
|
|
8
|
+
# Why this exists: plugins are installed into ~/.claude, which lives in the
|
|
9
|
+
# container's root filesystem. A fresh devcontainer build starts with none
|
|
10
|
+
# of that, so we reinstall on every attach rather than relying on it
|
|
11
|
+
# persisting.
|
|
12
|
+
#
|
|
13
|
+
# The `claude` binary isn't on PATH in this container image; it ships
|
|
14
|
+
# bundled inside the Claude Code VS Code extension, which is installed by
|
|
15
|
+
# the editor as part of attaching (not guaranteed to exist yet at
|
|
16
|
+
# postCreateCommand time), hence the short wait loop below.
|
|
17
|
+
|
|
18
|
+
find_claude_bin() {
|
|
19
|
+
find "$HOME/.vscode-server/extensions" -maxdepth 1 -iname 'anthropic.claude-code-*' -type d 2>/dev/null \
|
|
20
|
+
| sort -V | tail -1 | sed 's#$#/resources/native-binary/claude#'
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
CLAUDE_BIN=""
|
|
24
|
+
for _ in $(seq 1 30); do
|
|
25
|
+
candidate="$(find_claude_bin)"
|
|
26
|
+
if [ -n "$candidate" ] && [ -x "$candidate" ]; then
|
|
27
|
+
CLAUDE_BIN="$candidate"
|
|
28
|
+
break
|
|
29
|
+
fi
|
|
30
|
+
sleep 2
|
|
31
|
+
done
|
|
32
|
+
|
|
33
|
+
if [ -z "$CLAUDE_BIN" ]; then
|
|
34
|
+
echo "setup-claude-plugins: Claude Code CLI binary not found after waiting; skipping plugin setup." >&2
|
|
35
|
+
exit 0
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
# `|| true`: marketplace/plugin already present is reported as an error by
|
|
39
|
+
# the CLI, and that's a success state for an idempotent setup script.
|
|
40
|
+
"$CLAUDE_BIN" plugin marketplace add obra/superpowers >/dev/null 2>&1 || true
|
|
41
|
+
"$CLAUDE_BIN" plugin marketplace add mattpocock/skills >/dev/null 2>&1 || true
|
|
42
|
+
"$CLAUDE_BIN" plugin marketplace add blader/humanizer >/dev/null 2>&1 || true
|
|
43
|
+
"$CLAUDE_BIN" plugin install superpowers@superpowers-dev >/dev/null 2>&1 || true
|
|
44
|
+
"$CLAUDE_BIN" plugin install mattpocock-skills@mattpocock >/dev/null 2>&1 || true
|
|
45
|
+
"$CLAUDE_BIN" plugin install blader/humanizer@blader >/dev/null 2>&1 || true
|
|
46
|
+
|
|
47
|
+
echo "setup-claude-plugins: ensured superpowers and mattpocock-skills plugins are installed."
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -e # Exit immediately if a command exits with a non-zero status
|
|
3
|
+
|
|
4
|
+
chsh -s $(which zsh) root || true
|
|
5
|
+
if ! command -v starship &> /dev/null; then
|
|
6
|
+
echo "Installing Starship prompt..."
|
|
7
|
+
curl -sS https://starship.rs/install.sh | sh -s -- -y
|
|
8
|
+
fi
|
|
9
|
+
python3 -m pip install pkgconfig
|
|
10
|
+
HDF5_MPI=ON HDF5_PKGCONFIG_NAME="hdf5" python3 -m pip install h5py --no-build-isolation --no-binary=h5py
|
|
11
|
+
# python3 -m pip install scifem --no-build-isolation --no-binary=scifem
|
|
12
|
+
# python3 -m pip install -e .[dev]
|
|
13
|
+
# pre-commit install
|
|
14
|
+
# 3. Print success message
|
|
15
|
+
echo "Container setup complete!"
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "fenicsx-compat-stable",
|
|
3
|
+
"image": "ghcr.io/fenics/dolfinx/dolfinx:stable",
|
|
4
|
+
"workspaceFolder": "/home/shared",
|
|
5
|
+
"workspaceMount": "source=${localWorkspaceFolder},target=/home/shared,type=bind",
|
|
6
|
+
|
|
7
|
+
"runArgs": [
|
|
8
|
+
"--name", "fenicsx-compat-stable"
|
|
9
|
+
],
|
|
10
|
+
|
|
11
|
+
"containerEnv": {
|
|
12
|
+
"PYVISTA_OFF_SCREEN": "false",
|
|
13
|
+
"PYVISTA_JUPYTER_BACKEND": "html",
|
|
14
|
+
"CI": "0",
|
|
15
|
+
"DISPLAY": ":99.0",
|
|
16
|
+
"LIBGL_ALWAYS_SOFTWARE": "1"
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
// Install Zsh as the default shell inside the container
|
|
20
|
+
"features": {
|
|
21
|
+
"ghcr.io/devcontainers/features/common-utils:2": {
|
|
22
|
+
"installZsh": true,
|
|
23
|
+
"configureZshAsDefaultShell": true
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
// Automatically run your editable install every time the container is built/started
|
|
28
|
+
"postAttachCommand": "bash .devcontainer/setup.sh; bash .devcontainer/setup-claude-plugins.sh",
|
|
29
|
+
|
|
30
|
+
// Recommended VS Code extensions to run inside the container
|
|
31
|
+
"customizations": {
|
|
32
|
+
"vscode": {
|
|
33
|
+
"extensions": [
|
|
34
|
+
"ms-python.python",
|
|
35
|
+
"ms-python.vscode-pylance",
|
|
36
|
+
"tamasfe.even-better-toml",
|
|
37
|
+
"streetsidesoftware.code-spell-checker"
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
// Mount local Zsh configs into the container
|
|
43
|
+
"mounts": [
|
|
44
|
+
"source=${localEnv:HOME}/.zshrc,target=/root/.zshrc,type=bind,readonly",
|
|
45
|
+
"source=${localEnv:HOME}/.oh-my-zsh,target=/root/.oh-my-zsh,type=bind,readonly",
|
|
46
|
+
"source=${localEnv:HOME}/.ssh,target=/root/.ssh,type=bind,readonly"
|
|
47
|
+
],
|
|
48
|
+
|
|
49
|
+
"remoteUser": "root"
|
|
50
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: Code quality
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches: [main]
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
check-code:
|
|
10
|
+
name: Lint, format and type-check
|
|
11
|
+
runs-on: ubuntu-24.04
|
|
12
|
+
container: ghcr.io/fenics/dolfinx/dolfinx:nightly
|
|
13
|
+
env:
|
|
14
|
+
DEB_PYTHON_INSTALL_LAYOUT: deb_system
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v7
|
|
18
|
+
|
|
19
|
+
- name: Update pip
|
|
20
|
+
run: python3 -m pip install --upgrade pip
|
|
21
|
+
|
|
22
|
+
- name: Install package
|
|
23
|
+
run: python3 -m pip install ".[dev]"
|
|
24
|
+
|
|
25
|
+
- name: Lint (ruff check)
|
|
26
|
+
run: python3 -m ruff check src tests
|
|
27
|
+
|
|
28
|
+
- name: Format check (ruff format)
|
|
29
|
+
run: python3 -m ruff format --check src tests
|
|
30
|
+
|
|
31
|
+
- name: Type-check (mypy)
|
|
32
|
+
run: python3 -m mypy --config-file pyproject.toml src tests
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
name: Test package
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches: [main]
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
test-code:
|
|
10
|
+
name: Test on ${{ matrix.label }}
|
|
11
|
+
runs-on: ubuntu-24.04
|
|
12
|
+
container: ghcr.io/fenics/dolfinx/dolfinx:${{ matrix.label }}
|
|
13
|
+
env:
|
|
14
|
+
DEB_PYTHON_INSTALL_LAYOUT: deb_system
|
|
15
|
+
OMPI_ALLOW_RUN_AS_ROOT: 1
|
|
16
|
+
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
|
|
17
|
+
PRTE_MCA_rmaps_default_mapping_policy: :oversubscribe
|
|
18
|
+
strategy:
|
|
19
|
+
fail-fast: false
|
|
20
|
+
matrix:
|
|
21
|
+
label: ["nightly", "stable", "v0.10.0"]
|
|
22
|
+
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v7
|
|
25
|
+
|
|
26
|
+
- name: Update pip
|
|
27
|
+
run: python3 -m pip install --upgrade pip
|
|
28
|
+
|
|
29
|
+
- name: Install package
|
|
30
|
+
run: python3 -m pip install ".[test]"
|
|
31
|
+
|
|
32
|
+
- name: Run tests (serial)
|
|
33
|
+
run: python3 -m pytest -v
|
|
34
|
+
|
|
35
|
+
- name: Run tests (parallel)
|
|
36
|
+
run: mpirun -n 2 python3 -m pytest -v -m "not serial"
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
third-party/
|
|
2
|
+
devcontainer-lock.json
|
|
3
|
+
|
|
4
|
+
# Specs, plans, and other local-only planning docs (never committed)
|
|
5
|
+
docs/superpowers/
|
|
6
|
+
# Created by https://www.toptal.com/developers/gitignore/api/python
|
|
7
|
+
# Edit at https://www.toptal.com/developers/gitignore?templates=python
|
|
8
|
+
|
|
9
|
+
### Python ###
|
|
10
|
+
# Byte-compiled / optimized / DLL files
|
|
11
|
+
__pycache__/
|
|
12
|
+
*.py[cod]
|
|
13
|
+
*$py.class
|
|
14
|
+
|
|
15
|
+
# C extensions
|
|
16
|
+
*.so
|
|
17
|
+
|
|
18
|
+
# Distribution / packaging
|
|
19
|
+
.Python
|
|
20
|
+
build/
|
|
21
|
+
develop-eggs/
|
|
22
|
+
dist/
|
|
23
|
+
downloads/
|
|
24
|
+
eggs/
|
|
25
|
+
.eggs/
|
|
26
|
+
lib/
|
|
27
|
+
lib64/
|
|
28
|
+
parts/
|
|
29
|
+
sdist/
|
|
30
|
+
var/
|
|
31
|
+
wheels/
|
|
32
|
+
share/python-wheels/
|
|
33
|
+
*.egg-info/
|
|
34
|
+
.installed.cfg
|
|
35
|
+
*.egg
|
|
36
|
+
MANIFEST
|
|
37
|
+
|
|
38
|
+
# PyInstaller
|
|
39
|
+
# Usually these files are written by a python script from a template
|
|
40
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
41
|
+
*.manifest
|
|
42
|
+
*.spec
|
|
43
|
+
|
|
44
|
+
# Installer logs
|
|
45
|
+
pip-log.txt
|
|
46
|
+
pip-delete-this-directory.txt
|
|
47
|
+
|
|
48
|
+
# Unit test / coverage reports
|
|
49
|
+
htmlcov/
|
|
50
|
+
.tox/
|
|
51
|
+
.nox/
|
|
52
|
+
.coverage
|
|
53
|
+
.coverage.*
|
|
54
|
+
.cache
|
|
55
|
+
nosetests.xml
|
|
56
|
+
coverage.xml
|
|
57
|
+
*.cover
|
|
58
|
+
*.py,cover
|
|
59
|
+
.hypothesis/
|
|
60
|
+
.pytest_cache/
|
|
61
|
+
cover/
|
|
62
|
+
|
|
63
|
+
# Translations
|
|
64
|
+
*.mo
|
|
65
|
+
*.pot
|
|
66
|
+
|
|
67
|
+
# Django stuff:
|
|
68
|
+
*.log
|
|
69
|
+
local_settings.py
|
|
70
|
+
db.sqlite3
|
|
71
|
+
db.sqlite3-journal
|
|
72
|
+
|
|
73
|
+
# Flask stuff:
|
|
74
|
+
instance/
|
|
75
|
+
.webassets-cache
|
|
76
|
+
|
|
77
|
+
# Scrapy stuff:
|
|
78
|
+
.scrapy
|
|
79
|
+
|
|
80
|
+
# Sphinx documentation
|
|
81
|
+
docs/_build/
|
|
82
|
+
|
|
83
|
+
# PyBuilder
|
|
84
|
+
.pybuilder/
|
|
85
|
+
target/
|
|
86
|
+
|
|
87
|
+
# Jupyter Notebook
|
|
88
|
+
.ipynb_checkpoints
|
|
89
|
+
|
|
90
|
+
# IPython
|
|
91
|
+
profile_default/
|
|
92
|
+
ipython_config.py
|
|
93
|
+
|
|
94
|
+
# pyenv
|
|
95
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
96
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
97
|
+
# .python-version
|
|
98
|
+
|
|
99
|
+
# pipenv
|
|
100
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
101
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
102
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
103
|
+
# install all needed dependencies.
|
|
104
|
+
#Pipfile.lock
|
|
105
|
+
|
|
106
|
+
# poetry
|
|
107
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
108
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
109
|
+
# commonly ignored for libraries.
|
|
110
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
111
|
+
#poetry.lock
|
|
112
|
+
|
|
113
|
+
# pdm
|
|
114
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
115
|
+
#pdm.lock
|
|
116
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
117
|
+
# in version control.
|
|
118
|
+
# https://pdm.fming.dev/#use-with-ide
|
|
119
|
+
.pdm.toml
|
|
120
|
+
|
|
121
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
122
|
+
__pypackages__/
|
|
123
|
+
|
|
124
|
+
# Celery stuff
|
|
125
|
+
celerybeat-schedule
|
|
126
|
+
celerybeat.pid
|
|
127
|
+
|
|
128
|
+
# SageMath parsed files
|
|
129
|
+
*.sage.py
|
|
130
|
+
|
|
131
|
+
# Environments
|
|
132
|
+
.env
|
|
133
|
+
.venv
|
|
134
|
+
env/
|
|
135
|
+
venv/
|
|
136
|
+
ENV/
|
|
137
|
+
env.bak/
|
|
138
|
+
venv.bak/
|
|
139
|
+
|
|
140
|
+
# Spyder project settings
|
|
141
|
+
.spyderproject
|
|
142
|
+
.spyproject
|
|
143
|
+
|
|
144
|
+
# Rope project settings
|
|
145
|
+
.ropeproject
|
|
146
|
+
|
|
147
|
+
# mkdocs documentation
|
|
148
|
+
/site
|
|
149
|
+
|
|
150
|
+
# mypy
|
|
151
|
+
.mypy_cache/
|
|
152
|
+
.dmypy.json
|
|
153
|
+
dmypy.json
|
|
154
|
+
|
|
155
|
+
# Pyre type checker
|
|
156
|
+
.pyre/
|
|
157
|
+
|
|
158
|
+
# pytype static type analyzer
|
|
159
|
+
.pytype/
|
|
160
|
+
|
|
161
|
+
# Cython debug symbols
|
|
162
|
+
cython_debug/
|
|
163
|
+
|
|
164
|
+
# PyCharm
|
|
165
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
166
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
167
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
168
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
169
|
+
#.idea/
|
|
170
|
+
|
|
171
|
+
### Python Patch ###
|
|
172
|
+
# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
|
|
173
|
+
poetry.toml
|
|
174
|
+
|
|
175
|
+
# ruff
|
|
176
|
+
.ruff_cache/
|
|
177
|
+
|
|
178
|
+
# LSP config files
|
|
179
|
+
pyrightconfig.json
|
|
180
|
+
|
|
181
|
+
# End of https://www.toptal.com/developers/gitignore/api/python
|
|
182
|
+
.superpowers/
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
3
|
+
rev: v6.0.0
|
|
4
|
+
hooks:
|
|
5
|
+
- id: trailing-whitespace
|
|
6
|
+
- id: end-of-file-fixer
|
|
7
|
+
- id: check-yaml
|
|
8
|
+
- id: check-added-large-files
|
|
9
|
+
args: ["--maxkb=3000"]
|
|
10
|
+
- id: check-docstring-first
|
|
11
|
+
- id: debug-statements
|
|
12
|
+
- id: check-toml
|
|
13
|
+
|
|
14
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
15
|
+
rev: v0.16.7
|
|
16
|
+
hooks:
|
|
17
|
+
- id: ruff
|
|
18
|
+
args: ["--fix"]
|
|
19
|
+
- id: ruff-format
|
|
20
|
+
|
|
21
|
+
- repo: local
|
|
22
|
+
hooks:
|
|
23
|
+
- id: mypy
|
|
24
|
+
name: mypy
|
|
25
|
+
entry: python3 -m mypy --config-file pyproject.toml src tests
|
|
26
|
+
language: system
|
|
27
|
+
types: [python]
|
|
28
|
+
pass_filenames: false
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Simula Research Laboratory, Henrik N.T. Finsberg, Jørgen S. Dokken
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: fenicsx-compat
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Cross-version compatibility helpers for DOLFINx (FEniCSx)
|
|
5
|
+
Author-email: "Henrik N.T. Finsberg" <henriknf@simula.no>, "Jørgen S. Dokken" <dokken@simula.no>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Python: >=3.12
|
|
9
|
+
Requires-Dist: fenics-dolfinx>=0.10.0
|
|
10
|
+
Requires-Dist: packaging
|
|
11
|
+
Provides-Extra: all
|
|
12
|
+
Requires-Dist: mypy; extra == 'all'
|
|
13
|
+
Requires-Dist: petsc4py; extra == 'all'
|
|
14
|
+
Requires-Dist: pre-commit; extra == 'all'
|
|
15
|
+
Requires-Dist: pytest; extra == 'all'
|
|
16
|
+
Requires-Dist: ruff; extra == 'all'
|
|
17
|
+
Provides-Extra: dev
|
|
18
|
+
Requires-Dist: mypy; extra == 'dev'
|
|
19
|
+
Requires-Dist: pre-commit; extra == 'dev'
|
|
20
|
+
Requires-Dist: ruff; extra == 'dev'
|
|
21
|
+
Provides-Extra: test
|
|
22
|
+
Requires-Dist: petsc4py; extra == 'test'
|
|
23
|
+
Requires-Dist: pytest; extra == 'test'
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
|
|
26
|
+
# fenicsx-compat
|
|
27
|
+
|
|
28
|
+
Cross-version compatibility helpers for [DOLFINx](https://github.com/FEniCS/dolfinx).
|
|
29
|
+
|
|
30
|
+
Centralizes workarounds for breaking API changes across dolfinx versions
|
|
31
|
+
(nightly/main, stable, and back to release 0.10), previously duplicated
|
|
32
|
+
across `dolfinx-adjoint`, `io4dolfinx`, and `scifem`.
|
|
33
|
+
|
|
34
|
+
Pure Python, no compiled extensions. Supports dolfinx >= 0.10.0.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# fenicsx-compat
|
|
2
|
+
|
|
3
|
+
Cross-version compatibility helpers for [DOLFINx](https://github.com/FEniCS/dolfinx).
|
|
4
|
+
|
|
5
|
+
Centralizes workarounds for breaking API changes across dolfinx versions
|
|
6
|
+
(nightly/main, stable, and back to release 0.10), previously duplicated
|
|
7
|
+
across `dolfinx-adjoint`, `io4dolfinx`, and `scifem`.
|
|
8
|
+
|
|
9
|
+
Pure Python, no compiled extensions. Supports dolfinx >= 0.10.0.
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# Handoff — fenicsx-compat
|
|
2
|
+
|
|
3
|
+
**Written:** 2026-10-07 · **Repo:** `/home/shared` (= the fenicsx-compat repo itself)
|
|
4
|
+
**Remote:** `git@github.com:scientificcomputing/fenicsx-compat.git`
|
|
5
|
+
|
|
6
|
+
## Where things stand
|
|
7
|
+
|
|
8
|
+
The initial build is **done and merged**. All 30 plan tasks plus a controller-inserted
|
|
9
|
+
Task 28.5 shipped on `feat/fenicsx-compat` and landed on `main` via PR #1
|
|
10
|
+
(merge commit `5434068`, 2026-09-22). Local `main` is clean and identical to `origin/main`.
|
|
11
|
+
|
|
12
|
+
Four rounds of real CI feedback from the `v0.10.0` and `stable` legs were diagnosed and
|
|
13
|
+
fixed before the merge — the last four commits (`7232b17`, `99d0849`, `489c30c`, `472483e`,
|
|
14
|
+
`6003833`) are each one of those fixes. Read their messages and docstrings; they carry the
|
|
15
|
+
reasoning.
|
|
16
|
+
|
|
17
|
+
**The one thing I could not verify:** whether all three CI legs went green on `main` after
|
|
18
|
+
the merge. `gh` is not installed in this environment, so I had no way to query run status.
|
|
19
|
+
Check this first.
|
|
20
|
+
|
|
21
|
+
## Do not redo
|
|
22
|
+
|
|
23
|
+
Everything below is already written down. Read it rather than re-deriving it.
|
|
24
|
+
|
|
25
|
+
| What | Where |
|
|
26
|
+
|---|---|
|
|
27
|
+
| Design spec (incl. §9 resolutions, §5 function catalog) | `docs/superpowers/specs/2026-09-21-fenicsx-compat-design.md` |
|
|
28
|
+
| 30-task implementation plan, with dated "Corrected during execution" notes | `docs/superpowers/plans/2026-09-21-fenicsx-compat-implementation.md` |
|
|
29
|
+
| SDD ledger — every ruling with its cost-if-wrong, per-task log, deferred minors, one retraction | `.superpowers/sdd/2026-09-21-fenicsx-compat-implementation/progress.md` |
|
|
30
|
+
| Per-task briefs, reports, review diffs | same directory, `task-*.md` / `review-*.diff` |
|
|
31
|
+
| What each compat function works around, per dolfinx generation | the function docstrings in `src/fenicsx_compat/` |
|
|
32
|
+
|
|
33
|
+
Both `docs/superpowers/` and `.superpowers/` are gitignored.
|
|
34
|
+
|
|
35
|
+
## Hard rules (from the user, standing)
|
|
36
|
+
|
|
37
|
+
1. **Never commit `docs/superpowers/`.** Spec and plan are local-only, permanently.
|
|
38
|
+
2. **No mocking, no monkeypatching, no module reloads to fake a dolfinx version.** Version
|
|
39
|
+
boundaries are covered by the 3-leg CI matrix plus version-conditional assertions against
|
|
40
|
+
whichever dolfinx is actually installed.
|
|
41
|
+
3. **Tests never install packages.** Test deps come from the `test` extra.
|
|
42
|
+
4. **If a plan step is wrong when you run it, fix the plan and say what changed** — do not
|
|
43
|
+
silently work around it.
|
|
44
|
+
5. Migrating the three sibling repos in `third-party/` was explicitly out of scope for this
|
|
45
|
+
plan. Each has its own `.git`; treat them as read-only reference unless asked.
|
|
46
|
+
|
|
47
|
+
## Environment facts that cost me time
|
|
48
|
+
|
|
49
|
+
- `/dolfinx-env` has **dolfinx 0.12.0.dev0 only** (nightly generation). You can reproduce
|
|
50
|
+
the nightly leg locally and nothing else. The `v0.10.0` and `stable` legs exist only in
|
|
51
|
+
CI — every bug they caught was invisible here.
|
|
52
|
+
- The `v0.10.0` leg is a deliberate departure from the sibling repos' 2-leg matrix. It
|
|
53
|
+
caught three distinct bugs. Keep it.
|
|
54
|
+
- `gh` is not installed.
|
|
55
|
+
- Local test commands matching CI:
|
|
56
|
+
```
|
|
57
|
+
cd /home/shared && python3 -m pytest -v
|
|
58
|
+
cd /home/shared && mpirun -n 2 python3 -m pytest -v -m "not serial"
|
|
59
|
+
cd /home/shared && mpirun -n 3 python3 -m pytest -v -m "not serial" # extra; n=2 hides rank-asymmetry bugs
|
|
60
|
+
```
|
|
61
|
+
Run `-n 3` too. Two separate real bugs were invisible at `-n 2` because both ranks
|
|
62
|
+
happened to own equal shares.
|
|
63
|
+
|
|
64
|
+
## Traps that bit me, in case you touch these areas
|
|
65
|
+
|
|
66
|
+
These are recorded in the ledger in full; this is the short list so you recognise the shape.
|
|
67
|
+
|
|
68
|
+
- **MPI collective deadlock via `pytest.skip`.** A per-rank skip before a collective dolfinx
|
|
69
|
+
call hangs forever. `dolfinx.fem.Expression()` is collective (it jits on the mesh comm).
|
|
70
|
+
Make the skip decision uniform with `comm.allreduce(...)` first.
|
|
71
|
+
- **`MPI.LAND` is not automatically the right reducer.** It false-fails where a rank
|
|
72
|
+
legitimately owns zero of something. Pick the invariant that holds at *every* rank count —
|
|
73
|
+
usually `allreduce(..., MPI.SUM) == <known total>`.
|
|
74
|
+
- **`create_mesh` input is each rank's *share*, not the whole mesh.** Passing full arrays on
|
|
75
|
+
every rank silently builds an N× too-large mesh on nightly, and aborts with signal 6 on
|
|
76
|
+
0.10. Assert `topology.index_map(tdim).size_global`.
|
|
77
|
+
- **dolfinx disagrees with itself across versions on parameter *order*, not just names.**
|
|
78
|
+
`transfer_meshtags_to_submesh` swapped its two entity-map args between 0.11 and nightly
|
|
79
|
+
with identical names. Forward by keyword. Do not "simplify" it back to positional.
|
|
80
|
+
- **Tests that cannot fail.** Three separate tests passed against deliberately broken code.
|
|
81
|
+
Before trusting any new test, mutate the implementation and watch it go red — and check
|
|
82
|
+
it fails via *your assertion*, not via a library error that masks it.
|
|
83
|
+
|
|
84
|
+
## Suggested next steps
|
|
85
|
+
|
|
86
|
+
1. Confirm the three CI legs are green on `main` (install `gh`, or check the Actions tab).
|
|
87
|
+
2. **Unfinished process obligation:** the final whole-branch review never ran — the merge
|
|
88
|
+
happened first. Decide with the user whether to run it retroactively against
|
|
89
|
+
`git log 5434068^1..5434068`, or drop it.
|
|
90
|
+
3. **Owed to the user:** a walkthrough of the rulings I made on their behalf, in order,
|
|
91
|
+
with cost-if-wrong for each. They are all in the ledger under `## Rulings on scan findings`
|
|
92
|
+
and `## Task log`, including two where I corrected myself (F4 deadlock, F6 single-form)
|
|
93
|
+
and one retraction of an unfair accusation against a subagent. This was required before
|
|
94
|
+
merge and did not happen.
|
|
95
|
+
4. Clear the deferred minors if wanted — `grep -n "deferred" ` the ledger. All cosmetic or
|
|
96
|
+
coverage-shaped; none block anything.
|
|
97
|
+
5. Delete `.superpowers/sdd/2026-09-21-fenicsx-compat-implementation/` once 2 and 3 are done.
|
|
98
|
+
6. The real next phase, when the user asks for it: migrate `third-party/dolfinx-adjoint`,
|
|
99
|
+
`third-party/io4dolfinx` and `third-party/scifem` onto this package — separate branch per
|
|
100
|
+
repo. Note scifem's Python floor is `>=3.10` and would need raising to `>=3.12`.
|
|
101
|
+
|
|
102
|
+
## Suggested skills
|
|
103
|
+
|
|
104
|
+
Call these with the Skill tool:
|
|
105
|
+
|
|
106
|
+
- `superpowers:using-superpowers` — fires automatically at session start; let it.
|
|
107
|
+
- `superpowers:requesting-code-review` — for step 2, if the retroactive whole-branch review
|
|
108
|
+
goes ahead.
|
|
109
|
+
- `superpowers:brainstorming` — **before** any sibling-repo migration work (step 6). That is
|
|
110
|
+
new design, not execution of the existing plan.
|
|
111
|
+
- `superpowers:writing-plans` — after brainstorming, to produce the per-repo migration plan.
|
|
112
|
+
- `superpowers:subagent-driven-development` — to execute that plan. It is what built this
|
|
113
|
+
package; the ledger format above is its output.
|
|
114
|
+
- `superpowers:systematic-debugging` — if more CI-leg failures come in. Every one so far was
|
|
115
|
+
a test asserting against something unverified while the compat code was correct; resist
|
|
116
|
+
the urge to "fix" the implementation first.
|
|
117
|
+
- `superpowers:verification-before-completion` — before telling the user anything passes.
|
|
118
|
+
|
|
119
|
+
## No secrets
|
|
120
|
+
|
|
121
|
+
Nothing sensitive appears in this document. The repo contains no credentials; the only
|
|
122
|
+
personal data is the authorship in `LICENSE` and `pyproject.toml`, which is published by
|
|
123
|
+
design (Simula Research Laboratory, Henrik N.T. Finsberg, Jørgen S. Dokken).
|