diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0fff428f43..436cf97be1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -59,7 +59,7 @@ jobs: cd .. # Linting should ignore unquoted shell variable $COMPLEX # shellcheck disable=SC2086 - ./firedrake/scripts/firedrake-install \ + ./firedrake/firedrake/scripts/firedrake-install \ $COMPLEX \ --honour-petsc-dir \ --mpicc="$MPICH_DIR"/mpicc \ @@ -96,7 +96,7 @@ jobs: . ../firedrake_venv/bin/activate echo OMP_NUM_THREADS is "$OMP_NUM_THREADS" echo OPENBLAS_NUM_THREADS is "$OPENBLAS_NUM_THREADS" - python -m pytest -v tests/test_0init.py + python -m pytest -v tests/firedrake/test_0init.py python -m pytest \ --durations=200 \ --timeout=1800 \ @@ -104,7 +104,7 @@ jobs: -o faulthandler_timeout=1860 \ -n 12 --dist worksteal \ --junit-xml=firedrake.xml \ - -sv tests + -sv tests/firedrake timeout-minutes: 120 - name: Publish Test Report uses: mikepenz/action-junit-report@v5.0.0-a02 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 9c089aea84..0000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,123 +0,0 @@ -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/ghaction-github-pages@v2.2.0 - with: - build_dir: PyOP2/doc/sphinx/build/html - jekyll: false - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pip.yml b/.github/workflows/pip.yml new file mode 100644 index 0000000000..c358b70141 --- /dev/null +++ b/.github/workflows/pip.yml @@ -0,0 +1,129 @@ +name: Pip install Firedrake + +on: + # Push to master or PR + push: + branches: + - master + pull_request: + +concurrency: + # Cancels jobs running if new commits are pushed + group: > + ${{ github.workflow }}- + ${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + build: + name: "Build Firedrake using pip" + runs-on: ubuntu-latest + container: + image: firedrakeproject/firedrake-env:latest + options: --user root + defaults: + run: + shell: bash + working-directory: /home/firedrake + strategy: + # Don't immediately kill real if complex fails and vice versa. + fail-fast: false + matrix: + include: + - scalar-type: real + petsc_arch: default + - scalar-type: complex + petsc_arch: complex + env: + # PETSC_DIR, HDF5_DIR and MPICH_DIR are set inside the docker image + FIREDRAKE_CI_TESTS: 1 + PYOP2_CI_TESTS: 1 + PETSC_ARCH: ${{ matrix.petsc_arch }} + OMP_NUM_THREADS: 1 + OPENBLAS_NUM_THREADS: 1 + RDMAV_FORK_SAFE: 1 + steps: + - name: Cleanup + if: ${{ always() }} + run: rm -rf pip_venv + + - name: Create a venv + run: | + python3 -m venv pip_venv + ln -s /__w/firedrake/firedrake/src pip_venv/ + + - uses: actions/checkout@v4 + with: + path: src/firedrake + + - name: Install libsupermesh + run: | + source pip_venv/bin/activate + python -m pip install 'rtree>=1.2' + cd pip_venv/src + git clone https://github.com/firedrakeproject/libsupermesh.git + mkdir -p libsupermesh/build + cd libsupermesh/build + cmake .. \ + -DBUILD_SHARED_LIBS=ON \ + -DCMAKE_INSTALL_PREFIX="$VIRTUAL_ENV" \ + -DMPI_C_COMPILER="$MPICH_DIR/mpicc" \ + -DMPI_CXX_COMPILER="$MPICH_DIR/mpicxx" \ + -DMPI_Fortran_COMPILER="$MPICH_DIR/mpif90" \ + -DCMAKE_Fortran_COMPILER="$MPICH_DIR/mpif90" \ + -DMPIEXEC_EXECUTABLE="$MPICH_DIR/mpiexec" + make + make install + + - name: Pip install + run: | + source pip_venv/bin/activate + cd pip_venv/src + export CC="$MPICH_DIR/mpicc" + export CXX="$MPICH_DIR/mpicxx" + export MPICC="$MPICH_DIR/mpicc" + export MPI_HOME="$PETSC_DIR/packages" + pip install \ + --log=firedrake-install.log \ + --no-binary mpi4py,h5py \ + -v -e './firedrake[test]' + + - name: Add mpiexec to the venv and install timeout + run: | + source pip_venv/bin/activate + cat << EOF > "$VIRTUAL_ENV/bin/mpiexec" + #!/bin/bash + "$MPICH_DIR"/mpiexec "\$@" + EOF + chmod +x "$VIRTUAL_ENV"/bin/mpiexec + pip install -U pytest-timeout + + - name: Run Firedrake smoke tests + run: | + source pip_venv/bin/activate + cd pip_venv/src/firedrake + pytest -v tests/firedrake/test_0init.py + pytest \ + --durations=200 \ + --timeout=1800 \ + --timeout-method=thread \ + -o faulthandler_timeout=1860 \ + -n 12 --dist worksteal \ + --junit-xml=firedrake.xml \ + -sv tests/firedrake/regression -k "poisson_strong or stokes_mini or dg_advection" + timeout-minutes: 120 + + - name: Publish Test Report + uses: mikepenz/action-junit-report@v5.0.0-a02 + if: ${{ always() && ( github.ref != 'refs/heads/master') }} + with: + report_paths: '/home/firedrake/pip_venv/src/firedrake/firedrake.xml' + comment: true + check_name: "Firedrake ${{ matrix.scalar-type }}" + updateComment: true + flaky_summary: true + + - name: Cleanup + # Belt and braces: clean up before and after the run. + if: ${{ always() }} + run: rm -rf pip_venv diff --git a/.github/workflows/pyop2.yml b/.github/workflows/pyop2.yml new file mode 100644 index 0000000000..36065accf1 --- /dev/null +++ b/.github/workflows/pyop2.yml @@ -0,0 +1,119 @@ +name: PyOP2 + +# 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.10', '3.11', '3.12', '3.13'] + env: + CC: mpicc + PETSC_DIR: ${{ github.workspace }}/petsc + PETSC_ARCH: default + 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 libhwloc-dev libfabric-dev + + - name: Set correct Python version + uses: actions/setup-python@v5 + id: setup-python + with: + python-version: ${{ matrix.python-version }} + # By default setup-python pollutes the environment in such a way that virtual + # environments cannot be used. This prevents us from building libsupermesh because + # it relies on having rtree installed into a venv. + # https://github.com/actions/setup-python/issues/851 + # https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#using-update-environment-flag + update-environment: false + + - name: Create virtual environment + shell: bash + run: | + ${{ steps.setup-python.outputs.python-path }} -m venv venv + + - name: Clone PETSc + uses: actions/checkout@v4 + with: + repository: firedrakeproject/petsc + path: ${{ env.PETSC_DIR }} + + - name: Build and install PETSc + shell: bash + working-directory: ${{ env.PETSC_DIR }} + run: | + ./configure \ + --download-hdf5 \ + --with-debugging=1 \ + --with-shared-libraries=1 \ + --with-c2html=0 \ + --with-fortran-bindings=0 + make + + - name: Install libsupermesh + shell: bash + run: | + source venv/bin/activate + python -m pip install 'rtree>=1.2' + git clone https://github.com/firedrakeproject/libsupermesh.git + mkdir -p libsupermesh/build + cd libsupermesh/build + cmake .. \ + -DBUILD_SHARED_LIBS=ON \ + -DCMAKE_INSTALL_PREFIX="$VIRTUAL_ENV" \ + -DMPI_C_COMPILER=mpicc \ + -DMPI_CXX_COMPILER=mpicxx \ + -DMPI_Fortran_COMPILER=mpif90 \ + -DCMAKE_Fortran_COMPILER=mpif90 \ + -DMPIEXEC_EXECUTABLE=mpiexec + make + make install + + - name: Checkout PyOP2 + uses: actions/checkout@v4 + with: + path: PyOP2 + + - name: Install PyOP2 dependencies + shell: bash + working-directory: PyOP2 + run: | + source ../venv/bin/activate + python -m pip install -U pip + python -m pip install -U pytest-timeout + + - name: Install PyOP2 + shell: bash + working-directory: PyOP2 + run: | + source ../venv/bin/activate + python -m pip install -v ".[test]" + + - name: Run tests + shell: bash + working-directory: PyOP2 + run: | + source ../venv/bin/activate + # 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 tests/pyop2 + mpiexec -n 3 pytest -k "parallel[3]" --tb=native --timeout=480 --timeout-method=thread -o faulthandler_timeout=540 -v tests/pyop2 + timeout-minutes: 10 diff --git a/.github/workflows/zenodo-canary.yml b/.github/workflows/zenodo-canary.yml index 02005590bd..e95e8717aa 100644 --- a/.github/workflows/zenodo-canary.yml +++ b/.github/workflows/zenodo-canary.yml @@ -25,7 +25,7 @@ jobs: pip install requests packaging - name: Zenodo API canary run: | - python scripts/firedrake-install --test-doi-resolution + python firedrake/scripts/firedrake-install --test-doi-resolution - name: Upload log uses: actions/upload-artifact@v4 if: failure() diff --git a/AUTHORS b/AUTHORS deleted file mode 100644 index 49dac8204d..0000000000 --- a/AUTHORS +++ /dev/null @@ -1,24 +0,0 @@ -PyOP2 has received contributions from the following: - -Institutions ------------- - -Imperial College London -The University of Edinburgh - -Individuals ------------ - -Gheorghe-Teodor Bercea -Simon Funke -Ben Grabham -David A Ham -Nicolas Loriant -Fabio Luporini -Graham Markall -Lawrence Mitchell -Florian Rathgeber -Francis Russell -Kaho Sato -Reuben W. Nixon-Hill -Nacime Bouziani diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index a7b8b89c86..0000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,60 +0,0 @@ -# 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 diff --git a/Makefile b/Makefile index 1704d0ed70..7dbd1a84f7 100644 --- a/Makefile +++ b/Makefile @@ -13,12 +13,16 @@ else endif lint: - @echo " Linting firedrake codebase" + @echo " Linting firedrake" @python -m flake8 $(FLAKE8_FORMAT) firedrake - @echo " Linting firedrake test suite" - @python -m flake8 $(FLAKE8_FORMAT) tests @echo " Linting firedrake scripts" - @python -m flake8 $(FLAKE8_FORMAT) scripts --filename=* + @python -m flake8 $(FLAKE8_FORMAT) firedrake/scripts --filename=* + @echo " Linting firedrake tests" + @python -m flake8 $(FLAKE8_FORMAT) tests + @echo " Linting PyOP2" + @python -m flake8 $(FLAKE8_FORMAT) pyop2 + @echo " Linting PyOP2 scripts" + @python -m flake8 $(FLAKE8_FORMAT) pyop2/scripts --filename=* actionlint: @echo " Pull latest actionlint image" @@ -65,6 +69,10 @@ clean: -@rm -f firedrake/cython/mg/impl.so > /dev/null 2>&1 @echo " RM firedrake/cython/mg/impl.c" -@rm -f firedrake/cython/mg/impl.c > /dev/null 2>&1 + @echo " RM pyop2/*.so" + -@rm -f pyop2/*.so > /dev/null 2>&1 + @echo " RM tinyasm/*.so" + -@rm -f tinyasm/*.so > /dev/null 2>&1 THREADS=1 @@ -76,15 +84,15 @@ endif test_regression: modules @echo " Running non-extruded regression tests" - @python -m pytest tests/regression $(PYTEST_ARGS) + @python -m pytest tests/firedrake/regression $(PYTEST_ARGS) test_extrusion: modules @echo " Running extruded regression tests" - @python -m pytest tests/extrusion $(PYTEST_ARGS) + @python -m pytest tests/firedrake/extrusion $(PYTEST_ARGS) test_demos: modules @echo " Running test of demos" - @python -m pytest tests/demos $(PYTEST_ARGS) + @python -m pytest tests/firedrake/demos $(PYTEST_ARGS) test: modules @echo " Running all regression tests" @@ -94,74 +102,4 @@ alltest: modules lint test shorttest: modules lint @echo " Running short regression tests" - @python -m pytest --short tests $(PYTEST_ARGS) - -# PyOP2 Makefile -# PYTEST = py.test -# -# TEST_BASE_DIR = test -# -# UNIT_TEST_DIR = $(TEST_BASE_DIR)/unit -# -# SPHINX_DIR = doc/sphinx -# SPHINX_BUILD_DIR = $(SPHINX_DIR)/build -# SPHINX_TARGET = html -# SPHINX_TARGET_DIR = $(SPHINX_BUILD_DIR)/$(SPHINX_TARGET) -# SPHINXOPTS = -a -# -# PORT = 8000 -# -# MESHES_DIR = demo/meshes -# -# GIT_REV = $(shell git rev-parse --verify --short HEAD) -# -# all: ext -# -# .PHONY : help test lint unit doc update_docs ext ext_clean meshes -# -# help: -# @echo "make COMMAND with COMMAND one of:" -# @echo " test : run lint and unit tests" -# @echo " lint : run flake8 code linter" -# @echo " unit : run unit tests" -# @echo " unit_BACKEND : run unit tests for BACKEND" -# @echo " doc : build sphinx documentation" -# @echo " serve : launch local web server to serve up documentation" -# @echo " update_docs : build sphinx documentation and push to GitHub" -# @echo " ext : rebuild Cython extension" -# @echo " ext_clean : delete generated extension" -# @echo " meshes : download demo meshes" -# @echo -# @echo "Available OpenCL contexts: $(OPENCL_CTXS)" -# -# test: lint unit -# -# lint: -# @flake8 -# -# unit: -# cd $(TEST_BASE_DIR); $(PYTEST) unit -# -# doc: -# make -C $(SPHINX_DIR) $(SPHINX_TARGET) SPHINXOPTS=$(SPHINXOPTS) -# -# serve: -# make -C $(SPHINX_DIR) livehtml -# -# update_docs: -# if [ ! -d $(SPHINX_TARGET_DIR)/.git ]; then \ -# mkdir -p $(SPHINX_BUILD_DIR); \ -# cd $(SPHINX_BUILD_DIR); git clone `git config --get remote.origin.url` $(SPHINX_TARGET); \ -# fi -# cd $(SPHINX_TARGET_DIR); git fetch -p; git checkout -f gh-pages; git reset --hard origin/gh-pages -# make -C $(SPHINX_DIR) $(SPHINX_TARGET) SPHINXOPTS=$(SPHINXOPTS) -# cd $(SPHINX_TARGET_DIR); git add .; git commit -am "Update documentation to revision $(GIT_REV)"; git push origin gh-pages -# -# ext: ext_clean -# python setup.py build_ext -i -# -# ext_clean: -# rm -rf build pyop2/compute_ind.c pyop2/compute_ind.so pyop2/sparsity.c pyop2/sparsity.so -# -# meshes: -# make -C $(MESHES_DIR) meshes + @python -m pytest --short tests/firedrake $(PYTEST_ARGS) diff --git a/demos/saddle_point_pc/saddle_point_systems.py.rst b/demos/saddle_point_pc/saddle_point_systems.py.rst index 60d7133ebd..9c8325c5fd 100644 --- a/demos/saddle_point_pc/saddle_point_systems.py.rst +++ b/demos/saddle_point_pc/saddle_point_systems.py.rst @@ -613,6 +613,5 @@ A runnable python script version of this demo is available :demo:`here .. _PETSc: https://petsc.org/ .. _hypre: https://hypre.readthedocs.io/en/latest/ -.. _PyOP2: https://github.com/OP2/PyOP2/ .. _numpy: https://www.numpy.org .. _MUMPS: https://mumps-solver.org/index.php diff --git a/doc/sphinx/source/installation.rst b/doc/sphinx/source/installation.rst deleted file mode 120000 index 428f3fb0da..0000000000 --- a/doc/sphinx/source/installation.rst +++ /dev/null @@ -1 +0,0 @@ -../../../README.rst \ No newline at end of file diff --git a/docs/Makefile b/docs/Makefile index b5a682d1bf..55a8611c57 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -49,9 +49,9 @@ publishpdf: env FIREDRAKE_MANUAL_RELEASE=`date +%Y-%m` $(MAKE) latexpdf validate-bibtex: - ../scripts/firedrake-preprocess-bibtex --validate source/_static/bibliography.bib - ../scripts/firedrake-preprocess-bibtex --validate source/_static/firedrake-apps.bib - ../scripts/firedrake-preprocess-bibtex --validate source/_static/references.bib + ../firedrake/scripts/firedrake_preprocess_bibtex.py --validate source/_static/bibliography.bib + ../firedrake/scripts/firedrake_preprocess_bibtex.py --validate source/_static/firedrake-apps.bib + ../firedrake/scripts/firedrake_preprocess_bibtex.py --validate source/_static/references.bib livehtml: sphinx-autobuild -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html diff --git a/docs/source/conf.py b/docs/source/conf.py index e47118391f..bcf7580176 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -101,7 +101,7 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. -exclude_patterns = [] +exclude_patterns = ['old_pyop2'] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None diff --git a/docs/source/documentation.rst b/docs/source/documentation.rst index 34a43da723..277770b435 100644 --- a/docs/source/documentation.rst +++ b/docs/source/documentation.rst @@ -19,7 +19,6 @@ * `Firedrake on GitHub `__ * `TSFC on GitHub `__ - * `PyOP2 on GitHub `__ * `FIAT on GitHub `__ * `Firedrake version of UFL on GitHub `__ diff --git a/docs/source/download.rst b/docs/source/download.rst index fc1c11f9d9..f44e917a87 100644 --- a/docs/source/download.rst +++ b/docs/source/download.rst @@ -61,7 +61,7 @@ that Firedrake is fully functional. Activate the venv_ as above and then run:: cd $VIRTUAL_ENV/src/firedrake - pytest tests/regression/ -k "poisson_strong or stokes_mini or dg_advection" + pytest tests/firedrake/regression/ -k "poisson_strong or stokes_mini or dg_advection" This command will run a few of the unit tests, which exercise a good chunk of the functionality of the library. These tests should take a @@ -104,10 +104,12 @@ gives a full list of update options. For instance additional Firedrake packages can be installed into an existing Firedrake installation using ``firedrake-update``. +.. _system-requirements: + System requirements ------------------- -Firedrake requires Python 3.9 to 3.13. The installation script is +Firedrake requires Python 3.10 to 3.13. The installation script is tested by CI on Ubuntu 24.04 LTS. On Ubuntu 22.04 or later, the system installed Python 3 is supported. On MacOS, the homebrew_ installed Python 3 is supported:: @@ -126,7 +128,7 @@ they have the system dependencies: * A Fortran compiler (for PETSc) * Blas and Lapack * Git, Mercurial -* Python version 3.9-3.13 +* Python version 3.10-3.13 * The Python headers * autoconf, automake, libtool * CMake @@ -227,6 +229,50 @@ type:: You should now be able to run ``firedrake-update``. +Installing Firedrake with pip (experimental, Linux only) +-------------------------------------------------------- + +Firedrake is working towards having support for binary installs. As such there is experimental support for installing Firedrake using ``pip``, avoiding the need for a ``firedrake-install`` script. At present only Linux is tested using this install method. + +Requirements +~~~~~~~~~~~~ + +* All the system requirements listed in :ref:`system-requirements`. +* A Firedrake-compatible PETSc installation (using our `fork of PETSc `_). The set of flags passed to PETSc can be retrieved by passing the command ``--show-petsc-configure-options`` to ``firedrake-install``. +* `libsupermesh `_ to be installed. +* The following environment variables to be set: + + * ``PETSC_DIR`` and ``PETSC_ARCH`` to point to the correct location for the PETSc installation. + * ``HDF5_DIR`` to ``$PETSC_DIR/$PETSC_ARCH``. + * ``CC`` and ``MPICC`` to point to the ``mpicc`` compiler wrapper. + * ``CXX`` to point to the ``mpicxx`` compiler wrapper. + +Installation +~~~~~~~~~~~~ + +Having set up this environment, Firedrake can now be installed with the command:: + + pip install --no-binary mpi4py,h5py git+https://github.com/firedrakeproject/firedrake.git + +We recommend installing Firedrake in a Python virtual environment (venv). + +Removing Firedrake +------------------ +Firedrake and its dependencies can be removed by deleting the Firedrake +install directory. This is usually the ``firedrake`` subdirectory +created after having run ``firedrake-install``. Note that this will not +undo the installation of any system packages which are Firedrake +dependencies: removing these might affect subsequently installed +packages for which these are also dependencies. + +.. _Paraview: http://www.paraview.org +.. _venv: https://docs.python.org/3/tutorial/venv.html +.. _homebrew: https://brew.sh/ +.. _PETSc: https://www.mcs.anl.gov/petsc/ +.. _discussions: https://github.com/firedrakeproject/firedrake/discussions +.. _issue: https://github.com/firedrakeproject/firedrake/issues +.. _WSL: https://github.com/firedrakeproject/firedrake/wiki/Installing-on-Windows-Subsystem-for-Linux + Visualisation software ---------------------- @@ -254,20 +300,3 @@ and can be built by executing:: This will generate the HTML documentation (this website) on your local machine. - -Removing Firedrake ------------------- -Firedrake and its dependencies can be removed by deleting the Firedrake -install directory. This is usually the ``firedrake`` subdirectory -created after having run ``firedrake-install``. Note that this will not -undo the installation of any system packages which are Firedrake -dependencies: removing these might affect subsequently installed -packages for which these are also dependencies. - -.. _Paraview: http://www.paraview.org -.. _venv: https://docs.python.org/3/tutorial/venv.html -.. _homebrew: https://brew.sh/ -.. _PETSc: https://www.mcs.anl.gov/petsc/ -.. _discussions: https://github.com/firedrakeproject/firedrake/discussions -.. _issue: https://github.com/firedrakeproject/firedrake/issues -.. _WSL: https://github.com/firedrakeproject/firedrake/wiki/Installing-on-Windows-Subsystem-for-Linux diff --git a/docs/source/install-debug.dot b/docs/source/install-debug.dot index ec324c6c78..c11f85ef4c 100644 --- a/docs/source/install-debug.dot +++ b/docs/source/install-debug.dot @@ -8,7 +8,7 @@ digraph triage { venv_activated [label="venv activated?"]; install_script_up_to_date [label="Install script\nup to date?"]; using_anaconda [label="Using\nAnaconda?"]; - python_version [label="Python <3.9?"]; + python_version [label="Python <3.10?"]; using_macos [label="Using\nMacOS?"]; using_homebrew [label="Using\nHomebrew?"]; url_error [label="URL Error with SSL\ncertificate failure?"]; @@ -16,7 +16,7 @@ digraph triage { activate_venv [label="Activate the\nvenv first."]; uninstall_anaconda [label="Deactivate\nAnaconda."]; - update_python [label="Get Python 3.9-3.13"]; + update_python [label="Get Python 3.10-3.13"]; update_install_script [label="Fetch new\ninstall script"]; get_homebrew [label="Use Homebrew."]; brew_doctor [label="brew doctor"]; diff --git a/docs/source/interpolation.rst b/docs/source/interpolation.rst index c1629995bc..e604a1fbf9 100644 --- a/docs/source/interpolation.rst +++ b/docs/source/interpolation.rst @@ -25,18 +25,18 @@ where :math:`\bar{\phi}^*_i` is the :math:`i`-th dual basis function to The extension of dual basis functions to :math:`e` usually follows from the definition of the dual basis. For example, point evaluation and integral nodes can naturally be extended to any expression which is evaluatable at - the relevant points, or integrable over that domain. - + the relevant points, or integrable over that domain. + Firedrake will not impose any constraints on the expression to be interpolated beyond that its value shape matches that of the space into which it is interpolated. If the user interpolates an expression for which the nodes are not well defined (for example point evaluation at a - discontinuity), the result is implementation-dependent. + discontinuity), the result is implementation-dependent. The interpolate operator ------------------------ -.. note:: +.. note:: The semantics for interpolation in Firedrake are in the course of changing. The documentation provided here is for the new behaviour, in which the `interpolate` operator is symbolic. In order to access the behaviour @@ -50,7 +50,7 @@ The interpolate operator The basic syntax for interpolation is: -.. literalinclude:: ../../tests/regression/test_interpolation_manual.py +.. literalinclude:: ../../tests/firedrake/regression/test_interpolation_manual.py :language: python3 :dedent: :start-after: [test_interpolate_operator 1] @@ -59,7 +59,7 @@ The basic syntax for interpolation is: It is also possible to interpolate an expression directly into an existing :py:class:`~.Function`: -.. literalinclude:: ../../tests/regression/test_interpolation_manual.py +.. literalinclude:: ../../tests/firedrake/regression/test_interpolation_manual.py :language: python3 :dedent: :start-after: [test_interpolate_operator 3] @@ -67,7 +67,7 @@ It is also possible to interpolate an expression directly into an existing This is a numerical operation, equivalent to: -.. literalinclude:: ../../tests/regression/test_interpolation_manual.py +.. literalinclude:: ../../tests/firedrake/regression/test_interpolation_manual.py :language: python3 :dedent: :start-after: [test_interpolate_operator 5] @@ -93,7 +93,7 @@ including: Here is an example demonstrating some of these features: -.. literalinclude:: ../../tests/regression/test_interpolation_manual.py +.. literalinclude:: ../../tests/firedrake/regression/test_interpolation_manual.py :language: python3 :dedent: :start-after: [test_interpolate_operator 7] @@ -102,7 +102,7 @@ Here is an example demonstrating some of these features: This also works as expected when interpolating into a a space defined on the facets of the mesh: -.. literalinclude:: ../../tests/regression/test_interpolation_manual.py +.. literalinclude:: ../../tests/firedrake/regression/test_interpolation_manual.py :language: python3 :dedent: :start-after: [test_interpolate_operator 9] @@ -155,13 +155,13 @@ surface or line of interest in the domain. The integral itself is calculated by calling :py:func:`~.assemble` on an approriate form over the target mesh function space: -.. literalinclude:: ../../tests/regression/test_interpolation_manual.py +.. literalinclude:: ../../tests/firedrake/regression/test_interpolation_manual.py :language: python3 :dedent: :start-after: [test_line_integral 1] :end-before: [test_line_integral 2] -.. literalinclude:: ../../tests/regression/test_interpolation_manual.py +.. literalinclude:: ../../tests/firedrake/regression/test_interpolation_manual.py :language: python3 :dedent: :start-after: [test_line_integral 3] @@ -181,13 +181,13 @@ Interpolating onto other meshes If the target mesh extends outside the source mesh domain, then cross-mesh interpolation will raise a :py:class:`~.DofNotDefinedError`. -.. literalinclude:: ../../tests/regression/test_interpolation_manual.py +.. literalinclude:: ../../tests/firedrake/regression/test_interpolation_manual.py :language: python3 :dedent: :start-after: [test_cross_mesh 1] :end-before: [test_cross_mesh 2] -.. literalinclude:: ../../tests/regression/test_interpolation_manual.py +.. literalinclude:: ../../tests/firedrake/regression/test_interpolation_manual.py :language: python3 :dedent: :start-after: [test_cross_mesh 3] @@ -196,13 +196,13 @@ interpolation will raise a :py:class:`~.DofNotDefinedError`. This can be overriden with the optional ``allow_missing_dofs`` keyword argument: -.. literalinclude:: ../../tests/regression/test_interpolation_manual.py +.. literalinclude:: ../../tests/firedrake/regression/test_interpolation_manual.py :language: python3 :dedent: :start-after: [test_cross_mesh 5] :end-before: [test_cross_mesh 6] -.. literalinclude:: ../../tests/regression/test_interpolation_manual.py +.. literalinclude:: ../../tests/firedrake/regression/test_interpolation_manual.py :language: python3 :dedent: :start-after: [test_cross_mesh 7] @@ -211,7 +211,7 @@ argument: In this case, the missing degrees of freedom (DoFs, the global basis function coefficients which could not be set) are, by default, set to zero: -.. literalinclude:: ../../tests/regression/test_interpolation_manual.py +.. literalinclude:: ../../tests/firedrake/regression/test_interpolation_manual.py :language: python3 :dedent: :start-after: [test_cross_mesh 9] @@ -223,7 +223,7 @@ unmodified. We can optionally specify a value to use for our missing DoFs. Here we set them to be ``nan`` ('not a number') for easy identification: -.. literalinclude:: ../../tests/regression/test_interpolation_manual.py +.. literalinclude:: ../../tests/firedrake/regression/test_interpolation_manual.py :language: python3 :dedent: :start-after: [test_cross_mesh 11] @@ -235,7 +235,7 @@ DoFs. When using :py:class:`~.Interpolator`\s, the ``allow_missing_dofs`` keyword argument is set at construction: -.. literalinclude:: ../../tests/regression/test_interpolation_manual.py +.. literalinclude:: ../../tests/firedrake/regression/test_interpolation_manual.py :language: python3 :dedent: :start-after: [test_cross_mesh 13] @@ -244,7 +244,7 @@ argument is set at construction: The ``default_missing_val`` keyword argument is then set whenever we call :py:meth:`~.Interpolator.interpolate`: -.. literalinclude:: ../../tests/regression/test_interpolation_manual.py +.. literalinclude:: ../../tests/firedrake/regression/test_interpolation_manual.py :language: python3 :dedent: :start-after: [test_cross_mesh 15] @@ -254,19 +254,19 @@ If we supply an output :py:class:`~.Function` and don't set ``default_missing_val`` then any missing DoFs are left as they were prior to interpolation: -.. literalinclude:: ../../tests/regression/test_interpolation_manual.py +.. literalinclude:: ../../tests/firedrake/regression/test_interpolation_manual.py :language: python3 :dedent: :start-after: [test_cross_mesh 17] :end-before: [test_cross_mesh 18] -.. literalinclude:: ../../tests/regression/test_interpolation_manual.py +.. literalinclude:: ../../tests/firedrake/regression/test_interpolation_manual.py :language: python3 :dedent: :start-after: [test_cross_mesh 19] :end-before: [test_cross_mesh 20] -.. literalinclude:: ../../tests/regression/test_interpolation_manual.py +.. literalinclude:: ../../tests/firedrake/regression/test_interpolation_manual.py :language: python3 :dedent: :start-after: [test_cross_mesh 21] @@ -294,7 +294,7 @@ now. In this case, interpolation into a target function space ``V`` proceeds as follows: -.. literalinclude:: ../../tests/regression/test_interpolation_manual.py +.. literalinclude:: ../../tests/firedrake/regression/test_interpolation_manual.py :language: python3 :dedent: :start-after: [test_interpolate_external 1] diff --git a/doc/Makefile b/docs/source/old_pyop2/Makefile similarity index 100% rename from doc/Makefile rename to docs/source/old_pyop2/Makefile diff --git a/doc/pyop2.tex b/docs/source/old_pyop2/pyop2.tex similarity index 100% rename from doc/pyop2.tex rename to docs/source/old_pyop2/pyop2.tex diff --git a/doc/sphinx/Makefile b/docs/source/old_pyop2/sphinx/Makefile similarity index 100% rename from doc/sphinx/Makefile rename to docs/source/old_pyop2/sphinx/Makefile diff --git a/doc/sphinx/source/architecture.rst b/docs/source/old_pyop2/sphinx/source/architecture.rst similarity index 100% rename from doc/sphinx/source/architecture.rst rename to docs/source/old_pyop2/sphinx/source/architecture.rst diff --git a/doc/sphinx/source/backends.rst b/docs/source/old_pyop2/sphinx/source/backends.rst similarity index 100% rename from doc/sphinx/source/backends.rst rename to docs/source/old_pyop2/sphinx/source/backends.rst diff --git a/doc/sphinx/source/caching.rst b/docs/source/old_pyop2/sphinx/source/caching.rst similarity index 100% rename from doc/sphinx/source/caching.rst rename to docs/source/old_pyop2/sphinx/source/caching.rst diff --git a/doc/sphinx/source/concepts.rst b/docs/source/old_pyop2/sphinx/source/concepts.rst similarity index 100% rename from doc/sphinx/source/concepts.rst rename to docs/source/old_pyop2/sphinx/source/concepts.rst diff --git a/doc/sphinx/source/conf.py b/docs/source/old_pyop2/sphinx/source/conf.py similarity index 100% rename from doc/sphinx/source/conf.py rename to docs/source/old_pyop2/sphinx/source/conf.py diff --git a/doc/sphinx/source/images/assembly.svg b/docs/source/old_pyop2/sphinx/source/images/assembly.svg similarity index 100% rename from doc/sphinx/source/images/assembly.svg rename to docs/source/old_pyop2/sphinx/source/images/assembly.svg diff --git a/doc/sphinx/source/images/csr.svg b/docs/source/old_pyop2/sphinx/source/images/csr.svg similarity index 100% rename from doc/sphinx/source/images/csr.svg rename to docs/source/old_pyop2/sphinx/source/images/csr.svg diff --git a/doc/sphinx/source/images/direct_arg.svg b/docs/source/old_pyop2/sphinx/source/images/direct_arg.svg similarity index 100% rename from doc/sphinx/source/images/direct_arg.svg rename to docs/source/old_pyop2/sphinx/source/images/direct_arg.svg diff --git a/doc/sphinx/source/images/indirect_arg.svg b/docs/source/old_pyop2/sphinx/source/images/indirect_arg.svg similarity index 100% rename from doc/sphinx/source/images/indirect_arg.svg rename to docs/source/old_pyop2/sphinx/source/images/indirect_arg.svg diff --git a/doc/sphinx/source/images/indirect_arg_flattened.svg b/docs/source/old_pyop2/sphinx/source/images/indirect_arg_flattened.svg similarity index 100% rename from doc/sphinx/source/images/indirect_arg_flattened.svg rename to docs/source/old_pyop2/sphinx/source/images/indirect_arg_flattened.svg diff --git a/doc/sphinx/source/images/iteration_spaces.svg b/docs/source/old_pyop2/sphinx/source/images/iteration_spaces.svg similarity index 100% rename from doc/sphinx/source/images/iteration_spaces.svg rename to docs/source/old_pyop2/sphinx/source/images/iteration_spaces.svg diff --git a/doc/sphinx/source/images/mixed_assembly.svg b/docs/source/old_pyop2/sphinx/source/images/mixed_assembly.svg similarity index 100% rename from doc/sphinx/source/images/mixed_assembly.svg rename to docs/source/old_pyop2/sphinx/source/images/mixed_assembly.svg diff --git a/doc/sphinx/source/images/mixed_sparsity.svg b/docs/source/old_pyop2/sphinx/source/images/mixed_sparsity.svg similarity index 100% rename from doc/sphinx/source/images/mixed_sparsity.svg rename to docs/source/old_pyop2/sphinx/source/images/mixed_sparsity.svg diff --git a/doc/sphinx/source/images/mixed_sparsity2.svg b/docs/source/old_pyop2/sphinx/source/images/mixed_sparsity2.svg similarity index 100% rename from doc/sphinx/source/images/mixed_sparsity2.svg rename to docs/source/old_pyop2/sphinx/source/images/mixed_sparsity2.svg diff --git a/doc/sphinx/source/images/mpi_matrix.svg b/docs/source/old_pyop2/sphinx/source/images/mpi_matrix.svg similarity index 100% rename from doc/sphinx/source/images/mpi_matrix.svg rename to docs/source/old_pyop2/sphinx/source/images/mpi_matrix.svg diff --git a/doc/sphinx/source/images/pyop2_architecture.svg b/docs/source/old_pyop2/sphinx/source/images/pyop2_architecture.svg similarity index 100% rename from doc/sphinx/source/images/pyop2_architecture.svg rename to docs/source/old_pyop2/sphinx/source/images/pyop2_architecture.svg diff --git a/doc/sphinx/source/images/pyop2_colouring.svg b/docs/source/old_pyop2/sphinx/source/images/pyop2_colouring.svg similarity index 100% rename from doc/sphinx/source/images/pyop2_colouring.svg rename to docs/source/old_pyop2/sphinx/source/images/pyop2_colouring.svg diff --git a/doc/sphinx/source/images/pyop2_device_data_state.svg b/docs/source/old_pyop2/sphinx/source/images/pyop2_device_data_state.svg similarity index 100% rename from doc/sphinx/source/images/pyop2_device_data_state.svg rename to docs/source/old_pyop2/sphinx/source/images/pyop2_device_data_state.svg diff --git a/doc/sphinx/source/images/pyop2_mpi_mesh.svg b/docs/source/old_pyop2/sphinx/source/images/pyop2_mpi_mesh.svg similarity index 100% rename from doc/sphinx/source/images/pyop2_mpi_mesh.svg rename to docs/source/old_pyop2/sphinx/source/images/pyop2_mpi_mesh.svg diff --git a/doc/sphinx/source/index.rst b/docs/source/old_pyop2/sphinx/source/index.rst similarity index 100% rename from doc/sphinx/source/index.rst rename to docs/source/old_pyop2/sphinx/source/index.rst diff --git a/doc/sphinx/source/ir.rst b/docs/source/old_pyop2/sphinx/source/ir.rst similarity index 100% rename from doc/sphinx/source/ir.rst rename to docs/source/old_pyop2/sphinx/source/ir.rst diff --git a/doc/sphinx/source/kernels.rst b/docs/source/old_pyop2/sphinx/source/kernels.rst similarity index 100% rename from doc/sphinx/source/kernels.rst rename to docs/source/old_pyop2/sphinx/source/kernels.rst diff --git a/doc/sphinx/source/linear_algebra.rst b/docs/source/old_pyop2/sphinx/source/linear_algebra.rst similarity index 100% rename from doc/sphinx/source/linear_algebra.rst rename to docs/source/old_pyop2/sphinx/source/linear_algebra.rst diff --git a/doc/sphinx/source/mixed.rst b/docs/source/old_pyop2/sphinx/source/mixed.rst similarity index 100% rename from doc/sphinx/source/mixed.rst rename to docs/source/old_pyop2/sphinx/source/mixed.rst diff --git a/doc/sphinx/source/mpi.rst b/docs/source/old_pyop2/sphinx/source/mpi.rst similarity index 100% rename from doc/sphinx/source/mpi.rst rename to docs/source/old_pyop2/sphinx/source/mpi.rst diff --git a/doc/sphinx/source/plan.rst b/docs/source/old_pyop2/sphinx/source/plan.rst similarity index 100% rename from doc/sphinx/source/plan.rst rename to docs/source/old_pyop2/sphinx/source/plan.rst diff --git a/doc/sphinx/source/profiling.rst b/docs/source/old_pyop2/sphinx/source/profiling.rst similarity index 100% rename from doc/sphinx/source/profiling.rst rename to docs/source/old_pyop2/sphinx/source/profiling.rst diff --git a/doc/sphinx/source/user.rst b/docs/source/old_pyop2/sphinx/source/user.rst similarity index 100% rename from doc/sphinx/source/user.rst rename to docs/source/old_pyop2/sphinx/source/user.rst diff --git a/docs/source/point-evaluation.rst b/docs/source/point-evaluation.rst index b14b459c69..0da44f8396 100644 --- a/docs/source/point-evaluation.rst +++ b/docs/source/point-evaluation.rst @@ -128,7 +128,7 @@ evaluation of a function :math:`f` defined in a function space :math:`V` on the parent mesh by interpolating into the P0DG space on the :func:`~.VertexOnlyMesh`. For example: -.. literalinclude:: ../../tests/vertexonly/test_vertex_only_manual.py +.. literalinclude:: ../../tests/firedrake/vertexonly/test_vertex_only_manual.py :language: python3 :dedent: :start-after: [test_vertex_only_mesh_manual_example 1] @@ -223,19 +223,19 @@ tolerance ` will generate a :class:`~.VertexOnlyMeshMissingPointsError`. This can be switched to a warning or switched off entirely: -.. literalinclude:: ../../tests/vertexonly/test_vertex_only_manual.py +.. literalinclude:: ../../tests/firedrake/vertexonly/test_vertex_only_manual.py :language: python3 :dedent: :start-after: [test_vom_manual_points_outside_domain 1] :end-before: [test_vom_manual_points_outside_domain 2] -.. literalinclude:: ../../tests/vertexonly/test_vertex_only_manual.py +.. literalinclude:: ../../tests/firedrake/vertexonly/test_vertex_only_manual.py :language: python3 :dedent: :start-after: [test_vom_manual_points_outside_domain 3] :end-before: [test_vom_manual_points_outside_domain 4] -.. literalinclude:: ../../tests/vertexonly/test_vertex_only_manual.py +.. literalinclude:: ../../tests/firedrake/vertexonly/test_vertex_only_manual.py :language: python3 :dedent: :start-after: [test_vom_manual_points_outside_domain 5] @@ -265,7 +265,7 @@ where :math:`N` is the number of points, :math:`x_i` is the :math:`i`\th point, :math:`\delta` is a dirac delta distribition can therefore be written in Firedrake using :func:`~.VertexOnlyMesh` and :func:`~.interpolate` as -.. literalinclude:: ../../tests/vertexonly/test_vertex_only_manual.py +.. literalinclude:: ../../tests/firedrake/vertexonly/test_vertex_only_manual.py :language: python3 :dedent: :start-after: [test_vom_manual_keyword_arguments 1] @@ -288,7 +288,7 @@ property: this produces another vertex-only mesh which has points in the order and MPI rank that they were specified when first creating the original vertex-only mesh. For example: -.. literalinclude:: ../../tests/vertexonly/test_vertex_only_manual.py +.. literalinclude:: ../../tests/firedrake/vertexonly/test_vertex_only_manual.py :language: python3 :dedent: :start-after: [test_input_ordering_input 1] @@ -301,7 +301,7 @@ of a vertex-only mesh in a parallel-safe way. If we return to our example from :ref:`the section where we introduced vertex only meshes `, we had -.. literalinclude:: ../../tests/vertexonly/test_vertex_only_manual.py +.. literalinclude:: ../../tests/firedrake/vertexonly/test_vertex_only_manual.py :language: python3 :dedent: :start-after: [test_vertex_only_mesh_manual_example 2] @@ -312,7 +312,7 @@ In parallel, this will print the values of ``f`` at the given ``points`` list values of ``f`` at the ``points`` list **before the points have been distributed** we can use :py:attr:`~.VertexOnlyMeshTopology.input_ordering` as follows: -.. literalinclude:: ../../tests/vertexonly/test_vertex_only_manual.py +.. literalinclude:: ../../tests/firedrake/vertexonly/test_vertex_only_manual.py :language: python3 :dedent: :start-after: [test_vertex_only_mesh_manual_example 4] @@ -336,7 +336,7 @@ the original vertex-only mesh. In the above example, the values would be zero at those points. To make it more obvious that those points were not found, it's a good idea to set the values to ``nan`` before the interpolation: -.. literalinclude:: ../../tests/vertexonly/test_vertex_only_manual.py +.. literalinclude:: ../../tests/firedrake/vertexonly/test_vertex_only_manual.py :language: python3 :dedent: :start-after: [test_vertex_only_mesh_manual_example 6] @@ -379,7 +379,7 @@ If points are outside the mesh domain but ought to still be found a ``tolerance`` parameter can be set. The tolerance is relative to the size of the mesh cells and is a property of the mesh itself -.. literalinclude:: ../../tests/vertexonly/test_vertex_only_manual.py +.. literalinclude:: ../../tests/firedrake/vertexonly/test_vertex_only_manual.py :language: python3 :dedent: :start-after: [test_mesh_tolerance 1] @@ -397,7 +397,7 @@ vertex-only mesh. This will modify the tolerance property of the parent mesh. before any point evaluations are performed, rather than making use of these keyword arguments. -.. literalinclude:: ../../tests/vertexonly/test_vertex_only_manual.py +.. literalinclude:: ../../tests/firedrake/vertexonly/test_vertex_only_manual.py :language: python3 :dedent: :start-after: [test_mesh_tolerance_change 1] diff --git a/firedrake/__init__.py b/firedrake/__init__.py index 0fc9aeeed6..3c89e61429 100644 --- a/firedrake/__init__.py +++ b/firedrake/__init__.py @@ -1,22 +1,9 @@ -import firedrake_configuration import os import sys -config = firedrake_configuration.get_config() -if "PETSC_DIR" in os.environ and not config["options"]["honour_petsc_dir"]: - if os.environ["PETSC_DIR"] != os.path.join(sys.prefix, "src", "petsc")\ - or os.environ["PETSC_ARCH"] != "default": - raise ImportError("PETSC_DIR is set, but you did not install with --honour-petsc-dir.\n" - "Please unset PETSC_DIR (and PETSC_ARCH) before using Firedrake.") -elif "PETSC_DIR" not in os.environ and config["options"]["honour_petsc_dir"]: - raise ImportError("Firedrake was installed with --honour-petsc-dir, but PETSC_DIR is not set.\n" - "Please set PETSC_DIR (and PETSC_ARCH) before using Firedrake.") -elif not config["options"]["honour_petsc_dir"]: # Using our own PETSC. - os.environ["PETSC_DIR"] = os.path.join(sys.prefix, "src", "petsc") - os.environ["PETSC_ARCH"] = "default" -del config +from firedrake.configuration import setup_cache_dirs # Set up the cache directories before importing PyOP2. -firedrake_configuration.setup_cache_dirs() +setup_cache_dirs() # Ensure petsc is initialised by us before anything else gets in there. # diff --git a/firedrake/configuration.py b/firedrake/configuration.py new file mode 100644 index 0000000000..e0a0c41d93 --- /dev/null +++ b/firedrake/configuration.py @@ -0,0 +1,12 @@ +"""Replaces functionality from the removed `firedrake_configuration` module.""" + +import os +from pathlib import Path + + +def setup_cache_dirs(): + root = Path(os.environ.get("VIRTUAL_ENV", "~")).joinpath(".cache") + if "PYOP2_CACHE_DIR" not in os.environ: + os.environ["PYOP2_CACHE_DIR"] = str(root.joinpath("pyop2")) + if 'FIREDRAKE_TSFC_KERNEL_CACHE_DIR' not in os.environ: + os.environ["FIREDRAKE_TSFC_KERNEL_CACHE_DIR"] = str(root.joinpath("tsfc")) diff --git a/firedrake/cython/dmcommon.pyx b/firedrake/cython/dmcommon.pyx index c35ff4cbd5..de0c63986e 100644 --- a/firedrake/cython/dmcommon.pyx +++ b/firedrake/cython/dmcommon.pyx @@ -255,9 +255,9 @@ def count_labelled_points(PETSc.DM dm, name, @cython.boundscheck(False) @cython.wraparound(False) def facet_numbering(PETSc.DM plex, kind, - np.ndarray[PetscInt, ndim=1, mode="c"] facets, + np.ndarray facets, PETSc.Section cell_numbering, - np.ndarray[PetscInt, ndim=2, mode="c"] cell_closures): + np.ndarray cell_closures): """Compute the parent cell(s) and the local facet number within each parent cell for each given facet. @@ -271,8 +271,8 @@ def facet_numbering(PETSc.DM plex, kind, PetscInt f, fStart, fEnd, fi, cell PetscInt nfacets, nclosure, ncells, cells_per_facet const PetscInt *cells = NULL - np.ndarray[PetscInt, ndim=2, mode="c"] facet_cells - np.ndarray[PetscInt, ndim=2, mode="c"] facet_local_num + np.ndarray facet_cells + np.ndarray facet_local_num get_height_stratum(plex.dm, 1, &fStart, &fEnd) nfacets = facets.shape[0] @@ -540,7 +540,7 @@ def create_cell_closure(PETSc.DM dm, PetscInt closureSize = _closureSize, closureSize1 PetscInt *closure = NULL PetscInt *fiat_closure = NULL - np.ndarray[PetscInt, ndim=2, mode="c"] cell_closure + np.ndarray cell_closure get_height_stratum(dm.dm, 0, &cStart, &cEnd) if cEnd == cStart: @@ -568,7 +568,7 @@ def create_cell_closure(PETSc.DM dm, def closure_ordering(PETSc.DM dm, PETSc.Section vertex_numbering, PETSc.Section cell_numbering, - np.ndarray[PetscInt, ndim=1, mode="c"] entity_per_cell): + np.ndarray entity_per_cell): """Apply Fenics local numbering to a cell closure. :arg dm: The DM object encapsulating the mesh topology @@ -595,7 +595,7 @@ def closure_ordering(PETSc.DM dm, PetscInt *face_indices = NULL const PetscInt *face_vertices = NULL PetscInt *facet_vertices = NULL - np.ndarray[PetscInt, ndim=2, mode="c"] cell_closure + np.ndarray cell_closure dim = get_topological_dimension(dm) get_height_stratum(dm.dm, 0, &cStart, &cEnd) @@ -749,7 +749,7 @@ def closure_ordering(PETSc.DM dm, def quadrilateral_closure_ordering(PETSc.DM plex, PETSc.Section vertex_numbering, PETSc.Section cell_numbering, - np.ndarray[PetscInt, ndim=1, mode="c"] cell_orientations): + np.ndarray cell_orientations): """Cellwise orders mesh entities according to the given cell orientations. :arg plex: The DMPlex object encapsulating the mesh topology @@ -772,7 +772,7 @@ def quadrilateral_closure_ordering(PETSc.DM plex, PetscInt facets[4] const PetscInt *cell_cone = NULL int reverse - np.ndarray[PetscInt, ndim=2, mode="c"] cell_closure + np.ndarray cell_closure get_height_stratum(plex.dm, 0, &cStart, &cEnd) get_height_stratum(plex.dm, 1, &fStart, &fEnd) @@ -1036,7 +1036,7 @@ cdef inline PetscInt _compute_orientation_interval_tensor_product(PetscInt *fiat cdef inline PetscInt _compute_orientation(PETSc.DM dm, - np.ndarray[PetscInt, ndim=2, mode="c"] cell_closure, + np.ndarray cell_closure, PetscInt cell, PetscInt e, PetscInt *fiat_cone, @@ -1098,7 +1098,7 @@ cdef inline PetscInt _compute_orientation(PETSc.DM dm, @cython.wraparound(False) @cython.cdivision(True) def entity_orientations(mesh, - np.ndarray[PetscInt, ndim=2, mode="c"] cell_closure): + np.ndarray cell_closure): """Compute entity orientations. :arg mesh: The :class:`~.MeshTopology` object encapsulating the mesh topology @@ -1120,7 +1120,7 @@ def entity_orientations(mesh, PetscInt *plex_cone_copy = NULL PetscInt *entity_cone_map = NULL PetscInt *entity_cone_map_offset = NULL - np.ndarray[PetscInt, ndim=2, mode="c"] entity_orientations + np.ndarray entity_orientations if type(mesh) is not firedrake.mesh.MeshTopology: raise TypeError(f"Unexpected mesh type: {type(mesh)}") @@ -1209,9 +1209,9 @@ def create_section(mesh, nodes_per_entity, on_base=False, block_size=1, boundary PetscInt dimension, ndof PetscInt *dof_array = NULL const PetscInt *entity_point_map - np.ndarray[PetscInt, ndim=2, mode="c"] nodes - np.ndarray[PetscInt, ndim=2, mode="c"] layer_extents - np.ndarray[PetscInt, ndim=1, mode="c"] points + np.ndarray nodes + np.ndarray layer_extents + np.ndarray points bint variable, extruded, on_base_ dm = mesh.topology_dm @@ -1343,7 +1343,7 @@ def get_cell_nodes(mesh, PETSc.Section global_numbering, entity_dofs, entity_permutations, - np.ndarray[PetscInt, ndim=1, mode="c"] offset): + np.ndarray offset): """ Builds the DoF mapping. @@ -1367,12 +1367,12 @@ def get_cell_nodes(mesh, PetscInt entity_permutations_size, num_orientations_size, perm_offset int *ceil_ndofs = NULL int *flat_index = NULL - np.ndarray[PetscInt, ndim=1, mode="c"] entity_permutations_c - np.ndarray[PetscInt, ndim=1, mode="c"] num_orientations_c - np.ndarray[PetscInt, ndim=2, mode="c"] cell_nodes - np.ndarray[PetscInt, ndim=2, mode="c"] layer_extents - np.ndarray[PetscInt, ndim=2, mode="c"] cell_closures - np.ndarray[PetscInt, ndim=2, mode="c"] entity_orientations + np.ndarray entity_permutations_c + np.ndarray num_orientations_c + np.ndarray cell_nodes + np.ndarray layer_extents + np.ndarray cell_closures + np.ndarray entity_orientations bint is_swarm, variable, extruded_periodic_1_layer dm = mesh.topology_dm @@ -1457,8 +1457,8 @@ def get_cell_nodes(mesh, @cython.boundscheck(False) @cython.wraparound(False) -def get_facet_nodes(mesh, np.ndarray[PetscInt, ndim=2, mode="c"] cell_nodes, label, - np.ndarray[PetscInt, ndim=1, mode="c"] offset): +def get_facet_nodes(mesh, np.ndarray cell_nodes, label, + np.ndarray offset): """Build to DoF mapping from facets. :arg mesh: The mesh. @@ -1472,8 +1472,8 @@ def get_facet_nodes(mesh, np.ndarray[PetscInt, ndim=2, mode="c"] cell_nodes, lab PETSc.DM dm PETSc.Section cell_numbering DMLabel clabel = NULL - np.ndarray[PetscInt, ndim=2, mode="c"] facet_nodes - np.ndarray[PetscInt, ndim=2, mode="c"] layer_extents + np.ndarray facet_nodes + np.ndarray layer_extents PetscInt f, p, i, j, pStart, pEnd, fStart, fEnd, point PetscInt supportSize, facet, cell, ndof, dof const PetscInt *renumbering @@ -1555,8 +1555,8 @@ def facet_closure_nodes(V, sub_domain): PETSc.Section sec = V.dm.getSection() PETSc.DM dm = V.mesh().topology_dm PetscInt nnodes, p, i, dof, offset, n, j, d - np.ndarray[PetscInt, ndim=1, mode="c"] points - np.ndarray[PetscInt, ndim=1, mode="c"] nodes + np.ndarray points + np.ndarray nodes if sub_domain == "on_boundary": label = "exterior_facets" sub_domain = (1, ) @@ -1672,7 +1672,7 @@ def complete_facet_labels(PETSc.DM dm): @cython.wraparound(False) def cell_facet_labeling(PETSc.DM plex, PETSc.Section cell_numbering, - np.ndarray[PetscInt, ndim=2, mode="c"] cell_closures): + np.ndarray cell_closures): """Computes a labeling for the facet numbers on a particular cell (interior and exterior facet labels with subdomain markers). The i-th local facet is represented as: @@ -1802,7 +1802,7 @@ def transform_vec_from_firedrake_to_petsc(PETSc.DM dm, const PetscScalar *firedrake_array PetscScalar *petsc_array PetscInt n, bs, petsc_n, petsc_bs, pStart, pEnd, firedrake_pStart, firedrake_pEnd, petsc_pStart, petsc_pEnd, p, firedrake_dof, petsc_dof, total_dof = 0, firedrake_offset, petsc_offset, i, j, height - np.ndarray[PetscInt, ndim=1, mode="c"] ndofs, perm, perm_offsets + np.ndarray ndofs, perm, perm_offsets n, _ = firedrake_vec.getSizes() petsc_n, _ = petsc_vec.getSizes() @@ -1912,8 +1912,8 @@ def reordered_coords(PETSc.DM dm, PETSc.Section global_numbering, shape, referen PETSc.Section dm_sec, coord_sec PetscInt v, vStart, vEnd, offset, dm_offset, c, cStart, cEnd PetscInt i, j, dim = shape[1] - np.ndarray[PetscScalar, ndim=2, mode="c"] dm_coords, coords - np.ndarray[PetscInt, ndim=1, mode="c"] ndofs, perm, perm_offsets + np.ndarray dm_coords, coords + np.ndarray ndofs, perm, perm_offsets get_depth_stratum(dm.dm, 0, &vStart, &vEnd) if isinstance(dm, PETSc.DMPlex): @@ -2118,8 +2118,8 @@ def get_entity_classes(PETSc.DM dm): :arg dm: The DM object encapsulating the mesh topology """ cdef: - np.ndarray[PetscInt, ndim=2, mode="c"] entity_class_sizes - np.ndarray[PetscInt, mode="c"] eStart, eEnd + np.ndarray entity_class_sizes + np.ndarray eStart, eEnd PetscInt depth, d, i, ci, class_size, start, end const PetscInt *indices = NULL PETSc.IS class_is @@ -2170,8 +2170,8 @@ def get_cell_markers(PETSc.DM dm, PETSc.Section cell_numbering, """ cdef: PetscInt i, j, n, offset, c, cStart, cEnd, ncells - np.ndarray[PetscInt, ndim=1, mode="c"] cells - np.ndarray[PetscInt, ndim=1, mode="c"] indices + np.ndarray cells + np.ndarray indices if not dm.hasLabel(CELL_SETS_LABEL): return np.empty(0, dtype=IntType) @@ -2225,7 +2225,7 @@ def get_facet_ordering(PETSc.DM plex, PETSc.Section facet_numbering): """ cdef: PetscInt fi, fStart, fEnd, offset - np.ndarray[PetscInt, ndim=1, mode="c"] facets + np.ndarray facets size = facet_numbering.getStorageSize() facets = np.empty(size, dtype=IntType) @@ -2239,7 +2239,7 @@ def get_facet_ordering(PETSc.DM plex, PETSc.Section facet_numbering): @cython.boundscheck(False) @cython.wraparound(False) def get_facets_by_class(PETSc.DM plex, label, - np.ndarray[PetscInt, ndim=1, mode="c"] ordering): + np.ndarray ordering): """Builds a list of all facets ordered according to PyOP2 entity classes and computes the respective class offsets. @@ -2254,7 +2254,7 @@ def get_facets_by_class(PETSc.DM plex, label, PETSc.IS class_is = None PetscBool has_point, is_class DMLabel lbl_facets, lbl_class - np.ndarray[PetscInt, ndim=1, mode="c"] facets + np.ndarray facets dim = get_topological_dimension(plex) get_height_stratum(plex.dm, 1, &fStart, &fEnd) @@ -2330,7 +2330,7 @@ def validate_mesh(PETSc.DM dm): @cython.wraparound(False) def plex_renumbering(PETSc.DM plex, np.ndarray entity_classes, - np.ndarray[PetscInt, ndim=1, mode="c"] reordering=None, + np.ndarray reordering=None, boundary_set=None): """ Build a global node renumbering as a permutation of Plex points. @@ -2358,7 +2358,7 @@ def plex_renumbering(PETSc.DM plex, cdef: PetscInt dim, cStart, cEnd, nfacets, nclosure, c, ci, l, p, f PetscInt pStart, pEnd, cell - np.ndarray[PetscInt, ndim=1, mode="c"] lidx, ncells + np.ndarray lidx, ncells PetscInt *facets = NULL PetscInt *closure = NULL PetscInt *perm = NULL @@ -2476,7 +2476,7 @@ def get_cell_remote_ranks(PETSc.DM plex): PetscInt nroots, nleaves const PetscInt *ilocal = NULL const PetscSFNode *iremote = NULL - np.ndarray[PetscInt, ndim=1, mode="c"] result + np.ndarray result get_height_stratum(plex.dm, 0, &cStart, &cEnd) ncells = cEnd - cStart @@ -2581,7 +2581,7 @@ cdef int CommFacet_cmp(const void *x_, const void *y_) noexcept nogil: @cython.wraparound(False) cdef inline void get_communication_lists( PETSc.DM plex, PETSc.Section vertex_numbering, - np.ndarray[PetscInt, ndim=1, mode="c"] cell_ranks, + np.ndarray cell_ranks, # Output parameters: PetscInt *nranks, PetscInt **ranks, PetscInt **offsets, PetscInt **facets, PetscInt **facet2index): @@ -2892,7 +2892,7 @@ cdef locally_orient_quadrilateral_plex(PETSc.DM plex, PetscInt start_facet, end_facet np.int8_t twist PetscInt i, j - np.ndarray[PetscInt, ndim=1, mode="c"] result + np.ndarray result get_height_stratum(plex.dm, 1, &fStart, &fEnd) nfacets = fEnd - fStart @@ -2973,8 +2973,8 @@ cdef locally_orient_quadrilateral_plex(PETSc.DM plex, @cython.wraparound(False) cdef inline void exchange_edge_orientation_data( PetscInt nranks, PetscInt *ranks, PetscInt *offsets, - np.ndarray[PetscInt, ndim=1, mode="c"] ours, - np.ndarray[PetscInt, ndim=1, mode="c"] theirs, + np.ndarray ours, + np.ndarray theirs, MPI.Comm comm): """Exchange edge orientation data between neighbouring MPI nodes. @@ -3008,7 +3008,7 @@ cdef inline void exchange_edge_orientation_data( @cython.wraparound(False) def quadrilateral_facet_orientations( PETSc.DM plex, PETSc.Section vertex_numbering, - np.ndarray[PetscInt, ndim=1, mode="c"] cell_ranks): + np.ndarray cell_ranks): """Returns globally synchronised facet orientations (edge directions) incident to locally owned quadrilateral cells. @@ -3028,8 +3028,8 @@ def quadrilateral_facet_orientations( MPI.Comm comm = plex.comm.tompi4py() PetscInt nfacets, nfacets_shared, fStart, fEnd - np.ndarray[PetscInt, ndim=1, mode="c"] affects - np.ndarray[PetscInt, ndim=1, mode="c"] ours, theirs + np.ndarray affects + np.ndarray ours, theirs PetscInt conflict, value, f, i, j PetscInt ci, size @@ -3153,7 +3153,7 @@ def quadrilateral_facet_orientations( @cython.wraparound(False) def orientations_facet2cell( PETSc.DM plex, PETSc.Section vertex_numbering, - np.ndarray[PetscInt, ndim=1, mode="c"] cell_ranks, + np.ndarray cell_ranks, np.ndarray[np.int8_t, ndim=1, mode="c"] facet_orientations, PETSc.Section cell_numbering): @@ -3174,7 +3174,7 @@ def orientations_facet2cell( np.int8_t dst_orient[4] int i, off PetscInt facet, v, V - np.ndarray[PetscInt, ndim=1, mode="c"] cell_orientations + np.ndarray cell_orientations get_height_stratum(plex.dm, 0, &cStart, &cEnd) get_height_stratum(plex.dm, 1, &fStart, &fEnd) @@ -3251,7 +3251,7 @@ def orientations_facet2cell( @cython.wraparound(False) def exchange_cell_orientations( PETSc.DM plex, PETSc.Section section, - np.ndarray[PetscInt, ndim=1, mode="c"] orientations): + np.ndarray orientations): """Halo exchange of cell orientations. @@ -3311,7 +3311,7 @@ def make_global_numbering(PETSc.Section lsec, PETSc.Section gsec): :arg gsec: Section describing global dof layout and numbers.""" cdef: PetscInt c, p, pStart, pEnd, dof, cdof, loff, goff - np.ndarray[PetscInt, ndim=1, mode="c"] val + np.ndarray val val = np.empty(lsec.getStorageSize(), dtype=IntType) pStart, pEnd = lsec.getChart() @@ -3465,8 +3465,8 @@ def compute_point_cone_global_sizes(PETSc.DM dm): const PetscInt *ilocal = NULL const PetscSFNode *iremote = NULL PetscInt i, p, pStart, pEnd, coneSize - np.ndarray[PetscInt, ndim=1, mode="c"] arraySizes - np.ndarray[PetscInt, ndim=1, mode="c"] out + np.ndarray arraySizes + np.ndarray out sf = dm.getPointSF() CHKERR(PetscSFGetGraph(sf.sf, NULL, &nleaves, &ilocal, NULL)) @@ -3492,7 +3492,7 @@ def compute_point_cone_global_sizes(PETSc.DM dm): def mark_points_with_function_array(PETSc.DM plex, PETSc.Section section, PetscInt height, - np.ndarray[PetscInt, ndim=1, mode="c"] array, + np.ndarray array, PETSc.DMLabel dmlabel, PetscInt label_value): @@ -3529,7 +3529,7 @@ def to_petsc_local_numbering(PETSc.Vec vec, V): cdef PetscInt dof, off cdef PETSc.Vec out cdef PETSc.Section section - cdef np.ndarray[PetscReal, mode="c", ndim=1] varray, oarray + cdef np.ndarray varray, oarray section = V.dm.getGlobalSection() out = vec.duplicate() @@ -3581,8 +3581,8 @@ def create_halo_exchange_sf(PETSc.DM dm): const PetscSFNode *iremote = NULL PETSc.Section local_sec PetscInt pStart, pEnd, p, dof, off, m, n, i, j - np.ndarray[PetscInt, ndim=1, mode="c"] local_offsets - np.ndarray[PetscInt, ndim=1, mode="c"] remote_offsets + np.ndarray local_offsets + np.ndarray remote_offsets point_sf = dm.getPointSF() local_sec = dm.getLocalSection() @@ -3682,8 +3682,8 @@ def submesh_correct_entity_classes(PETSc.DM dm, const PetscSFNode *iremote = NULL PETSc.IS subpoint_is const PetscInt *subpoint_indices = NULL - np.ndarray[PetscInt, ndim=1, mode="c"] ownership_loss - np.ndarray[PetscInt, ndim=1, mode="c"] ownership_gain + np.ndarray ownership_loss + np.ndarray ownership_gain DMLabel lbl_core, lbl_owned, lbl_ghost PetscBool has @@ -3812,7 +3812,7 @@ def submesh_create_cell_closure_cell_submesh(PETSc.DM subdm, PETSc.DM dm, PETSc.Section subcell_numbering, PETSc.Section cell_numbering, - np.ndarray[PetscInt, ndim=2, mode="c"] cell_closure): + np.ndarray cell_closure): """Inherit cell_closure from parent. Parameters @@ -3836,7 +3836,7 @@ def submesh_create_cell_closure_cell_submesh(PETSc.DM subdm, PetscInt subpStart, subpEnd, subp, subcStart, subcEnd, subc, subcell PetscInt pStart, pEnd, p, cStart, cEnd, c, cell PetscInt nclosure, cl - np.ndarray[PetscInt, ndim=2, mode="c"] subcell_closure + np.ndarray subcell_closure get_chart(subdm.dm, &subpStart, &subpEnd) get_height_stratum(subdm.dm, 0, &subcStart, &subcEnd) diff --git a/firedrake/cython/mgimpl.pyx b/firedrake/cython/mgimpl.pyx index 2867b5e79f..b9b41bd32f 100644 --- a/firedrake/cython/mgimpl.pyx +++ b/firedrake/cython/mgimpl.pyx @@ -29,8 +29,8 @@ def get_entity_renumbering(PETSc.DM plex, PETSc.Section section, entity_type): """ cdef: PetscInt start, end, p, ndof, entity - np.ndarray[PetscInt, ndim=1] old_to_new - np.ndarray[PetscInt, ndim=1] new_to_old + np.ndarray old_to_new + np.ndarray new_to_old if entity_type == "cell": start, end = plex.getHeightStratum(0) @@ -55,10 +55,10 @@ def get_entity_renumbering(PETSc.DM plex, PETSc.Section section, entity_type): @cython.boundscheck(False) @cython.wraparound(False) -def coarse_to_fine_nodes(Vc, Vf, np.ndarray[PetscInt, ndim=2, mode="c"] coarse_to_fine_cells): +def coarse_to_fine_nodes(Vc, Vf, np.ndarray coarse_to_fine_cells): cdef: - np.ndarray[PetscInt, ndim=2, mode="c"] fine_map, coarse_map, coarse_to_fine_map - np.ndarray[PetscInt, ndim=1, mode="c"] coarse_offset, fine_offset + np.ndarray fine_map, coarse_map, coarse_to_fine_map + np.ndarray coarse_offset, fine_offset PetscInt i, j, k, l, m, node, fine, layer PetscInt coarse_per_cell, fine_per_cell, fine_cell_per_coarse_cell, coarse_cells PetscInt fine_layer, fine_layers, coarse_layer, coarse_layers, ratio @@ -116,10 +116,10 @@ def coarse_to_fine_nodes(Vc, Vf, np.ndarray[PetscInt, ndim=2, mode="c"] coarse_t @cython.boundscheck(False) @cython.wraparound(False) -def fine_to_coarse_nodes(Vf, Vc, np.ndarray[PetscInt, ndim=2, mode="c"] fine_to_coarse_cells): +def fine_to_coarse_nodes(Vf, Vc, np.ndarray fine_to_coarse_cells): cdef: - np.ndarray[PetscInt, ndim=2, mode="c"] fine_map, coarse_map, fine_to_coarse_map - np.ndarray[PetscInt, ndim=1, mode="c"] coarse_offset, fine_offset + np.ndarray fine_map, coarse_map, fine_to_coarse_map + np.ndarray coarse_offset, fine_offset PetscInt i, j, k, node, fine_layer, fine_layers, coarse_layer, coarse_layers, ratio PetscInt coarse_per_cell, fine_per_cell, coarse_cell, fine_cells bint extruded @@ -247,9 +247,9 @@ def coarse_to_fine_cells(mc, mf, clgmaps, flgmaps): PETSc.DM cdm, fdm PetscInt cStart, cEnd, c, val, dim, nref, ncoarse PetscInt i, ccell, fcell, nfine - np.ndarray[PetscInt, ndim=2, mode="c"] coarse_to_fine - np.ndarray[PetscInt, ndim=2, mode="c"] fine_to_coarse - np.ndarray[PetscInt, ndim=1, mode="c"] co2n, fn2o, idx + np.ndarray coarse_to_fine + np.ndarray fine_to_coarse + np.ndarray co2n, fn2o, idx cdm = mc.topology_dm fdm = mf.topology_dm diff --git a/firedrake/cython/petschdr.pxi b/firedrake/cython/petschdr.pxi index 41c8974f83..55786e7184 100644 --- a/firedrake/cython/petschdr.pxi +++ b/firedrake/cython/petschdr.pxi @@ -5,14 +5,10 @@ cimport numpy as np cdef extern from "mpi-compat.h": pass -IF COMPLEX: - ctypedef np.complex128_t PetscScalar -ELSE: - ctypedef double PetscScalar - cdef extern from "petsc.h": ctypedef long PetscInt ctypedef double PetscReal + ctypedef double PetscScalar ctypedef enum PetscBool: PETSC_TRUE, PETSC_FALSE ctypedef enum PetscCopyMode: diff --git a/firedrake/cython/supermeshimpl.pyx b/firedrake/cython/supermeshimpl.pyx index 6ca3d557ef..ad3387cd82 100644 --- a/firedrake/cython/supermeshimpl.pyx +++ b/firedrake/cython/supermeshimpl.pyx @@ -39,23 +39,23 @@ cdef extern from "libsupermesh-c.h" nogil: # compute out = R_BS^T @ M_SS @ R_AS with dense matrix triple product # stuff out into relevant part of M_AB (given by outer(dofs_B, dofs_A)) def assemble_mixed_mass_matrix(V_A, V_B, candidates, - numpy.ndarray[PetscScalar, ndim=2, mode="c"] node_locations_A, - numpy.ndarray[PetscScalar, ndim=2, mode="c"] node_locations_B, - numpy.ndarray[PetscScalar, ndim=2, mode="c"] M_SS, + numpy.ndarray node_locations_A, + numpy.ndarray node_locations_B, + numpy.ndarray M_SS, lib, PETSc.Mat mat not None): cdef: numpy.ndarray[PetscInt, ndim=2, mode="c"] V_A_cell_node_map numpy.ndarray[PetscInt, ndim=2, mode="c"] V_B_cell_node_map numpy.ndarray[PetscInt, ndim=2, mode="c"] vertex_map_A, vertex_map_B - numpy.ndarray[PetscScalar, ndim=2, mode="c"] vertices_A, vertices_B - numpy.ndarray[PetscScalar, ndim=2, mode="c"] outmat + numpy.ndarray vertices_A, vertices_B + numpy.ndarray outmat PetscInt cell_A, cell_B, i, gdim, num_dof_A, num_dof_B PetscInt num_cell_B, num_cell_A, num_vertices PetscInt insert_mode = PETSc.InsertMode.ADD_VALUES const PetscInt *V_A_map const PetscInt *V_B_map - numpy.ndarray[PetscScalar, ndim=2, mode="c"] simplex_A, simplex_B - numpy.ndarray[PetscScalar, ndim=3, mode="c"] simplices_C + numpy.ndarray simplex_A, simplex_B + numpy.ndarray simplices_C compiled_call library_call = (lib)[0] num_cell_A = V_A.mesh().cell_set.size @@ -112,10 +112,10 @@ def intersection_finder(mesh_A, mesh_B): # Return the output cdef: - numpy.ndarray[long, ndim=2, mode="c"] vertex_map_A, vertex_map_B - numpy.ndarray[double, ndim=2, mode="c"] vertices_A, vertices_B + numpy.ndarray vertex_map_A, vertex_map_B + numpy.ndarray vertices_A, vertices_B long nindices - numpy.ndarray[long, ndim=1, mode="c"] indices, indptr + numpy.ndarray indices, indptr long nnodes_A, nnodes_B, ncells_A, ncells_B int dim_A, dim_B, loc_A, loc_B diff --git a/firedrake/scripts/__init__.py b/firedrake/scripts/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/scripts/firedrake-install b/firedrake/scripts/firedrake-install similarity index 98% rename from scripts/firedrake-install rename to firedrake/scripts/firedrake-install index 98568f7aa3..ea4997852d 100755 --- a/scripts/firedrake-install +++ b/firedrake/scripts/firedrake-install @@ -27,7 +27,7 @@ arch = platform.uname().machine # Packages which we wish to ensure are always recompiled wheel_blacklist = ["mpi4py", "randomgen", "numpy"] # Packages for which we set CC=mpicc, CXX=mpicxx, F90=mpif90. -parallel_packages = ["h5py", "petsc4py", "slepc", "slepc4py", "PyOP2", "libsupermesh", "firedrake"] +parallel_packages = ["h5py", "petsc4py", "slepc", "slepc4py", "libsupermesh", "firedrake"] # Firedrake application installation shortcuts. firedrake_apps = { @@ -135,11 +135,11 @@ log.info("Running %s" % " ".join(sys.argv)) if sys.version_info >= (3, 14): print("""\nCan not install Firedrake with Python 3.14 at the moment: Some wheels are not yet available for Python 3.14 for some required package(s). -Please install with Python 3.13 (or an earlier version >= 3.9).""") +Please install with Python 3.13 (or an earlier version >= 3.10).""") sys.exit(1) -elif sys.version_info < (3, 9): +elif sys.version_info < (3, 10): if mode == "install": - print("""\nInstalling Firedrake requires Python 3, at least version 3.9. + print("""\nInstalling Firedrake requires Python 3, at least version 3.10. You should run firedrake-install with python3.""") if mode == "update": if hasattr(sys, "real_prefix"): @@ -377,19 +377,12 @@ honoured.""", config = FiredrakeConfiguration(args) else: - # This duplicates code from firedrake_configuration in order to avoid the module dependency and allow for installation recovery. try: with open(os.path.join(os.environ["VIRTUAL_ENV"], ".configuration.json"), "r") as f: config = json.load(f) - except FileNotFoundError: - # Fall back to the old location. - import firedrake_configuration - - config = firedrake_configuration.get_config() - if config is None: - raise InstallError("Failed to find existing Firedrake configuration") + raise InstallError("Failed to find existing Firedrake configuration") parser = ArgumentParser(description="""Update this firedrake install to the latest versions of all packages.""", formatter_class=RawDescriptionHelpFormatter) @@ -1404,7 +1397,7 @@ def quit(message): def build_update_script(): log.info("Creating firedrake-update script.") - with open("firedrake/scripts/firedrake-install", "r") as f: + with open("firedrake/firedrake/scripts/firedrake-install", "r") as f: update_script = f.read() try: @@ -1417,7 +1410,7 @@ def build_update_script(): if args.rebuild_script: - os.chdir(os.path.dirname(os.path.realpath(__file__)) + ("/../..")) + os.chdir(os.path.dirname(os.path.realpath(__file__)) + ("/../../..")) build_update_script() @@ -1803,7 +1796,7 @@ if mode == "install": run_pip(["install", "lazy-object-proxy==1.4.*"]) packages = clone_dependencies("firedrake") - packages = clone_dependencies("PyOP2") + ["petsc4py"] + packages + packages = ["petsc4py"] + packages packages += ["firedrake"] for p in options["packages"]: @@ -1812,13 +1805,18 @@ if mode == "install": packages += [name] if args.honour_petsc_dir: - packages.remove("petsc") - - # Need to install petsc first in order to resolve hdf5 dependency. - if not args.honour_petsc_dir: + try: + packages.remove("petsc") + except ValueError: + log.warning("PETSc wasn't in dependencies list") + else: + # Need to install petsc first in order to resolve hdf5 dependency. with environment(**compiler_env): with pipargs("--no-deps"): - packages.remove("petsc") + try: + packages.remove("petsc") + except ValueError: + log.warning("PETSc wasn't in dependencies list") install("petsc/") os.environ["PETSC_DIR"] = petsc_dir os.environ["PETSC_ARCH"] = petsc_arch @@ -1865,7 +1863,6 @@ if mode == "install": with pipargs("--no-deps"): try: - packages.remove("PyOP2") packages.remove("firedrake") except ValueError: pass @@ -1882,14 +1879,8 @@ if mode == "install": build_and_install_libsupermesh(cc, cxx, f90, mpiexec) with pipargs("--no-deps"), environment(**compiler_env, **link_env): - for p in ("PyOP2", "firedrake"): - install(p+"/") + install("firedrake/") - # Work around easy-install.pth bug. - try: - packages.remove("petsc") - except ValueError: - pass packages.remove("petsc4py") else: @@ -1909,7 +1900,6 @@ else: run_pip_install(package.split()) deps = OrderedDict() - deps.update(list_cloned_dependencies("PyOP2")) deps.update(list_cloned_dependencies("firedrake")) for p in options["packages"]: name = split_requirements_url(p)[0] @@ -1938,7 +1928,10 @@ else: clean("slepc4py") shutil.move("slepc4py", "slepc4py_old") - packages.remove("petsc") + try: + packages.remove("petsc") + except ValueError: + log.warning("PETSc wasn't in dependencies list") packages.remove("petsc4py") if args.clean: @@ -2039,7 +2032,6 @@ Please consider updating your PETSc manually. with pipargs("--no-deps"): try: - packages.remove("PyOP2") packages.remove("firedrake") except ValueError: pass @@ -2056,8 +2048,7 @@ Please consider updating your PETSc manually. build_and_install_libsupermesh(cc, cxx, f90, mpiexec) with pipargs("--no-deps"), environment(**compiler_env, **link_env): - for p in ("PyOP2", "firedrake"): - install(p+"/") + install("firedrake/") # Ensure pytest is at the latest version run_pip(["install", "-U", "pytest"]) @@ -2092,8 +2083,8 @@ if args.documentation_dependencies: if mode == "update": try: - import firedrake_configuration - firedrake_configuration.setup_cache_dirs() + from firedrake.configuration import setup_cache_dirs + setup_cache_dirs() log.info("Clearing just in time compilation caches.") from firedrake.tsfc_interface import clear_cache, TSFCKernel from pyop2.compilation import clear_cache as pyop2_clear_cache diff --git a/scripts/firedrake-zenodo b/firedrake/scripts/firedrake-zenodo similarity index 99% rename from scripts/firedrake-zenodo rename to firedrake/scripts/firedrake-zenodo index 68f1d44332..6194d9df1d 100755 --- a/scripts/firedrake-zenodo +++ b/firedrake/scripts/firedrake-zenodo @@ -20,7 +20,6 @@ ZENODO_URL = "https://zenodo.org/api" # And the same for slepc4py. descriptions = OrderedDict([ ("firedrake", "an automated finite element system"), - ("PyOP2", "Framework for performance-portable parallel computations on unstructured meshes"), ("tsfc", "The Two Stage Form Compiler"), ("ufl", "The Unified Form Language"), ("FInAT", "a smarter library of finite elements"), @@ -33,7 +32,6 @@ descriptions = OrderedDict([ projects = dict( [("firedrake", "firedrakeproject"), - ("PyOP2", "OP2"), ("tsfc", "firedrakeproject"), ("ufl", "firedrakeproject"), ("FInAT", "FInAT"), diff --git a/firedrake/scripts/firedrake_clean.py b/firedrake/scripts/firedrake_clean.py new file mode 100755 index 0000000000..47563c1823 --- /dev/null +++ b/firedrake/scripts/firedrake_clean.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python3 +import os +import shutil +from firedrake.configuration import setup_cache_dirs +from pyop2.compilation import clear_compiler_disk_cache as pyop2_clear_cache +from firedrake.tsfc_interface import clear_cache as tsfc_clear_cache +try: + import platformdirs as appdirs +except ImportError: + import appdirs + + +def main(): + print("Setup cache directories") + setup_cache_dirs() + + print(f"Removing cached TSFC kernels from {os.environ.get('FIREDRAKE_TSFC_KERNEL_CACHE_DIR', '???')}") + tsfc_clear_cache() + + print(f"Removing cached PyOP2 code from {os.environ.get('FIREDRAKE_TSFC_KERNEL_CACHE_DIR', '???')}") + pyop2_clear_cache() + + pytools_cache = appdirs.user_cache_dir("pytools", "pytools") + print(f"Removing cached pytools files from {pytools_cache}") + if os.path.exists(pytools_cache): + shutil.rmtree(pytools_cache, ignore_errors=True) + + +if __name__ == '__main__': + main() diff --git a/firedrake/scripts/firedrake_preprocess_bibtex.py b/firedrake/scripts/firedrake_preprocess_bibtex.py new file mode 100755 index 0000000000..4fd3484feb --- /dev/null +++ b/firedrake/scripts/firedrake_preprocess_bibtex.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python3 +import io +from argparse import ArgumentParser, RawDescriptionHelpFormatter +try: + from bibtexparser.bwriter import BibTexWriter + import bibtexparser +except ImportError: + raise ImportError("Failed to import bibtexparser. Run:\n firedrake-update --documentation-dependencies") + + +def main(): + parser = ArgumentParser(description="""Ensure BibTeX entries for inclusion in the Firedrake website have a +URL or DOI, and impose clean formatting.""", + formatter_class=RawDescriptionHelpFormatter) + parser.add_argument("bibtex_file", help="The BibTeX file to process") + parser.add_argument("--validate", action='store_true', + help="Instead of rewriting the bibtex file, raise an exception if anything would have changed.") + + args = parser.parse_args() + + filename = args.bibtex_file + + parser = bibtexparser.bparser.BibTexParser() + parser.common_strings = True + parser.ignore_nonstandard_types = False + + with open(filename) as bibtex_file: + bib_database = parser.parse_file(bibtex_file) + + for entry in bib_database.entries: + if "url" not in entry and \ + "doi" not in entry: + if entry.get("archiveprefix", None) == "arXiv": + entry["url"] = "https://arxiv.org/abs/" + entry["eprint"] + else: + raise ValueError("%s in bibliograpy %s\n has no url and no DOI.\n" % (entry["ID"], filename)) + + writer = BibTexWriter() + writer.indent = ' ' # indent entries with 2 spaces instead of one + writer.align_values = True + + if args.validate: + with io.StringIO() as outbuffer: + outbuffer.write(writer.write(bib_database)) + processed = outbuffer.getvalue() + with open(filename) as bibtex_file: + inbuffer = bibtex_file.read() + if processed != inbuffer: + raise ValueError("%s would be changed by firedrake-preprocess-bibtex. Please preprocess it and commit the result" % filename) + + else: + with open(filename, 'w') as bibfile: + bibfile.write(writer.write(bib_database)) + + +if __name__ == "__main__": + main() diff --git a/firedrake/scripts/firedrake_status.py b/firedrake/scripts/firedrake_status.py new file mode 100755 index 0000000000..a256d70b69 --- /dev/null +++ b/firedrake/scripts/firedrake_status.py @@ -0,0 +1,144 @@ +#! /usr/bin/env python3 +from six import iteritems + +from argparse import ArgumentParser, RawDescriptionHelpFormatter +from pprint import pformat +import logging +import json +import sys +import os +import subprocess +from collections import OrderedDict, defaultdict + + +def check_output(args, env=None): + return subprocess.check_output(args, stderr=subprocess.STDOUT, env=env) + + +def quit(log, message): + log.error(message) + sys.exit(1) + + +def main(): + parser = ArgumentParser(description="""Provide information on the currently downloaded version of Firedrake and its configuration. + This is particularly useful information to include when reporting bugs.""", + formatter_class=RawDescriptionHelpFormatter) + parser.add_argument("--log", action='store_true', + help="Log the output of the script to firedrake-status.log as well as to the console.") + + args = parser.parse_args() + + # Set up logging + if args.log: + logging.basicConfig(level=logging.DEBUG, + format='%(asctime)s %(levelname)-6s %(message)s', + filename='firedrake-status.log', + filemode='w') + console = logging.StreamHandler() + console.setLevel(logging.WARNING) + formatter = logging.Formatter('%(message)s') + console.setFormatter(formatter) + logging.getLogger().addHandler(console) + else: + logging.basicConfig(level=logging.WARNING, + format='%(message)s') + log = logging.getLogger() + + try: + firedrake_env = os.environ["VIRTUAL_ENV"] + except KeyError: + quit(log, "Unable to retrieve virtualenv name from the environment.\n Please ensure the virtualenv is active before running firedrake-update.") + + try: + with open(os.path.join(os.environ["VIRTUAL_ENV"], + ".configuration.json"), "r") as f: + config = json.load(f) + except FileNotFoundError: + config = defaultdict(dict) + + try: + config["system"] = check_output(["uname", "-a"]) + except subprocess.CalledProcessError: + log.error("Failed to retrieve system information.") + + print("Firedrake Configuration:") + if not config: + print("No configuration information found.") + else: + for key, val in iteritems(config["options"]): + print(" {}: {}".format(key, val)) + + print("Additions:") + if config["additions"]: + for a in config["additions"]: + print(" " + a) + else: + print(" None") + + for var in ["PYTHONPATH", "PETSC_ARCH", "PETSC_DIR"]: + config["environment"][var] = os.environ.get(var, None) + + print("Environment:") + for key, val in iteritems(config["environment"]): + print(" {}: {}".format(key, val)) + + status = OrderedDict() + for dir in sorted(os.listdir(firedrake_env + "/src")): + try: + os.chdir(firedrake_env + "/src/" + dir) + except OSError as e: + if e.errno == 20: + # Not a directory + continue + else: + raise + try: + revision = check_output(["git", "rev-parse", "--short", "HEAD"]).decode('ascii').strip() + branch = check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"]).decode('ascii').strip() + except subprocess.CalledProcessError: + log.error("Unable to retrieve git information from %s." % dir) + else: + try: + _ = check_output(["git", "diff-index", "--quiet", "HEAD"]) + modified = False + except subprocess.CalledProcessError: + modified = True + + status[dir] = {"branch": branch, + "revision": revision, + "modified": modified} + + status_string = "" + status_string += "Status of components:\n" + componentformat = "|{:20}|{:30}|{:10}|{!s:10}|\n" + header = componentformat.format("Package", "Branch", "Revision", "Modified") + line = "-" * (len(header) - 1) + "\n" + status_string += line + header + line + for dir, d in iteritems(status): + status_string += componentformat.format(dir, d["branch"], d["revision"], d["modified"]) + status_string += line + + print(status_string) + log.info("\n" + status_string) + + log.info("Firedrake configuration: ") + log.info(pformat(config)) + log.debug("\nPip packages installed:") + try: + log.debug(check_output(["pip", "freeze"])) + except subprocess.CalledProcessError: + log.error("""Failed to retrieve list of pip installed packages. Try running: + + pip freeze. + + """) + log.debug("\n Full environment:") + try: + log.debug(check_output(["env"])) + except subprocess.CalledProcessError: + log.error("""Shell command env failed.""") + + +if __name__ == "__main__": + main() diff --git a/firedrake/utils.py b/firedrake/utils.py index 2dd768fb28..e8bda53b95 100644 --- a/firedrake/utils.py +++ b/firedrake/utils.py @@ -7,7 +7,8 @@ from pyop2.datatypes import IntType # noqa: F401 from pyop2.datatypes import as_ctypes # noqa: F401 from pyop2.mpi import MPI -from firedrake_configuration import get_config +from firedrake.petsc import get_petsc_variables + # MPI key value for storing a per communicator universal identifier FIREDRAKE_UID = MPI.Comm.Create_keyval() @@ -16,7 +17,7 @@ ScalarType_c = as_cstr(ScalarType) IntType_c = as_cstr(IntType) -complex_mode = get_config()["options"].get("complex", False) +complex_mode = (get_petsc_variables()["PETSC_SCALAR"].lower() == "complex") # Remove this (and update test suite) when Slate supports complex mode. SLATE_SUPPORTS_COMPLEX = False diff --git a/firedrake_configuration/__init__.py b/firedrake_configuration/__init__.py deleted file mode 100644 index b7970ab0b7..0000000000 --- a/firedrake_configuration/__init__.py +++ /dev/null @@ -1,58 +0,0 @@ -"""The :mod:`firedrake_configuration` module records the configuration -with which Firedrake was last installed or updated. It is a separate -package from Firedrake in order to ensure that `firedrake-update` can -always access the configuration, even if the :mod:`.firedrake` module -itself is broken.""" - -import json -import os -import sys -import petsc4py - -# Attempt to read configuration from file. -try: - with open(os.path.join(sys.prefix, - ".configuration.json"), "r") as f: - _config = json.load(f) - -except IOError: - # Fall back to old location. - try: - with open(os.path.join(os.path.dirname(__file__), - "configuration.json"), "r") as f: - _config = json.load(f) - - except IOError: - _config = {} - - -def petsc_packages(): - conf = petsc4py.get_config() - with open(os.path.join(conf["PETSC_DIR"], conf["PETSC_ARCH"], "include", "petscconf.h"), "r") as f: - *_, packages = next(line for line in f if line.startswith("#define PETSC_HAVE_PACKAGES")).split() - return set(packages[2:-2].split(":")) - - -options = _config.get("options", {}) -options["with_parmetis"] = "parmetis" in petsc_packages() -_config["options"] = options - - -def get_config(): - """Return the current configuration dictionary""" - return _config - - -def get_config_json(): - """Return a json serialisation of the current configuration. This - could be output by a Firedrake application to assist in the - reproduction of results.""" - return json.dumps(_config) - - -def setup_cache_dirs(): - config = get_config() - if "PYOP2_CACHE_DIR" not in os.environ: - os.environ["PYOP2_CACHE_DIR"] = os.path.join(config["options"]["cache_dir"], "pyop2") - if 'FIREDRAKE_TSFC_KERNEL_CACHE_DIR' not in os.environ: - os.environ["FIREDRAKE_TSFC_KERNEL_CACHE_DIR"] = os.path.join(config["options"]["cache_dir"], "tsfc") diff --git a/pyop2/compilation.py b/pyop2/compilation.py index 5c0ad7b4cc..76ccbb38a7 100644 --- a/pyop2/compilation.py +++ b/pyop2/compilation.py @@ -55,6 +55,7 @@ from pyop2.configuration import configuration from pyop2.logger import warning, debug, progress, INFO from pyop2.exceptions import CompilationError +from pyop2.utils import get_petsc_variables import pyop2.global_kernel from petsc4py import PETSc @@ -72,6 +73,8 @@ def _check_hashes(x, y, datatype): # _and_ per user for shared machines _EXE_HASH = md5(sys.executable.encode()).hexdigest()[-6:] MEM_TMP_DIR = Path(gettempdir()).joinpath(f"pyop2-tempcache-uid{os.getuid()}").joinpath(_EXE_HASH) +# PETSc Configuration +petsc_variables = get_petsc_variables() def set_default_compiler(compiler): @@ -218,8 +221,8 @@ class Compiler(ABC): """ _name = "unknown" - _cc = "mpicc" - _cxx = "mpicxx" + _cc = None + _cxx = None _ld = None _cflags = () @@ -248,15 +251,15 @@ def __str__(self): @property def cc(self): - return configuration["cc"] or self._cc + return self._cc or petsc_variables["CC"] @property def cxx(self): - return configuration["cxx"] or self._cxx + return self._cxx or petsc_variables["CXX"] @property def ld(self): - return configuration["ld"] or self._ld + return self._ld @property def cflags(self): @@ -373,9 +376,6 @@ class LinuxIntelCompiler(Compiler): """The Intel compiler for building a shared library on Linux systems.""" _name = "Intel" - _cc = "mpiicc" - _cxx = "mpiicpc" - _cflags = ("-fPIC", "-no-multibyte-chars", "-std=gnu11") _cxxflags = ("-fPIC", "-no-multibyte-chars") _ldflags = ("-shared",) @@ -388,9 +388,6 @@ class LinuxCrayCompiler(Compiler): """The Cray compiler for building a shared library on Linux systems.""" _name = "Cray" - _cc = "cc" - _cxx = "CC" - _cflags = ("-fPIC", "-Wall", "-std=gnu11") _cxxflags = ("-fPIC", "-Wall") _ldflags = ("-shared",) @@ -464,11 +461,11 @@ def __init__(self, code, argtypes): # Use the global compiler if it has been set compiler = _compiler else: - # Sniff compiler from executable + # Sniff compiler from file extension, if extension == "cpp": - exe = configuration["cxx"] or "mpicxx" + exe = petsc_variables["CXX"] else: - exe = configuration["cc"] or "mpicc" + exe = petsc_variables["CC"] compiler = sniff_compiler(exe, comm) debug = configuration["debug"] @@ -617,7 +614,7 @@ def make_so(compiler, jitmodule, extension, comm, filename=None): _run(cc, logfile, errfile) else: # Compile - cc = (exe,) + compiler_flags + ('-c', '-o', oname, cname) + cc = (exe,) + compiler_flags + ('-c', '-o', str(oname), str(cname)) _run(cc, logfile, errfile) # Extract linker specific "cflags" from ldflags and link ld = tuple(shlex.split(compiler.ld)) + ('-o', str(soname), str(oname)) + tuple(expandWl(compiler.ldflags)) diff --git a/pyop2/configuration.py b/pyop2/configuration.py index 0005ceeca2..34969908ac 100644 --- a/pyop2/configuration.py +++ b/pyop2/configuration.py @@ -81,12 +81,6 @@ class Configuration(dict): # name, env variable, type, default, write once cache_dir = os.path.join(gettempdir(), "pyop2-cache-uid%s" % os.getuid()) DEFAULTS = { - "cc": - ("PYOP2_CC", str, ""), - "cxx": - ("PYOP2_CXX", str, ""), - "ld": - ("PYOP2_LD", str, ""), "cflags": ("PYOP2_CFLAGS", str, ""), "cxxflags": diff --git a/pyop2/local_kernel.py b/pyop2/local_kernel.py index 493107ba82..da82f6ecad 100644 --- a/pyop2/local_kernel.py +++ b/pyop2/local_kernel.py @@ -4,6 +4,8 @@ from typing import Union import loopy as lp +from loopy.kernel import LoopKernel +from loopy.translation_unit import TranslationUnit from loopy.tools import LoopyKeyBuilder import numpy as np @@ -212,7 +214,7 @@ class LoopyLocalKernel(LocalKernel): or :class:`loopy.TranslationUnit`. """ - @validate_type(("code", (lp.LoopKernel, lp.TranslationUnit), TypeError)) + @validate_type(("code", (LoopKernel, TranslationUnit), TypeError)) def __init__(self, code, *args, **kwargs): super().__init__(code, *args, **kwargs) diff --git a/scripts/spydump b/pyop2/scripts/spydump similarity index 94% rename from scripts/spydump rename to pyop2/scripts/spydump index 9e7cfc0c25..0077fe1ca1 100755 --- a/scripts/spydump +++ b/pyop2/scripts/spydump @@ -41,31 +41,34 @@ import numpy as np import pylab from scipy.sparse import csr_matrix -COOKIE = 1211216 # from petscmat.h -IntType = '>i4' # big-endian, 4 byte integer -ScalarType = '>f8' # big-endian, 8 byte real floating +COOKIE = 1211216 # from petscmat.h +IntType = '>i4' # big-endian, 4 byte integer +ScalarType = '>f8' # big-endian, 8 byte real floating + # after http://lists.mcs.anl.gov/pipermail/petsc-users/2010-February/005935.html def readmat(filename): with open(filename, 'rb') as fh: header = np.fromfile(fh, dtype=IntType, count=4) - assert header[0] == COOKIE + assert header[0] == COOKIE M, N, nz = header[1:] # I = np.empty(M+1, dtype=IntType) - I[0] = 0 + I[0] = 0 rownz = np.fromfile(fh, dtype=IntType, count=M) np.cumsum(rownz, out=I[1:]) assert I[-1] == nz # - J = np.fromfile(fh, dtype=IntType, count=nz) + J = np.fromfile(fh, dtype=IntType, count=nz) V = np.fromfile(fh, dtype=ScalarType, count=nz) return (M, N), (I, J, V) + def dump2csr(filename): (M, N), (I, J, V) = readmat(filename) return csr_matrix((V, J, I)) + def compare_dump(files, outfile=None, marker='.', markersize=.5): """Compare two binary PETSc matrix dumps as spy plots.""" @@ -104,7 +107,8 @@ def compare_dump(files, outfile=None, marker='.', markersize=.5): else: pylab.show() -if __name__ == '__main__': + +def main(): import argparse parser = argparse.ArgumentParser(description=__doc__, add_help=True) parser.add_argument('files', nargs='+', help='Matrix dump files') @@ -117,3 +121,7 @@ if __name__ == '__main__': args = parser.parse_args() compare_dump(args.files, args.output, marker=args.marker, markersize=args.markersize) + + +if __name__ == '__main__': + main() diff --git a/pyop2/utils.py b/pyop2/utils.py index 2f26741e14..2739c75f58 100644 --- a/pyop2/utils.py +++ b/pyop2/utils.py @@ -39,6 +39,7 @@ import numpy as np from decorator import decorator import argparse +import petsc4py from functools import cached_property # noqa: F401 @@ -304,19 +305,23 @@ def strip(code): def get_petsc_dir(): - try: - arch = '/' + os.environ.get('PETSC_ARCH', '') - dir = os.environ['PETSC_DIR'] - return (dir, dir + arch) - except KeyError: - try: - import petsc4py - config = petsc4py.get_config() - petsc_dir = config["PETSC_DIR"] - petsc_arch = config["PETSC_ARCH"] - return petsc_dir, petsc_dir + petsc_arch - except ImportError: - sys.exit("""Error: Could not find PETSc library. - -Set the environment variable PETSC_DIR to your local PETSc base -directory or install PETSc from PyPI: pip install petsc""") + """Attempts to find the PETSc directory on the system + """ + petsc_config = petsc4py.get_config() + petsc_dir = petsc_config["PETSC_DIR"] + petsc_arch = petsc_config["PETSC_ARCH"] + pathlist = [petsc_dir] + if petsc_arch: + pathlist.append(os.path.join(petsc_dir, petsc_arch)) + return tuple(pathlist) + + +def get_petsc_variables(): + """Attempts obtain a dictionary of PETSc configuration settings + """ + path = [get_petsc_dir()[-1], "lib/petsc/conf/petscvariables"] + variables_path = os.path.join(*path) + with open(variables_path) as fh: + # Split lines on first '=' (assignment) + splitlines = (line.split("=", maxsplit=1) for line in fh.readlines()) + return {k.strip(): v.strip() for k, v in splitlines} diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000000..7288538a2c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,98 @@ +[project] +name = "firedrake" +version = "0.14_dev" +description = "An automated system for the portable solution of partial differential equations using the finite element method" +readme = "README.rst" +license = {file = "LICENSE"} +maintainers = [ + {name = "Pablo D. Brubeck"}, + {name = "Daiane I. Dolci"}, + {name = "David A. Ham", email = "david.ham@imperial.ac.uk"}, + {name = "Josh Hope-Collins"}, + {name = "Koki Sagiyama"}, + {name = "Connor J. Ward", email = "c.ward20@imperial.ac.uk"}, +] +requires-python = ">=3.10" +dependencies = [ + "cachetools", + "decorator<=4.4.2", + "mpi4py", + "h5py", + "petsc4py", + "numpy>=2.0", + "packaging", + "pkgconfig", + "progress", + "pycparser", + "pytools", + "requests", + "rtree>=1.2", + "scipy", + "sympy", + "fenics-ufl @ git+https://github.com/firedrakeproject/ufl.git", + "fenics-fiat @ git+https://github.com/firedrakeproject/fiat.git", + "finat @ git+https://github.com/FInAT/FInAT.git", + "tsfc @ git+https://github.com/firedrakeproject/tsfc.git", + "pyadjoint-ad @ git+https://github.com/dolfin-adjoint/pyadjoint.git", + "loopy @ git+https://github.com/firedrakeproject/loopy.git@main", +] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)", + "Intended Audience :: Science/Research", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Operating System :: Unix", +] + +[project.urls] +Homepage = "https://firedrakeproject.org" +Repository = "https://github.com/firedrakeproject/firedrake" +Issues = "https://github.com/firedrakeproject/firedrake/issues/new/choose" + +[project.scripts] +firedrake-clean = "firedrake.scripts.firedrake_clean:main" +firedrake-preprocess-bibtex = "firedrake.scripts.firedrake_preprocess_bibtex:main" +firedrake-status = "firedrake.scripts.firedrake_status:main" +pyop2-clean = "pyop2.compilation:clear_compiler_disk_cache" +spydump = "pyop2.scripts.spydump:main" + +[project.optional-dependencies] +test = [ + "pylit", + "nbval", + "pytest", + "pytest-xdist", + "pytest-mpi @ git+https://github.com/firedrakeproject/pytest-mpi.git@main", +] +dev = [ + "flake8", + "pylint", +] +docs = [ + "sphinx", + "sphinx-autobuild", + "sphinxcontrib-bibtex", + "sphinxcontrib-svg2pdfconverter", + "sphinxcontrib-jquery", + "bibtexparser", + "sphinxcontrib-youtube", + "numpydoc", +] + +[build-system] +requires = [ + "setuptools>61.2", + "Cython>=3.0", + "pybind11", + "pkgconfig", + "numpy>=2.0", + "mpi4py", + "petsc4py", + "rtree>=1.2", +] +build-backend = "setuptools.build_meta" diff --git a/requirements-git.txt b/requirements-git.txt index 64586e2253..c037220ed1 100644 --- a/requirements-git.txt +++ b/requirements-git.txt @@ -1,8 +1,8 @@ -git+https://github.com/firedrakeproject/ufl.git#egg=ufl -git+https://github.com/firedrakeproject/fiat.git#egg=fiat +git+https://github.com/firedrakeproject/ufl.git#egg=fenics-ufl +git+https://github.com/firedrakeproject/fiat.git#egg=fenics-fiat git+https://github.com/FInAT/FInAT.git#egg=finat git+https://github.com/firedrakeproject/tsfc.git#egg=tsfc -git+https://github.com/dolfin-adjoint/pyadjoint.git#egg=pyadjoint -git+https://github.com/firedrakeproject/petsc.git@firedrake#egg=petsc +git+https://github.com/dolfin-adjoint/pyadjoint.git#egg=pyadjoint-ad git+https://github.com/firedrakeproject/loopy.git@main#egg=loopy git+https://github.com/firedrakeproject/pytest-mpi.git@main#egg=pytest-mpi +git+https://github.com/firedrakeproject/petsc.git@firedrake#egg=petsc diff --git a/scripts/firedrake-clean b/scripts/firedrake-clean deleted file mode 100755 index 99f700d10b..0000000000 --- a/scripts/firedrake-clean +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env python3 -if __name__ == '__main__': - import os - import shutil - import tempfile - import firedrake_configuration - try: - import platformdirs as appdirs - except ImportError: - import appdirs - - firedrake_configuration.setup_cache_dirs() - tsfc_cache = os.environ.get('FIREDRAKE_TSFC_KERNEL_CACHE_DIR', - os.path.join(tempfile.gettempdir(), - 'firedrake-tsfc-kernel-cache-uid%d' % os.getuid())) - pyop2_cache = os.environ.get('PYOP2_CACHE_DIR', - os.path.join(tempfile.gettempdir(), - 'pyop2-cache-uid%d' % os.getuid())) - pytools_cache = appdirs.user_cache_dir("pytools", "pytools") - print('Removing cached TSFC kernels from %s' % tsfc_cache) - print('Removing cached PyOP2 code from %s' % pyop2_cache) - print('Removing cached pytools files from %s' % pytools_cache) - for cache in [tsfc_cache, pyop2_cache, pytools_cache]: - if os.path.exists(cache): - shutil.rmtree(cache, ignore_errors=True) diff --git a/scripts/firedrake-preprocess-bibtex b/scripts/firedrake-preprocess-bibtex deleted file mode 100755 index cad231830a..0000000000 --- a/scripts/firedrake-preprocess-bibtex +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env python3 -import io -from argparse import ArgumentParser, RawDescriptionHelpFormatter -try: - from bibtexparser.bwriter import BibTexWriter - import bibtexparser -except ImportError: - raise ImportError("Failed to import bibtexparser. Run:\n firedrake-update --documentation-dependencies") - - -parser = ArgumentParser(description="""Ensure BibTeX entries for inclusion in the Firedrake website have a -URL or DOI, and impose clean formatting.""", - formatter_class=RawDescriptionHelpFormatter) -parser.add_argument("bibtex_file", help="The BibTeX file to process") -parser.add_argument("--validate", action='store_true', - help="Instead of rewriting the bibtex file, raise an exception if anything would have changed.") - -args = parser.parse_args() - -filename = args.bibtex_file - -parser = bibtexparser.bparser.BibTexParser() -parser.common_strings = True -parser.ignore_nonstandard_types = False - -with open(filename) as bibtex_file: - bib_database = parser.parse_file(bibtex_file) - -for entry in bib_database.entries: - if "url" not in entry and \ - "doi" not in entry: - if entry.get("archiveprefix", None) == "arXiv": - entry["url"] = "https://arxiv.org/abs/" + entry["eprint"] - else: - raise ValueError("%s in bibliograpy %s\n has no url and no DOI.\n" % (entry["ID"], filename)) - -writer = BibTexWriter() -writer.indent = ' ' # indent entries with 2 spaces instead of one -writer.align_values = True - -if args.validate: - with io.StringIO() as outbuffer: - outbuffer.write(writer.write(bib_database)) - processed = outbuffer.getvalue() - with open(filename) as bibtex_file: - inbuffer = bibtex_file.read() - if processed != inbuffer: - raise ValueError("%s would be changed by firedrake-preprocess-bibtex. Please preprocess it and commit the result" % filename) - -else: - with open(filename, 'w') as bibfile: - bibfile.write(writer.write(bib_database)) diff --git a/scripts/firedrake-status b/scripts/firedrake-status deleted file mode 100755 index af7a0c58b5..0000000000 --- a/scripts/firedrake-status +++ /dev/null @@ -1,142 +0,0 @@ -#! /usr/bin/env python3 -from six import iteritems - -from argparse import ArgumentParser, RawDescriptionHelpFormatter -from pprint import pformat -import logging -import sys -import os -import subprocess -from collections import OrderedDict, defaultdict - -parser = ArgumentParser(description="""Provide information on the currently downloaded version of Firedrake and its configuration. -This is particularly useful information to include when reporting bugs.""", - formatter_class=RawDescriptionHelpFormatter) -parser.add_argument("--log", action='store_true', - help="Log the output of the script to firedrake-status.log as well as to the console.") - - -args = parser.parse_args() - -# Set up logging -if args.log: - logging.basicConfig(level=logging.DEBUG, - format='%(asctime)s %(levelname)-6s %(message)s', - filename='firedrake-status.log', - filemode='w') - console = logging.StreamHandler() - console.setLevel(logging.WARNING) - formatter = logging.Formatter('%(message)s') - console.setFormatter(formatter) - logging.getLogger().addHandler(console) -else: - logging.basicConfig(level=logging.WARNING, - format='%(message)s') -log = logging.getLogger() - - -def check_output(args, env=None): - return subprocess.check_output(args, stderr=subprocess.STDOUT, env=env) - - -def quit(message): - log.error(message) - sys.exit(1) - - -try: - firedrake_env = os.environ["VIRTUAL_ENV"] -except KeyError: - quit("Unable to retrieve virtualenv name from the environment.\n Please ensure the virtualenv is active before running firedrake-update.") - - -try: - import firedrake_configuration -except ImportError: - log.info("Failed to import firedrake_configuration module") - config = defaultdict(dict) -else: - config = firedrake_configuration.get_config() - -try: - config["system"] = check_output(["uname", "-a"]) -except subprocess.CalledProcessError: - log.error("Failed to retrieve system information.") - - -print("Firedrake Configuration:") -if not config: - print("No configuration information found.") -else: - for key, val in iteritems(config["options"]): - print(" {}: {}".format(key, val)) - - print("Additions:") - if config["additions"]: - for a in config["additions"]: - print(" " + a) - else: - print(" None") - -for var in ["PYTHONPATH", "PETSC_ARCH", "PETSC_DIR"]: - config["environment"][var] = os.environ.get(var, None) - -print("Environment:") -for key, val in iteritems(config["environment"]): - print(" {}: {}".format(key, val)) - -status = OrderedDict() -for dir in sorted(os.listdir(firedrake_env + "/src")): - try: - os.chdir(firedrake_env + "/src/" + dir) - except OSError as e: - if e.errno == 20: - # Not a directory - continue - else: - raise - try: - revision = check_output(["git", "rev-parse", "--short", "HEAD"]).decode('ascii').strip() - branch = check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"]).decode('ascii').strip() - except subprocess.CalledProcessError: - log.error("Unable to retrieve git information from %s." % dir) - else: - try: - _ = check_output(["git", "diff-index", "--quiet", "HEAD"]) - modified = False - except subprocess.CalledProcessError: - modified = True - - status[dir] = {"branch": branch, - "revision": revision, - "modified": modified} - -status_string = "" -status_string += "Status of components:\n" -componentformat = "|{:20}|{:30}|{:10}|{!s:10}|\n" -header = componentformat.format("Package", "Branch", "Revision", "Modified") -line = "-" * (len(header) - 1) + "\n" -status_string += line + header + line -for dir, d in iteritems(status): - status_string += componentformat.format(dir, d["branch"], d["revision"], d["modified"]) -status_string += line - -print(status_string) -log.info("\n" + status_string) - -log.info("Firedrake configuration: ") -log.info(pformat(config)) -log.debug("\nPip packages installed:") -try: - log.debug(check_output(["pip", "freeze"])) -except subprocess.CalledProcessError: - log.error("""Failed to retrieve list of pip installed packages. Try running: - - pip freeze. - -""") -log.debug("\n Full environment:") -try: - log.debug(check_output(["env"])) -except subprocess.CalledProcessError: - log.error("""Shell command env failed.""") diff --git a/scripts/pyop2-clean b/scripts/pyop2-clean deleted file mode 100755 index 52f667ec4e..0000000000 --- a/scripts/pyop2-clean +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env python -from pyop2.compilation import clear_compiler_disk_cache - - -if __name__ == '__main__': - clear_compiler_disk_cache(prompt=True) diff --git a/setup.cfg b/setup.cfg index d9fa8e08a3..165a3bc775 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,17 +1,3 @@ - -# See the docstring in versioneer.py for instructions. Note that you must -# re-run 'versioneer.py setup' after changing this section, and commit the -# resulting files. - -[versioneer] -VCS = git -style = pep440 -versionfile_source = firedrake/_version.py -versionfile_build = firedrake/_version.py -tag_prefix = v -parentdir_prefix = firedrake- - - [flake8] ignore = E501,F403,F405,E226,E402,E721,E731,E741,W503,F999, diff --git a/setup.py b/setup.py index 7d4c12fe14..36a5fe5082 100644 --- a/setup.py +++ b/setup.py @@ -1,49 +1,50 @@ -from setuptools import setup, find_packages +from dataclasses import dataclass, field +from setuptools import setup, find_packages, Extension from glob import glob -from os import environ as env, path from pathlib import Path -from Cython.Distutils import build_ext +from Cython.Build import cythonize import os import sys +import site import numpy as np +import pybind11 import petsc4py import rtree -import versioneer +import pkgconfig -from firedrake_configuration import get_config +# Define the compilers to use if not already set +if "CC" not in os.environ: + os.environ["CC"] = os.environ.get("MPICC", "mpicc") +if "CXX" not in os.environ: + os.environ["CXX"] = os.environ.get("MPICXX", "mpicxx") -try: - from Cython.Distutils.extension import Extension - config = get_config() - complex_mode = config["options"].get("complex", False) -except ImportError: - # No Cython Extension means no complex mode! - from setuptools import Extension - complex_mode = False -try: - from pybind11.setup_helpers import Pybind11Extension -except ImportError: - Pybind11Extension = Extension +petsc_config = petsc4py.get_config() def get_petsc_dir(): - try: - petsc_dir = os.environ["PETSC_DIR"] - petsc_arch = os.environ.get("PETSC_ARCH", "") - except KeyError: - try: - petsc_dir = os.path.join(os.environ["VIRTUAL_ENV"], "src", "petsc") - petsc_arch = "default" - except KeyError: - sys.exit("""Error: Firedrake venv not active.""") - - return (petsc_dir, path.join(petsc_dir, petsc_arch)) - - -cmdclass = versioneer.get_cmdclass() -cmdclass["build_ext"] = build_ext - + """Attempts to find the PETSc directory on the system + """ + petsc_dir = petsc_config["PETSC_DIR"] + petsc_arch = petsc_config["PETSC_ARCH"] + pathlist = [petsc_dir] + if petsc_arch: + pathlist.append(os.path.join(petsc_dir, petsc_arch)) + return pathlist + + +def get_petsc_variables(): + """Attempts obtain a dictionary of PETSc configuration settings + """ + path = [get_petsc_dir()[-1], "lib/petsc/conf/petscvariables"] + variables_path = os.path.join(*path) + with open(variables_path) as fh: + # Split lines on first '=' (assignment) + splitlines = (line.split("=", maxsplit=1) for line in fh.readlines()) + return {k.strip(): v.strip() for k, v in splitlines} + + +# TODO: This is deprecated behaviour, what to do?: if "clean" in sys.argv[1:]: # Forcibly remove the results of Cython. for dirname, dirs, files in os.walk("firedrake"): @@ -53,222 +54,192 @@ def get_petsc_dir(): or ext == ".so"): os.remove(os.path.join(dirname, f)) -cython_compile_time_env = {"COMPLEX": complex_mode} -cythonfiles = [ - ("dmcommon", ["petsc"]), - ("extrusion_numbering", ["petsc"]), - ("hdf5interface", ["petsc"]), - ("mgimpl", ["petsc"]), - ("patchimpl", ["petsc"]), - ("spatialindex", None), - ("supermeshimpl", ["supermesh", "petsc"]), -] +@dataclass +class ExternalDependency: + ''' This dataclass stores the relevant information for the compiler as fields + that correspond to the keyword arguments of `Extension`. For convenience it + also implements addition and `**` unpacking. + ''' + include_dirs: list[str] = field(default_factory=list, init=True) + extra_compile_args: list[str] = field(default_factory=list, init=True) + libraries: list[str] = field(default_factory=list, init=True) + library_dirs: list[str] = field(default_factory=list, init=True) + extra_link_args: list[str] = field(default_factory=list, init=True) + runtime_library_dirs: list[str] = field(default_factory=list, init=True) + + def __add__(self, other): + combined = {} + for f in self.__dataclass_fields__.keys(): + combined[f] = getattr(self, f) + getattr(other, f) + return self.__class__(**combined) + + def keys(self): + return self.__dataclass_fields__.keys() + + def __getitem__(self, key): + try: + return getattr(self, key) + except AttributeError: + raise KeyError(f"Key {key} not present") -petsc_dirs = get_petsc_dir() -if os.environ.get("HDF5_DIR"): - petsc_dirs = petsc_dirs + (os.environ.get("HDF5_DIR"), ) -include_dirs = [np.get_include(), rtree.finder.get_include()] -petsc_include = [petsc4py.get_include()] + [os.path.join(d, "include") for d in petsc_dirs] -include_dirs += petsc_include -petsc_library = [os.path.join(petsc_dirs[1], "lib")] -dirs = (sys.prefix, *petsc_dirs) -link_args = ["-L%s/lib" % d for d in dirs] + ["-Wl,-rpath,%s/lib" % d for d in dirs] +# Pybind11 +# example: +# gcc -I/pyind11/include ... +pybind11_ = ExternalDependency(include_dirs=[pybind11.get_include()]) + +# numpy +# example: +# gcc -I/numpy/include ... +numpy_ = ExternalDependency(include_dirs=[np.get_include()]) + +# PETSc +# example: +# gcc -I$PETSC_DIR/include -I$PETSC_DIR/$PETSC_ARCH/include -I/petsc4py/include +# gcc -L$PETSC_DIR/$PETSC_ARCH/lib -lpetsc -Wl,-rpath,$PETSC_DIR/$PETSC_ARCH/lib +petsc_dirs = get_petsc_dir() +petsc_ = ExternalDependency( + libraries=["petsc"], + include_dirs=[petsc4py.get_include()] + [os.path.join(d, "include") for d in petsc_dirs], + library_dirs=[os.path.join(petsc_dirs[-1], "lib")], + runtime_library_dirs=[os.path.join(petsc_dirs[-1], "lib")], +) +petsc_variables = get_petsc_variables() +petsc_hdf5_compile_args = petsc_variables.get("HDF5_INCLUDE", "") +petsc_hdf5_link_args = petsc_variables.get("HDF5_LIB", "") + +# HDF5 +# example: +# gcc -I$HDF5_DIR/include +# gcc -L$HDF5_DIR/lib -lhdf5 +if petsc_hdf5_link_args and petsc_hdf5_compile_args: + # We almost always want to be in this first case!!! + # PETSc variables only contains the compile/link args, not the paths + hdf5_ = ExternalDependency( + extra_compile_args = petsc_hdf5_compile_args.split(), + extra_link_args = petsc_hdf5_link_args.split() + ) +elif os.environ.get("HDF5_DIR"): + hdf5_dir = Path(os.environ.get("HDF5_DIR")) + hdf5_ = ExternalDependency( + libraries=["hdf5"], + include_dirs = [str(hdf5_dir.joinpath("include"))], + library_dirs = [str(hdf5_dir.joinpath("lib"))] + ) +elif pkgconfig.exists("hdf5"): + hdf5_ = ExternalDependency(**pkgconfig.parse("hdf5")) +else: + # Set the library name and hope for the best + hdf5_ = ExternalDependency(libraries=["hdf5"]) + +# Note: +# In the next 2 linkages we are using `site.getsitepackages()[0]`, which isn't +# guaranteed to be the correct place we could also use "$ORIGIN/../../lib_dir", +# but that definitely doesn't work with editable installs. + +# libspatialindex +# example: +# gcc -I/rtree/include +# gcc /rtree.libs/libspatialindex.so -Wl,-rpath,$ORIGIN/../../Rtree.libs libspatialindex_so = Path(rtree.core.rt._name).absolute() -link_args += [str(libspatialindex_so)] -link_args += ["-Wl,-rpath,%s" % libspatialindex_so.parent] +spatialindex_ = ExternalDependency( + include_dirs=[rtree.finder.get_include()], + extra_link_args=[str(libspatialindex_so)], + runtime_library_dirs=[os.path.join(site.getsitepackages()[0], "Rtree.libs")] +) + +# libsupermesh +# example: +# gcc -I/supermesh/include +# gcc /supermesh/supermesh.cpython-311-x86_64-linux-gnu.so \ +# -lsupermesh \ +# -Wl,-rpath,$ORIGIN/../../supermesh +supermesh_ = ExternalDependency( + include_dirs=[f"{sys.prefix}/include"], + library_dirs=[f"{sys.prefix}/lib"], + libraries=["supermesh"], + runtime_library_dirs=[f"{sys.prefix}/lib"], +) -extensions = [ - Extension( - "firedrake.cython.{}".format(ext), - sources=[os.path.join("firedrake", "cython", "{}.pyx".format(ext))], - include_dirs=include_dirs, - libraries=libs, - extra_link_args=link_args, - cython_compile_time_env=cython_compile_time_env - ) for (ext, libs) in cythonfiles -] + [ - Pybind11Extension( +# The following extensions need to be linked accordingly: +def extensions(): + ## CYTHON EXTENSIONS + cython_list = [] + # firedrake/cython/dmcommon.pyx: petsc, numpy + cython_list.append(Extension( + name="firedrake.cython.dmcommon", + language="c", + sources=[os.path.join("firedrake", "cython", "dmcommon.pyx")], + **(petsc_ + numpy_) + )) + # firedrake/cython/extrusion_numbering.pyx: petsc, numpy + cython_list.append(Extension( + name="firedrake.cython.extrusion_numbering", + language="c", + sources=[os.path.join("firedrake", "cython", "extrusion_numbering.pyx")], + **(petsc_ + numpy_) + )) + # firedrake/cython/hdf5interface.pyx: petsc, numpy, hdf5 + cython_list.append(Extension( + name="firedrake.cython.hdf5interface", + language="c", + sources=[os.path.join("firedrake", "cython", "hdf5interface.pyx")], + **(petsc_ + numpy_ + hdf5_) + )) + # firedrake/cython/mgimpl.pyx: petsc, numpy + cython_list.append(Extension( + name="firedrake.cython.mgimpl", + language="c", + sources=[os.path.join("firedrake", "cython", "mgimpl.pyx")], + **(petsc_ + numpy_) + )) + # firedrake/cython/patchimpl.pyx: petsc, numpy + cython_list.append(Extension( + name="firedrake.cython.patchimpl", + language="c", + sources=[os.path.join("firedrake", "cython", "patchimpl.pyx")], + **(petsc_ + numpy_) + )) + # firedrake/cython/spatialindex.pyx: numpy, spatialindex + cython_list.append(Extension( + name="firedrake.cython.spatialindex", + language="c", + sources=[os.path.join("firedrake", "cython", "spatialindex.pyx")], + **(numpy_ + spatialindex_) + )) + # firedrake/cython/supermeshimpl.pyx: petsc, numpy, supermesh + cython_list.append(Extension( + name="firedrake.cython.supermeshimpl", + language="c", + sources=[os.path.join("firedrake", "cython", "supermeshimpl.pyx")], + **(petsc_ + numpy_ + supermesh_) + )) + # pyop2/sparsity.pyx: petsc, numpy, + cython_list.append(Extension( + name="pyop2.sparsity", + language="c", + sources=[os.path.join("pyop2", "sparsity.pyx")], + **(petsc_ + numpy_) + )) + ## PYBIND11 EXTENSIONS + pybind11_list = [] + # tinyasm/tinyasm.cpp: petsc, pybind11 + # tinyasm/tinyasm.cpp: petsc, pybind11 + pybind11_list.append(Extension( name="tinyasm._tinyasm", + language="c++", sources=sorted(glob("tinyasm/*.cpp")), # Sort source files for reproducibility - include_dirs=petsc_include, - library_dirs=petsc_library, - extra_compile_args=["-std=c++11",], - extra_link_args=["-lpetsc",], - runtime_library_dirs=petsc_library, - ) -] - -if "CC" not in env: - env["CC"] = "mpicc" + **(petsc_ + pybind11_) + )) + return cythonize(cython_list) + pybind11_list setup( - name="firedrake", - version=versioneer.get_version(), - cmdclass=cmdclass, - description="An automated finite element system.", - long_description="""Firedrake is an automated system for the portable - solution of partial differential equations using the finite element - method (FEM)""", - author="Imperial College London and others", - author_email="firedrake@imperial.ac.uk", - url="http://firedrakeproject.org", packages=find_packages(), - package_data={"firedrake": ["evaluate.h", "locate.c", "icons/*.png"]}, - scripts=glob("scripts/*"), - ext_modules=extensions + package_data={ + "firedrake": ["evaluate.h", "locate.c", "icons/*.png"], + "pyop2": ["assets/*", "*.h", "*.pxd", "*.pyx", "codegen/c/*.c"] + }, + ext_modules=extensions() ) - - -#!/usr/bin/env python -# -# This file is part of PyOP2 -# -# PyOP2 is Copyright (c) 2012, Imperial College London and -# others. Please see the AUTHORS file in the main source directory for -# a full list of copyright holders. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * The name of Imperial College London or that of other -# contributors may not be used to endorse or promote products -# derived from this software without specific prior written -# permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTERS -# ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -# OF THE POSSIBILITY OF SUCH DAMAGE. - -# from setuptools import setup, Extension -# from glob import glob -# from os import environ as env -# import sys -# import numpy as np -# import petsc4py -# import versioneer -# import os -# -# -# def get_petsc_dir(): -# arch = '/' + env.get('PETSC_ARCH', '') -# dir = env['PETSC_DIR'] -# return (dir, dir + arch) -# except KeyError: -# try: -# import petsc -# return (petsc.get_petsc_dir(), ) -# except ImportError: -# sys.exit("""Error: Could not find PETSc library. -# -# Set the environment variable PETSC_DIR to your local PETSc base -# directory or install PETSc from PyPI: pip install petsc""") -# -# -# cmdclass = versioneer.get_cmdclass() -# _sdist = cmdclass['sdist'] -# -# if "clean" in sys.argv[1:]: -# # Forcibly remove the results of Cython. -# for dirname, dirs, files in os.walk("pyop2"): -# for f in files: -# base, ext = os.path.splitext(f) -# if ext in (".c", ".cpp", ".so") and base + ".pyx" in files: -# os.remove(os.path.join(dirname, f)) -# -# # If Cython is available, built the extension module from the Cython source -# try: -# from Cython.Distutils import build_ext -# cmdclass['build_ext'] = build_ext -# sparsity_sources = ['pyop2/sparsity.pyx'] -# # Else we require the Cython-compiled .c file to be present and use that -# # Note: file is not in revision control but needs to be included in distributions -# except ImportError: -# sparsity_sources = ['pyop2/sparsity.c'] -# sources = sparsity_sources -# from os.path import exists -# if not all([exists(f) for f in sources]): -# raise ImportError("Installing from source requires Cython") -# -# -# install_requires = [ -# 'decorator', -# 'mpi4py', -# 'numpy>=1.6', -# 'pytools', -# ] -# -# version = sys.version_info[:2] -# -# if version < (3, 6): -# raise ValueError("Python version >= 3.6 required") -# -# test_requires = [ -# 'flake8>=2.1.0', -# 'pytest>=2.3', -# ] -# -# petsc_dirs = get_petsc_dir() -# numpy_includes = [np.get_include()] -# includes = numpy_includes + [petsc4py.get_include()] -# includes += ["%s/include" % d for d in petsc_dirs] -# -# if 'CC' not in env: -# env['CC'] = "mpicc" -# -# -# class sdist(_sdist): -# def run(self): -# # Make sure the compiled Cython files in the distribution are up-to-date -# from Cython.Build import cythonize -# cythonize(sparsity_sources, language="c", include_path=includes) -# _sdist.run(self) -# -# -# cmdclass['sdist'] = sdist -# -# setup(name='PyOP2', -# version=versioneer.get_version(), -# description='Framework for performance-portable parallel computations on unstructured meshes', -# author='Imperial College London and others', -# author_email='mapdes@imperial.ac.uk', -# url='https://github.com/OP2/PyOP2/', -# classifiers=[ -# 'Development Status :: 3 - Alpha', -# 'Intended Audience :: Developers', -# 'Intended Audience :: Science/Research', -# 'License :: OSI Approved :: BSD License', -# 'Operating System :: OS Independent', -# 'Programming Language :: C', -# 'Programming Language :: Cython', -# 'Programming Language :: Python :: 3', -# 'Programming Language :: Python :: 3.6', -# ], -# install_requires=install_requires + test_requires, -# packages=['pyop2', 'pyop2.codegen', 'pyop2.types'], -# package_data={ -# 'pyop2': ['assets/*', '*.h', '*.pxd', '*.pyx', 'codegen/c/*.c']}, -# scripts=glob('scripts/*'), -# cmdclass=cmdclass, -# ext_modules=[Extension('pyop2.sparsity', sparsity_sources, -# include_dirs=['pyop2'] + includes, language="c", -# libraries=["petsc"], -# extra_link_args=(["-L%s/lib" % d for d in petsc_dirs] -# + ["-Wl,-rpath,%s/lib" % d for d in petsc_dirs]))]) diff --git a/tests/conftest.py b/tests/firedrake/conftest.py similarity index 100% rename from tests/conftest.py rename to tests/firedrake/conftest.py diff --git a/tests/demos/test_demos_run.py b/tests/firedrake/demos/test_demos_run.py similarity index 99% rename from tests/demos/test_demos_run.py rename to tests/firedrake/demos/test_demos_run.py index bba22b91f4..9d6fdb9a3f 100644 --- a/tests/demos/test_demos_run.py +++ b/tests/firedrake/demos/test_demos_run.py @@ -17,7 +17,7 @@ CWD = abspath(dirname(__file__)) -DEMO_DIR = join(CWD, "..", "..", "demos") +DEMO_DIR = join(CWD, "..", "..", "..", "demos") SERIAL_DEMOS = [ Demo(("benney_luke", "benney_luke"), ["vtk"]), diff --git a/tests/demos/test_notebooks_run.py b/tests/firedrake/demos/test_notebooks_run.py similarity index 94% rename from tests/demos/test_notebooks_run.py rename to tests/firedrake/demos/test_notebooks_run.py index 8a415eab76..036521cebd 100644 --- a/tests/demos/test_notebooks_run.py +++ b/tests/firedrake/demos/test_notebooks_run.py @@ -12,7 +12,7 @@ cwd = os.path.abspath(os.path.dirname(__file__)) -nb_dir = os.path.join(cwd, "..", "..", "docs", "notebooks") +nb_dir = os.path.join(cwd, "..", "..", "..", "docs", "notebooks") # Discover the notebook files by globbing the notebook directory diff --git a/tests/ensemble_reduced_functional/test_reduced_functional.py b/tests/firedrake/ensemble_reduced_functional/test_reduced_functional.py similarity index 100% rename from tests/ensemble_reduced_functional/test_reduced_functional.py rename to tests/firedrake/ensemble_reduced_functional/test_reduced_functional.py diff --git a/tests/equation_bcs/test_bcs_reconstruct.py b/tests/firedrake/equation_bcs/test_bcs_reconstruct.py similarity index 100% rename from tests/equation_bcs/test_bcs_reconstruct.py rename to tests/firedrake/equation_bcs/test_bcs_reconstruct.py diff --git a/tests/equation_bcs/test_equation_bcs.py b/tests/firedrake/equation_bcs/test_equation_bcs.py similarity index 100% rename from tests/equation_bcs/test_equation_bcs.py rename to tests/firedrake/equation_bcs/test_equation_bcs.py diff --git a/tests/equation_bcs/test_equation_bcs_assemble.py b/tests/firedrake/equation_bcs/test_equation_bcs_assemble.py similarity index 100% rename from tests/equation_bcs/test_equation_bcs_assemble.py rename to tests/firedrake/equation_bcs/test_equation_bcs_assemble.py diff --git a/tests/external_operators/test_abstract_external_operator.py b/tests/firedrake/external_operators/test_abstract_external_operator.py similarity index 100% rename from tests/external_operators/test_abstract_external_operator.py rename to tests/firedrake/external_operators/test_abstract_external_operator.py diff --git a/tests/external_operators/test_external_operators.py b/tests/firedrake/external_operators/test_external_operators.py similarity index 100% rename from tests/external_operators/test_external_operators.py rename to tests/firedrake/external_operators/test_external_operators.py diff --git a/tests/external_operators/test_external_operators_adjoint.py b/tests/firedrake/external_operators/test_external_operators_adjoint.py similarity index 100% rename from tests/external_operators/test_external_operators_adjoint.py rename to tests/firedrake/external_operators/test_external_operators_adjoint.py diff --git a/tests/external_operators/test_jax_operator.py b/tests/firedrake/external_operators/test_jax_operator.py similarity index 100% rename from tests/external_operators/test_jax_operator.py rename to tests/firedrake/external_operators/test_jax_operator.py diff --git a/tests/external_operators/test_pytorch_operator.py b/tests/firedrake/external_operators/test_pytorch_operator.py similarity index 100% rename from tests/external_operators/test_pytorch_operator.py rename to tests/firedrake/external_operators/test_pytorch_operator.py diff --git a/tests/extrusion/conftest.py b/tests/firedrake/extrusion/conftest.py similarity index 100% rename from tests/extrusion/conftest.py rename to tests/firedrake/extrusion/conftest.py diff --git a/tests/extrusion/test_2d_cohomology.py b/tests/firedrake/extrusion/test_2d_cohomology.py similarity index 100% rename from tests/extrusion/test_2d_cohomology.py rename to tests/firedrake/extrusion/test_2d_cohomology.py diff --git a/tests/extrusion/test_annulus.py b/tests/firedrake/extrusion/test_annulus.py similarity index 100% rename from tests/extrusion/test_annulus.py rename to tests/firedrake/extrusion/test_annulus.py diff --git a/tests/extrusion/test_assembly.py b/tests/firedrake/extrusion/test_assembly.py similarity index 100% rename from tests/extrusion/test_assembly.py rename to tests/firedrake/extrusion/test_assembly.py diff --git a/tests/extrusion/test_bcs_interior_facet.py b/tests/firedrake/extrusion/test_bcs_interior_facet.py similarity index 100% rename from tests/extrusion/test_bcs_interior_facet.py rename to tests/firedrake/extrusion/test_bcs_interior_facet.py diff --git a/tests/extrusion/test_bdmc_extr.py b/tests/firedrake/extrusion/test_bdmc_extr.py similarity index 100% rename from tests/extrusion/test_bdmc_extr.py rename to tests/firedrake/extrusion/test_bdmc_extr.py diff --git a/tests/extrusion/test_cellvolume_extrusion.py b/tests/firedrake/extrusion/test_cellvolume_extrusion.py similarity index 100% rename from tests/extrusion/test_cellvolume_extrusion.py rename to tests/firedrake/extrusion/test_cellvolume_extrusion.py diff --git a/tests/extrusion/test_cylinder.py b/tests/firedrake/extrusion/test_cylinder.py similarity index 100% rename from tests/extrusion/test_cylinder.py rename to tests/firedrake/extrusion/test_cylinder.py diff --git a/tests/extrusion/test_dg_coords.py b/tests/firedrake/extrusion/test_dg_coords.py similarity index 100% rename from tests/extrusion/test_dg_coords.py rename to tests/firedrake/extrusion/test_dg_coords.py diff --git a/tests/extrusion/test_embedded_sphere_extrusion.py b/tests/firedrake/extrusion/test_embedded_sphere_extrusion.py similarity index 100% rename from tests/extrusion/test_embedded_sphere_extrusion.py rename to tests/firedrake/extrusion/test_embedded_sphere_extrusion.py diff --git a/tests/extrusion/test_enrichment_1_feec.py b/tests/firedrake/extrusion/test_enrichment_1_feec.py similarity index 100% rename from tests/extrusion/test_enrichment_1_feec.py rename to tests/firedrake/extrusion/test_enrichment_1_feec.py diff --git a/tests/extrusion/test_extruded_cell_subdomains.py b/tests/firedrake/extrusion/test_extruded_cell_subdomains.py similarity index 100% rename from tests/extrusion/test_extruded_cell_subdomains.py rename to tests/firedrake/extrusion/test_extruded_cell_subdomains.py diff --git a/tests/extrusion/test_extruded_periodic.py b/tests/firedrake/extrusion/test_extruded_periodic.py similarity index 100% rename from tests/extrusion/test_extruded_periodic.py rename to tests/firedrake/extrusion/test_extruded_periodic.py diff --git a/tests/extrusion/test_facet_avg_extruded.py b/tests/firedrake/extrusion/test_facet_avg_extruded.py similarity index 100% rename from tests/extrusion/test_facet_avg_extruded.py rename to tests/firedrake/extrusion/test_facet_avg_extruded.py diff --git a/tests/extrusion/test_facet_integrals_2D.py b/tests/firedrake/extrusion/test_facet_integrals_2D.py similarity index 100% rename from tests/extrusion/test_facet_integrals_2D.py rename to tests/firedrake/extrusion/test_facet_integrals_2D.py diff --git a/tests/extrusion/test_facet_integrals_3D.py b/tests/firedrake/extrusion/test_facet_integrals_3D.py similarity index 100% rename from tests/extrusion/test_facet_integrals_3D.py rename to tests/firedrake/extrusion/test_facet_integrals_3D.py diff --git a/tests/extrusion/test_facet_support_dofs.py b/tests/firedrake/extrusion/test_facet_support_dofs.py similarity index 100% rename from tests/extrusion/test_facet_support_dofs.py rename to tests/firedrake/extrusion/test_facet_support_dofs.py diff --git a/tests/extrusion/test_fs_abbreviations.py b/tests/firedrake/extrusion/test_fs_abbreviations.py similarity index 100% rename from tests/extrusion/test_fs_abbreviations.py rename to tests/firedrake/extrusion/test_fs_abbreviations.py diff --git a/tests/extrusion/test_galerkinproj.py b/tests/firedrake/extrusion/test_galerkinproj.py similarity index 100% rename from tests/extrusion/test_galerkinproj.py rename to tests/firedrake/extrusion/test_galerkinproj.py diff --git a/tests/extrusion/test_helmholtz_scalar.py b/tests/firedrake/extrusion/test_helmholtz_scalar.py similarity index 100% rename from tests/extrusion/test_helmholtz_scalar.py rename to tests/firedrake/extrusion/test_helmholtz_scalar.py diff --git a/tests/extrusion/test_helmholtz_serendipity_2d.py b/tests/firedrake/extrusion/test_helmholtz_serendipity_2d.py similarity index 100% rename from tests/extrusion/test_helmholtz_serendipity_2d.py rename to tests/firedrake/extrusion/test_helmholtz_serendipity_2d.py diff --git a/tests/extrusion/test_helmholtz_serendipity_3d.py b/tests/firedrake/extrusion/test_helmholtz_serendipity_3d.py similarity index 100% rename from tests/extrusion/test_helmholtz_serendipity_3d.py rename to tests/firedrake/extrusion/test_helmholtz_serendipity_3d.py diff --git a/tests/extrusion/test_helmholtz_vector.py b/tests/firedrake/extrusion/test_helmholtz_vector.py similarity index 100% rename from tests/extrusion/test_helmholtz_vector.py rename to tests/firedrake/extrusion/test_helmholtz_vector.py diff --git a/tests/extrusion/test_identity_extrusion.py b/tests/firedrake/extrusion/test_identity_extrusion.py similarity index 100% rename from tests/extrusion/test_identity_extrusion.py rename to tests/firedrake/extrusion/test_identity_extrusion.py diff --git a/tests/extrusion/test_interior_facets_extr.py b/tests/firedrake/extrusion/test_interior_facets_extr.py similarity index 100% rename from tests/extrusion/test_interior_facets_extr.py rename to tests/firedrake/extrusion/test_interior_facets_extr.py diff --git a/tests/extrusion/test_interval.py b/tests/firedrake/extrusion/test_interval.py similarity index 100% rename from tests/extrusion/test_interval.py rename to tests/firedrake/extrusion/test_interval.py diff --git a/tests/extrusion/test_kernel_int_cube.py b/tests/firedrake/extrusion/test_kernel_int_cube.py similarity index 100% rename from tests/extrusion/test_kernel_int_cube.py rename to tests/firedrake/extrusion/test_kernel_int_cube.py diff --git a/tests/extrusion/test_kernel_int_p0.py b/tests/firedrake/extrusion/test_kernel_int_p0.py similarity index 100% rename from tests/extrusion/test_kernel_int_p0.py rename to tests/firedrake/extrusion/test_kernel_int_p0.py diff --git a/tests/extrusion/test_kernel_intas_p0.py b/tests/firedrake/extrusion/test_kernel_intas_p0.py similarity index 100% rename from tests/extrusion/test_kernel_intas_p0.py rename to tests/firedrake/extrusion/test_kernel_intas_p0.py diff --git a/tests/extrusion/test_kernel_intrhs.py b/tests/firedrake/extrusion/test_kernel_intrhs.py similarity index 100% rename from tests/extrusion/test_kernel_intrhs.py rename to tests/firedrake/extrusion/test_kernel_intrhs.py diff --git a/tests/extrusion/test_kernel_intvar_p0.py b/tests/firedrake/extrusion/test_kernel_intvar_p0.py similarity index 100% rename from tests/extrusion/test_kernel_intvar_p0.py rename to tests/firedrake/extrusion/test_kernel_intvar_p0.py diff --git a/tests/extrusion/test_laplace_neumann.py b/tests/firedrake/extrusion/test_laplace_neumann.py similarity index 100% rename from tests/extrusion/test_laplace_neumann.py rename to tests/firedrake/extrusion/test_laplace_neumann.py diff --git a/tests/extrusion/test_layer_height_mesh_volume.py b/tests/firedrake/extrusion/test_layer_height_mesh_volume.py similarity index 100% rename from tests/extrusion/test_layer_height_mesh_volume.py rename to tests/firedrake/extrusion/test_layer_height_mesh_volume.py diff --git a/tests/extrusion/test_meshes.py b/tests/firedrake/extrusion/test_meshes.py similarity index 100% rename from tests/extrusion/test_meshes.py rename to tests/firedrake/extrusion/test_meshes.py diff --git a/tests/extrusion/test_mixed_bcs.py b/tests/firedrake/extrusion/test_mixed_bcs.py similarity index 100% rename from tests/extrusion/test_mixed_bcs.py rename to tests/firedrake/extrusion/test_mixed_bcs.py diff --git a/tests/extrusion/test_mixed_mats_extrusion.py b/tests/firedrake/extrusion/test_mixed_mats_extrusion.py similarity index 100% rename from tests/extrusion/test_mixed_mats_extrusion.py rename to tests/firedrake/extrusion/test_mixed_mats_extrusion.py diff --git a/tests/extrusion/test_mixed_periodic.py b/tests/firedrake/extrusion/test_mixed_periodic.py similarity index 100% rename from tests/extrusion/test_mixed_periodic.py rename to tests/firedrake/extrusion/test_mixed_periodic.py diff --git a/tests/extrusion/test_offset_computation.py b/tests/firedrake/extrusion/test_offset_computation.py similarity index 100% rename from tests/extrusion/test_offset_computation.py rename to tests/firedrake/extrusion/test_offset_computation.py diff --git a/tests/extrusion/test_point_eval_cells_extrusion.py b/tests/firedrake/extrusion/test_point_eval_cells_extrusion.py similarity index 100% rename from tests/extrusion/test_point_eval_cells_extrusion.py rename to tests/firedrake/extrusion/test_point_eval_cells_extrusion.py diff --git a/tests/extrusion/test_point_eval_fs_extrusion.py b/tests/firedrake/extrusion/test_point_eval_fs_extrusion.py similarity index 100% rename from tests/extrusion/test_point_eval_fs_extrusion.py rename to tests/firedrake/extrusion/test_point_eval_fs_extrusion.py diff --git a/tests/extrusion/test_poisson_neumann.py b/tests/firedrake/extrusion/test_poisson_neumann.py similarity index 100% rename from tests/extrusion/test_poisson_neumann.py rename to tests/firedrake/extrusion/test_poisson_neumann.py diff --git a/tests/extrusion/test_poisson_strong_bcs_extrusion.py b/tests/firedrake/extrusion/test_poisson_strong_bcs_extrusion.py similarity index 100% rename from tests/extrusion/test_poisson_strong_bcs_extrusion.py rename to tests/firedrake/extrusion/test_poisson_strong_bcs_extrusion.py diff --git a/tests/extrusion/test_real_tensorproduct.py b/tests/firedrake/extrusion/test_real_tensorproduct.py similarity index 100% rename from tests/extrusion/test_real_tensorproduct.py rename to tests/firedrake/extrusion/test_real_tensorproduct.py diff --git a/tests/extrusion/test_rhs_bcs.py b/tests/firedrake/extrusion/test_rhs_bcs.py similarity index 100% rename from tests/extrusion/test_rhs_bcs.py rename to tests/firedrake/extrusion/test_rhs_bcs.py diff --git a/tests/extrusion/test_rhs_side_bcs.py b/tests/firedrake/extrusion/test_rhs_side_bcs.py similarity index 100% rename from tests/extrusion/test_rhs_side_bcs.py rename to tests/firedrake/extrusion/test_rhs_side_bcs.py diff --git a/tests/extrusion/test_serendipity_3d_polys.py b/tests/firedrake/extrusion/test_serendipity_3d_polys.py similarity index 100% rename from tests/extrusion/test_serendipity_3d_polys.py rename to tests/firedrake/extrusion/test_serendipity_3d_polys.py diff --git a/tests/extrusion/test_side_strong_bcs.py b/tests/firedrake/extrusion/test_side_strong_bcs.py similarity index 100% rename from tests/extrusion/test_side_strong_bcs.py rename to tests/firedrake/extrusion/test_side_strong_bcs.py diff --git a/tests/extrusion/test_steady_advection_2D_extr.py b/tests/firedrake/extrusion/test_steady_advection_2D_extr.py similarity index 100% rename from tests/extrusion/test_steady_advection_2D_extr.py rename to tests/firedrake/extrusion/test_steady_advection_2D_extr.py diff --git a/tests/extrusion/test_steady_advection_3D_extr.py b/tests/firedrake/extrusion/test_steady_advection_3D_extr.py similarity index 100% rename from tests/extrusion/test_steady_advection_3D_extr.py rename to tests/firedrake/extrusion/test_steady_advection_3D_extr.py diff --git a/tests/extrusion/test_strong_bcs_caching.py b/tests/firedrake/extrusion/test_strong_bcs_caching.py similarity index 100% rename from tests/extrusion/test_strong_bcs_caching.py rename to tests/firedrake/extrusion/test_strong_bcs_caching.py diff --git a/tests/extrusion/test_subdomain_extruded.py b/tests/firedrake/extrusion/test_subdomain_extruded.py similarity index 100% rename from tests/extrusion/test_subdomain_extruded.py rename to tests/firedrake/extrusion/test_subdomain_extruded.py diff --git a/tests/extrusion/test_trace_extr.py b/tests/firedrake/extrusion/test_trace_extr.py similarity index 100% rename from tests/extrusion/test_trace_extr.py rename to tests/firedrake/extrusion/test_trace_extr.py diff --git a/tests/extrusion/test_two_step.py b/tests/firedrake/extrusion/test_two_step.py similarity index 100% rename from tests/extrusion/test_two_step.py rename to tests/firedrake/extrusion/test_two_step.py diff --git a/tests/extrusion/test_unit_square.py b/tests/firedrake/extrusion/test_unit_square.py similarity index 100% rename from tests/extrusion/test_unit_square.py rename to tests/firedrake/extrusion/test_unit_square.py diff --git a/tests/extrusion/test_variable_layers_bcs.py b/tests/firedrake/extrusion/test_variable_layers_bcs.py similarity index 100% rename from tests/extrusion/test_variable_layers_bcs.py rename to tests/firedrake/extrusion/test_variable_layers_bcs.py diff --git a/tests/extrusion/test_variable_layers_mesh_volume.py b/tests/firedrake/extrusion/test_variable_layers_mesh_volume.py similarity index 100% rename from tests/extrusion/test_variable_layers_mesh_volume.py rename to tests/firedrake/extrusion/test_variable_layers_mesh_volume.py diff --git a/tests/extrusion/test_variable_layers_numbering.py b/tests/firedrake/extrusion/test_variable_layers_numbering.py similarity index 100% rename from tests/extrusion/test_variable_layers_numbering.py rename to tests/firedrake/extrusion/test_variable_layers_numbering.py diff --git a/tests/extrusion/test_variable_layers_poisson.py b/tests/firedrake/extrusion/test_variable_layers_poisson.py similarity index 100% rename from tests/extrusion/test_variable_layers_poisson.py rename to tests/firedrake/extrusion/test_variable_layers_poisson.py diff --git a/tests/extrusion/test_variable_layers_steady_advection.py b/tests/firedrake/extrusion/test_variable_layers_steady_advection.py similarity index 100% rename from tests/extrusion/test_variable_layers_steady_advection.py rename to tests/firedrake/extrusion/test_variable_layers_steady_advection.py diff --git a/tests/extrusion/test_wedge_analytic.py b/tests/firedrake/extrusion/test_wedge_analytic.py similarity index 100% rename from tests/extrusion/test_wedge_analytic.py rename to tests/firedrake/extrusion/test_wedge_analytic.py diff --git a/tests/extrusion/test_zero_forms_extrusion.py b/tests/firedrake/extrusion/test_zero_forms_extrusion.py similarity index 100% rename from tests/extrusion/test_zero_forms_extrusion.py rename to tests/firedrake/extrusion/test_zero_forms_extrusion.py diff --git a/tests/extrusion/test_zero_integrand_extrusion.py b/tests/firedrake/extrusion/test_zero_integrand_extrusion.py similarity index 100% rename from tests/extrusion/test_zero_integrand_extrusion.py rename to tests/firedrake/extrusion/test_zero_integrand_extrusion.py diff --git a/tests/macro/test_macro_interp_project.py b/tests/firedrake/macro/test_macro_interp_project.py similarity index 100% rename from tests/macro/test_macro_interp_project.py rename to tests/firedrake/macro/test_macro_interp_project.py diff --git a/tests/macro/test_macro_low_order_refined.py b/tests/firedrake/macro/test_macro_low_order_refined.py similarity index 100% rename from tests/macro/test_macro_low_order_refined.py rename to tests/firedrake/macro/test_macro_low_order_refined.py diff --git a/tests/macro/test_macro_multigrid.py b/tests/firedrake/macro/test_macro_multigrid.py similarity index 100% rename from tests/macro/test_macro_multigrid.py rename to tests/firedrake/macro/test_macro_multigrid.py diff --git a/tests/macro/test_macro_quadrature.py b/tests/firedrake/macro/test_macro_quadrature.py similarity index 100% rename from tests/macro/test_macro_quadrature.py rename to tests/firedrake/macro/test_macro_quadrature.py diff --git a/tests/macro/test_macro_solve.py b/tests/firedrake/macro/test_macro_solve.py similarity index 100% rename from tests/macro/test_macro_solve.py rename to tests/firedrake/macro/test_macro_solve.py diff --git a/tests/macro/test_stokes_macroelements.py b/tests/firedrake/macro/test_stokes_macroelements.py similarity index 100% rename from tests/macro/test_stokes_macroelements.py rename to tests/firedrake/macro/test_stokes_macroelements.py diff --git a/tests/meshes/annulus.geo b/tests/firedrake/meshes/annulus.geo similarity index 100% rename from tests/meshes/annulus.geo rename to tests/firedrake/meshes/annulus.geo diff --git a/tests/meshes/annulus.msh b/tests/firedrake/meshes/annulus.msh similarity index 100% rename from tests/meshes/annulus.msh rename to tests/firedrake/meshes/annulus.msh diff --git a/tests/meshes/brick.e b/tests/firedrake/meshes/brick.e similarity index 100% rename from tests/meshes/brick.e rename to tests/firedrake/meshes/brick.e diff --git a/tests/meshes/broken_rogue_point.geo b/tests/firedrake/meshes/broken_rogue_point.geo similarity index 100% rename from tests/meshes/broken_rogue_point.geo rename to tests/firedrake/meshes/broken_rogue_point.geo diff --git a/tests/meshes/broken_rogue_point.msh b/tests/firedrake/meshes/broken_rogue_point.msh similarity index 100% rename from tests/meshes/broken_rogue_point.msh rename to tests/firedrake/meshes/broken_rogue_point.msh diff --git a/tests/meshes/cell-sets.geo b/tests/firedrake/meshes/cell-sets.geo similarity index 100% rename from tests/meshes/cell-sets.geo rename to tests/firedrake/meshes/cell-sets.geo diff --git a/tests/meshes/cell-sets.msh b/tests/firedrake/meshes/cell-sets.msh similarity index 100% rename from tests/meshes/cell-sets.msh rename to tests/firedrake/meshes/cell-sets.msh diff --git a/tests/meshes/circle_in_square.geo b/tests/firedrake/meshes/circle_in_square.geo similarity index 100% rename from tests/meshes/circle_in_square.geo rename to tests/firedrake/meshes/circle_in_square.geo diff --git a/tests/meshes/circle_in_square.msh b/tests/firedrake/meshes/circle_in_square.msh similarity index 100% rename from tests/meshes/circle_in_square.msh rename to tests/firedrake/meshes/circle_in_square.msh diff --git a/tests/meshes/cube_hex.geo b/tests/firedrake/meshes/cube_hex.geo similarity index 100% rename from tests/meshes/cube_hex.geo rename to tests/firedrake/meshes/cube_hex.geo diff --git a/tests/meshes/cube_hex.msh b/tests/firedrake/meshes/cube_hex.msh similarity index 100% rename from tests/meshes/cube_hex.msh rename to tests/firedrake/meshes/cube_hex.msh diff --git a/tests/meshes/cylinder.step b/tests/firedrake/meshes/cylinder.step similarity index 100% rename from tests/meshes/cylinder.step rename to tests/firedrake/meshes/cylinder.step diff --git a/tests/meshes/disk.step b/tests/firedrake/meshes/disk.step similarity index 100% rename from tests/meshes/disk.step rename to tests/firedrake/meshes/disk.step diff --git "a/tests/meshes/m\303\266bius_solid.geo" "b/tests/firedrake/meshes/m\303\266bius_solid.geo" similarity index 100% rename from "tests/meshes/m\303\266bius_solid.geo" rename to "tests/firedrake/meshes/m\303\266bius_solid.geo" diff --git "a/tests/meshes/m\303\266bius_solid.msh" "b/tests/firedrake/meshes/m\303\266bius_solid.msh" similarity index 100% rename from "tests/meshes/m\303\266bius_solid.msh" rename to "tests/firedrake/meshes/m\303\266bius_solid.msh" diff --git a/tests/meshes/sphere.geo b/tests/firedrake/meshes/sphere.geo similarity index 100% rename from tests/meshes/sphere.geo rename to tests/firedrake/meshes/sphere.geo diff --git a/tests/meshes/square.geo b/tests/firedrake/meshes/square.geo similarity index 100% rename from tests/meshes/square.geo rename to tests/firedrake/meshes/square.geo diff --git a/tests/meshes/square.msh b/tests/firedrake/meshes/square.msh similarity index 100% rename from tests/meshes/square.msh rename to tests/firedrake/meshes/square.msh diff --git a/tests/meshes/square_binary.msh b/tests/firedrake/meshes/square_binary.msh similarity index 100% rename from tests/meshes/square_binary.msh rename to tests/firedrake/meshes/square_binary.msh diff --git a/tests/meshes/square_with_embedded_line.geo b/tests/firedrake/meshes/square_with_embedded_line.geo similarity index 100% rename from tests/meshes/square_with_embedded_line.geo rename to tests/firedrake/meshes/square_with_embedded_line.geo diff --git a/tests/meshes/square_with_embedded_line.msh b/tests/firedrake/meshes/square_with_embedded_line.msh similarity index 100% rename from tests/meshes/square_with_embedded_line.msh rename to tests/firedrake/meshes/square_with_embedded_line.msh diff --git a/tests/meshes/t11_quad.msh b/tests/firedrake/meshes/t11_quad.msh similarity index 100% rename from tests/meshes/t11_quad.msh rename to tests/firedrake/meshes/t11_quad.msh diff --git a/tests/meshes/t11_tria.msh b/tests/firedrake/meshes/t11_tria.msh similarity index 100% rename from tests/meshes/t11_tria.msh rename to tests/firedrake/meshes/t11_tria.msh diff --git a/tests/meshes/t_twist.step b/tests/firedrake/meshes/t_twist.step similarity index 100% rename from tests/meshes/t_twist.step rename to tests/firedrake/meshes/t_twist.step diff --git a/tests/meshes/test_meshes_volume.py b/tests/firedrake/meshes/test_meshes_volume.py similarity index 100% rename from tests/meshes/test_meshes_volume.py rename to tests/firedrake/meshes/test_meshes_volume.py diff --git a/tests/meshes/unitsquare_unstructured_quadrilaterals.msh b/tests/firedrake/meshes/unitsquare_unstructured_quadrilaterals.msh similarity index 100% rename from tests/meshes/unitsquare_unstructured_quadrilaterals.msh rename to tests/firedrake/meshes/unitsquare_unstructured_quadrilaterals.msh diff --git a/tests/multigrid/test_basics.py b/tests/firedrake/multigrid/test_basics.py similarity index 100% rename from tests/multigrid/test_basics.py rename to tests/firedrake/multigrid/test_basics.py diff --git a/tests/multigrid/test_custom_transfer.py b/tests/firedrake/multigrid/test_custom_transfer.py similarity index 100% rename from tests/multigrid/test_custom_transfer.py rename to tests/firedrake/multigrid/test_custom_transfer.py diff --git a/tests/multigrid/test_embedded_transfer.py b/tests/firedrake/multigrid/test_embedded_transfer.py similarity index 100% rename from tests/multigrid/test_embedded_transfer.py rename to tests/firedrake/multigrid/test_embedded_transfer.py diff --git a/tests/multigrid/test_extruded_semicoarsen.py b/tests/firedrake/multigrid/test_extruded_semicoarsen.py similarity index 100% rename from tests/multigrid/test_extruded_semicoarsen.py rename to tests/firedrake/multigrid/test_extruded_semicoarsen.py diff --git a/tests/multigrid/test_grid_transfer.py b/tests/firedrake/multigrid/test_grid_transfer.py similarity index 100% rename from tests/multigrid/test_grid_transfer.py rename to tests/firedrake/multigrid/test_grid_transfer.py diff --git a/tests/multigrid/test_hiptmair.py b/tests/firedrake/multigrid/test_hiptmair.py similarity index 100% rename from tests/multigrid/test_hiptmair.py rename to tests/firedrake/multigrid/test_hiptmair.py diff --git a/tests/multigrid/test_inject_refined_extruded.py b/tests/firedrake/multigrid/test_inject_refined_extruded.py similarity index 100% rename from tests/multigrid/test_inject_refined_extruded.py rename to tests/firedrake/multigrid/test_inject_refined_extruded.py diff --git a/tests/multigrid/test_invalid_transfers.py b/tests/firedrake/multigrid/test_invalid_transfers.py similarity index 100% rename from tests/multigrid/test_invalid_transfers.py rename to tests/firedrake/multigrid/test_invalid_transfers.py diff --git a/tests/multigrid/test_multi_space_transfer.py b/tests/firedrake/multigrid/test_multi_space_transfer.py similarity index 100% rename from tests/multigrid/test_multi_space_transfer.py rename to tests/firedrake/multigrid/test_multi_space_transfer.py diff --git a/tests/multigrid/test_nested_split.py b/tests/firedrake/multigrid/test_nested_split.py similarity index 100% rename from tests/multigrid/test_nested_split.py rename to tests/firedrake/multigrid/test_nested_split.py diff --git a/tests/multigrid/test_netgen_gmg.py b/tests/firedrake/multigrid/test_netgen_gmg.py similarity index 100% rename from tests/multigrid/test_netgen_gmg.py rename to tests/firedrake/multigrid/test_netgen_gmg.py diff --git a/tests/multigrid/test_non_nested.py b/tests/firedrake/multigrid/test_non_nested.py similarity index 100% rename from tests/multigrid/test_non_nested.py rename to tests/firedrake/multigrid/test_non_nested.py diff --git a/tests/multigrid/test_opencascade_poisson.py b/tests/firedrake/multigrid/test_opencascade_poisson.py similarity index 100% rename from tests/multigrid/test_opencascade_poisson.py rename to tests/firedrake/multigrid/test_opencascade_poisson.py diff --git a/tests/multigrid/test_opencascade_volume.py b/tests/firedrake/multigrid/test_opencascade_volume.py similarity index 100% rename from tests/multigrid/test_opencascade_volume.py rename to tests/firedrake/multigrid/test_opencascade_volume.py diff --git a/tests/multigrid/test_p_multigrid.py b/tests/firedrake/multigrid/test_p_multigrid.py similarity index 100% rename from tests/multigrid/test_p_multigrid.py rename to tests/firedrake/multigrid/test_p_multigrid.py diff --git a/tests/multigrid/test_poisson_gmg.py b/tests/firedrake/multigrid/test_poisson_gmg.py similarity index 100% rename from tests/multigrid/test_poisson_gmg.py rename to tests/firedrake/multigrid/test_poisson_gmg.py diff --git a/tests/multigrid/test_poisson_gmg_extruded.py b/tests/firedrake/multigrid/test_poisson_gmg_extruded.py similarity index 100% rename from tests/multigrid/test_poisson_gmg_extruded.py rename to tests/firedrake/multigrid/test_poisson_gmg_extruded.py diff --git a/tests/multigrid/test_poisson_gmg_extruded_serendipity.py b/tests/firedrake/multigrid/test_poisson_gmg_extruded_serendipity.py similarity index 100% rename from tests/multigrid/test_poisson_gmg_extruded_serendipity.py rename to tests/firedrake/multigrid/test_poisson_gmg_extruded_serendipity.py diff --git a/tests/multigrid/test_poisson_gtmg.py b/tests/firedrake/multigrid/test_poisson_gtmg.py similarity index 100% rename from tests/multigrid/test_poisson_gtmg.py rename to tests/firedrake/multigrid/test_poisson_gtmg.py diff --git a/tests/multigrid/test_poisson_p1pcmg_extruded_serendipity.py b/tests/firedrake/multigrid/test_poisson_p1pcmg_extruded_serendipity.py similarity index 100% rename from tests/multigrid/test_poisson_p1pcmg_extruded_serendipity.py rename to tests/firedrake/multigrid/test_poisson_p1pcmg_extruded_serendipity.py diff --git a/tests/multigrid/test_refine_then_solve.py b/tests/firedrake/multigrid/test_refine_then_solve.py similarity index 100% rename from tests/multigrid/test_refine_then_solve.py rename to tests/firedrake/multigrid/test_refine_then_solve.py diff --git a/tests/multigrid/test_transfer_manager.py b/tests/firedrake/multigrid/test_transfer_manager.py similarity index 100% rename from tests/multigrid/test_transfer_manager.py rename to tests/firedrake/multigrid/test_transfer_manager.py diff --git a/tests/multigrid/test_two_poisson_gmg.py b/tests/firedrake/multigrid/test_two_poisson_gmg.py similarity index 100% rename from tests/multigrid/test_two_poisson_gmg.py rename to tests/firedrake/multigrid/test_two_poisson_gmg.py diff --git a/tests/output/conftest.py b/tests/firedrake/output/conftest.py similarity index 100% rename from tests/output/conftest.py rename to tests/firedrake/output/conftest.py diff --git a/tests/output/test_adjoint_disk_checkpointing.py b/tests/firedrake/output/test_adjoint_disk_checkpointing.py similarity index 100% rename from tests/output/test_adjoint_disk_checkpointing.py rename to tests/firedrake/output/test_adjoint_disk_checkpointing.py diff --git a/tests/output/test_dumb_checkpoint.py b/tests/firedrake/output/test_dumb_checkpoint.py similarity index 100% rename from tests/output/test_dumb_checkpoint.py rename to tests/firedrake/output/test_dumb_checkpoint.py diff --git a/tests/output/test_function_plotter.py b/tests/firedrake/output/test_function_plotter.py similarity index 100% rename from tests/output/test_function_plotter.py rename to tests/firedrake/output/test_function_plotter.py diff --git a/tests/output/test_hdf5file_checkpoint.py b/tests/firedrake/output/test_hdf5file_checkpoint.py similarity index 100% rename from tests/output/test_hdf5file_checkpoint.py rename to tests/firedrake/output/test_hdf5file_checkpoint.py diff --git a/tests/output/test_io_backward_compat.py b/tests/firedrake/output/test_io_backward_compat.py similarity index 100% rename from tests/output/test_io_backward_compat.py rename to tests/firedrake/output/test_io_backward_compat.py diff --git a/tests/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_hexahedron.h5 b/tests/firedrake/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_hexahedron.h5 similarity index 100% rename from tests/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_hexahedron.h5 rename to tests/firedrake/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_hexahedron.h5 diff --git a/tests/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_interval_extruded_periodic.h5 b/tests/firedrake/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_interval_extruded_periodic.h5 similarity index 100% rename from tests/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_interval_extruded_periodic.h5 rename to tests/firedrake/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_interval_extruded_periodic.h5 diff --git a/tests/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_quadrilateral.h5 b/tests/firedrake/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_quadrilateral.h5 similarity index 100% rename from tests/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_quadrilateral.h5 rename to tests/firedrake/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_quadrilateral.h5 diff --git a/tests/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_quadrilateral_immersed.h5 b/tests/firedrake/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_quadrilateral_immersed.h5 similarity index 100% rename from tests/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_quadrilateral_immersed.h5 rename to tests/firedrake/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_quadrilateral_immersed.h5 diff --git a/tests/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_tetrahedron.h5 b/tests/firedrake/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_tetrahedron.h5 similarity index 100% rename from tests/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_tetrahedron.h5 rename to tests/firedrake/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_tetrahedron.h5 diff --git a/tests/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_tetrahedron_periodic.h5 b/tests/firedrake/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_tetrahedron_periodic.h5 similarity index 100% rename from tests/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_tetrahedron_periodic.h5 rename to tests/firedrake/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_tetrahedron_periodic.h5 diff --git a/tests/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_timestepping.h5 b/tests/firedrake/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_timestepping.h5 similarity index 100% rename from tests/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_timestepping.h5 rename to tests/firedrake/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_timestepping.h5 diff --git a/tests/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_triangle.h5 b/tests/firedrake/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_triangle.h5 similarity index 100% rename from tests/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_triangle.h5 rename to tests/firedrake/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_triangle.h5 diff --git a/tests/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_triangle_extruded.h5 b/tests/firedrake/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_triangle_extruded.h5 similarity index 100% rename from tests/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_triangle_extruded.h5 rename to tests/firedrake/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_triangle_extruded.h5 diff --git a/tests/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_triangle_extruded_real.h5 b/tests/firedrake/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_triangle_extruded_real.h5 similarity index 100% rename from tests/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_triangle_extruded_real.h5 rename to tests/firedrake/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_triangle_extruded_real.h5 diff --git a/tests/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_triangle_immersed.h5 b/tests/firedrake/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_triangle_immersed.h5 similarity index 100% rename from tests/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_triangle_immersed.h5 rename to tests/firedrake/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_triangle_immersed.h5 diff --git a/tests/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_triangle_mixed.h5 b/tests/firedrake/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_triangle_mixed.h5 similarity index 100% rename from tests/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_triangle_mixed.h5 rename to tests/firedrake/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_triangle_mixed.h5 diff --git a/tests/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_triangle_periodic.h5 b/tests/firedrake/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_triangle_periodic.h5 similarity index 100% rename from tests/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_triangle_periodic.h5 rename to tests/firedrake/output/test_io_backward_compat_files/test_io_backward_compat_2024_01_27_triangle_periodic.h5 diff --git a/tests/output/test_io_freeze_distribution_permutation.py b/tests/firedrake/output/test_io_freeze_distribution_permutation.py similarity index 100% rename from tests/output/test_io_freeze_distribution_permutation.py rename to tests/firedrake/output/test_io_freeze_distribution_permutation.py diff --git a/tests/output/test_io_function.py b/tests/firedrake/output/test_io_function.py similarity index 100% rename from tests/output/test_io_function.py rename to tests/firedrake/output/test_io_function.py diff --git a/tests/output/test_io_mesh.py b/tests/firedrake/output/test_io_mesh.py similarity index 100% rename from tests/output/test_io_mesh.py rename to tests/firedrake/output/test_io_mesh.py diff --git a/tests/output/test_io_solve.py b/tests/firedrake/output/test_io_solve.py similarity index 100% rename from tests/output/test_io_solve.py rename to tests/firedrake/output/test_io_solve.py diff --git a/tests/output/test_io_timestepping.py b/tests/firedrake/output/test_io_timestepping.py similarity index 100% rename from tests/output/test_io_timestepping.py rename to tests/firedrake/output/test_io_timestepping.py diff --git a/tests/output/test_plotting.py b/tests/firedrake/output/test_plotting.py similarity index 100% rename from tests/output/test_plotting.py rename to tests/firedrake/output/test_plotting.py diff --git a/tests/output/test_pvd_output.py b/tests/firedrake/output/test_pvd_output.py similarity index 100% rename from tests/output/test_pvd_output.py rename to tests/firedrake/output/test_pvd_output.py diff --git a/tests/randomfunctiongen/test_randomfunction.py b/tests/firedrake/randomfunctiongen/test_randomfunction.py similarity index 100% rename from tests/randomfunctiongen/test_randomfunction.py rename to tests/firedrake/randomfunctiongen/test_randomfunction.py diff --git a/tests/randomfunctiongen/test_randomgen_compatibility.py b/tests/firedrake/randomfunctiongen/test_randomgen_compatibility.py similarity index 100% rename from tests/randomfunctiongen/test_randomgen_compatibility.py rename to tests/firedrake/randomfunctiongen/test_randomgen_compatibility.py diff --git a/tests/regression/test_2dcohomology.py b/tests/firedrake/regression/test_2dcohomology.py similarity index 100% rename from tests/regression/test_2dcohomology.py rename to tests/firedrake/regression/test_2dcohomology.py diff --git a/tests/regression/test_adjoint_bc.py b/tests/firedrake/regression/test_adjoint_bc.py similarity index 100% rename from tests/regression/test_adjoint_bc.py rename to tests/firedrake/regression/test_adjoint_bc.py diff --git a/tests/regression/test_adjoint_operators.py b/tests/firedrake/regression/test_adjoint_operators.py similarity index 100% rename from tests/regression/test_adjoint_operators.py rename to tests/firedrake/regression/test_adjoint_operators.py diff --git a/tests/regression/test_adv_diff.py b/tests/firedrake/regression/test_adv_diff.py similarity index 100% rename from tests/regression/test_adv_diff.py rename to tests/firedrake/regression/test_adv_diff.py diff --git a/tests/regression/test_adv_diff_nonsplit.py b/tests/firedrake/regression/test_adv_diff_nonsplit.py similarity index 100% rename from tests/regression/test_adv_diff_nonsplit.py rename to tests/firedrake/regression/test_adv_diff_nonsplit.py diff --git a/tests/regression/test_appctx_cleanup.py b/tests/firedrake/regression/test_appctx_cleanup.py similarity index 100% rename from tests/regression/test_appctx_cleanup.py rename to tests/firedrake/regression/test_appctx_cleanup.py diff --git a/tests/regression/test_assemble.py b/tests/firedrake/regression/test_assemble.py similarity index 100% rename from tests/regression/test_assemble.py rename to tests/firedrake/regression/test_assemble.py diff --git a/tests/regression/test_assemble_baseform.py b/tests/firedrake/regression/test_assemble_baseform.py similarity index 100% rename from tests/regression/test_assemble_baseform.py rename to tests/firedrake/regression/test_assemble_baseform.py diff --git a/tests/regression/test_auxiliary_dm.py b/tests/firedrake/regression/test_auxiliary_dm.py similarity index 100% rename from tests/regression/test_auxiliary_dm.py rename to tests/firedrake/regression/test_auxiliary_dm.py diff --git a/tests/regression/test_bcs.py b/tests/firedrake/regression/test_bcs.py similarity index 100% rename from tests/regression/test_bcs.py rename to tests/firedrake/regression/test_bcs.py diff --git a/tests/regression/test_bdmc.py b/tests/firedrake/regression/test_bdmc.py similarity index 100% rename from tests/regression/test_bdmc.py rename to tests/firedrake/regression/test_bdmc.py diff --git a/tests/regression/test_bdmc_riesz_map.py b/tests/firedrake/regression/test_bdmc_riesz_map.py similarity index 100% rename from tests/regression/test_bdmc_riesz_map.py rename to tests/firedrake/regression/test_bdmc_riesz_map.py diff --git a/tests/regression/test_bessel_functions.py b/tests/firedrake/regression/test_bessel_functions.py similarity index 100% rename from tests/regression/test_bessel_functions.py rename to tests/firedrake/regression/test_bessel_functions.py diff --git a/tests/regression/test_bubble.py b/tests/firedrake/regression/test_bubble.py similarity index 100% rename from tests/regression/test_bubble.py rename to tests/firedrake/regression/test_bubble.py diff --git a/tests/regression/test_cell_subdomains.py b/tests/firedrake/regression/test_cell_subdomains.py similarity index 100% rename from tests/regression/test_cell_subdomains.py rename to tests/firedrake/regression/test_cell_subdomains.py diff --git a/tests/regression/test_cellcoordinate.py b/tests/firedrake/regression/test_cellcoordinate.py similarity index 100% rename from tests/regression/test_cellcoordinate.py rename to tests/firedrake/regression/test_cellcoordinate.py diff --git a/tests/regression/test_cellorigin.py b/tests/firedrake/regression/test_cellorigin.py similarity index 100% rename from tests/regression/test_cellorigin.py rename to tests/firedrake/regression/test_cellorigin.py diff --git a/tests/regression/test_cellvolume.py b/tests/firedrake/regression/test_cellvolume.py similarity index 100% rename from tests/regression/test_cellvolume.py rename to tests/firedrake/regression/test_cellvolume.py diff --git a/tests/regression/test_change_coordinates.py b/tests/firedrake/regression/test_change_coordinates.py similarity index 100% rename from tests/regression/test_change_coordinates.py rename to tests/firedrake/regression/test_change_coordinates.py diff --git a/tests/regression/test_circle_manifold.py b/tests/firedrake/regression/test_circle_manifold.py similarity index 100% rename from tests/regression/test_circle_manifold.py rename to tests/firedrake/regression/test_circle_manifold.py diff --git a/tests/regression/test_coarse_nullspace.py b/tests/firedrake/regression/test_coarse_nullspace.py similarity index 100% rename from tests/regression/test_coarse_nullspace.py rename to tests/firedrake/regression/test_coarse_nullspace.py diff --git a/tests/regression/test_coefficient_derivatives.py b/tests/firedrake/regression/test_coefficient_derivatives.py similarity index 100% rename from tests/regression/test_coefficient_derivatives.py rename to tests/firedrake/regression/test_coefficient_derivatives.py diff --git a/tests/regression/test_cofunction.py b/tests/firedrake/regression/test_cofunction.py similarity index 100% rename from tests/regression/test_cofunction.py rename to tests/firedrake/regression/test_cofunction.py diff --git a/tests/regression/test_conditional.py b/tests/firedrake/regression/test_conditional.py similarity index 100% rename from tests/regression/test_conditional.py rename to tests/firedrake/regression/test_conditional.py diff --git a/tests/regression/test_constant.py b/tests/firedrake/regression/test_constant.py similarity index 100% rename from tests/regression/test_constant.py rename to tests/firedrake/regression/test_constant.py diff --git a/tests/regression/test_coordinatederivative.py b/tests/firedrake/regression/test_coordinatederivative.py similarity index 100% rename from tests/regression/test_coordinatederivative.py rename to tests/firedrake/regression/test_coordinatederivative.py diff --git a/tests/regression/test_custom_callbacks.py b/tests/firedrake/regression/test_custom_callbacks.py similarity index 100% rename from tests/regression/test_custom_callbacks.py rename to tests/firedrake/regression/test_custom_callbacks.py diff --git a/tests/regression/test_custom_pc_python_pmat.py b/tests/firedrake/regression/test_custom_pc_python_pmat.py similarity index 100% rename from tests/regression/test_custom_pc_python_pmat.py rename to tests/firedrake/regression/test_custom_pc_python_pmat.py diff --git a/tests/regression/test_dg_advection.py b/tests/firedrake/regression/test_dg_advection.py similarity index 100% rename from tests/regression/test_dg_advection.py rename to tests/firedrake/regression/test_dg_advection.py diff --git a/tests/regression/test_eigensolver.py b/tests/firedrake/regression/test_eigensolver.py similarity index 100% rename from tests/regression/test_eigensolver.py rename to tests/firedrake/regression/test_eigensolver.py diff --git a/tests/regression/test_element_mapping.py b/tests/firedrake/regression/test_element_mapping.py similarity index 100% rename from tests/regression/test_element_mapping.py rename to tests/firedrake/regression/test_element_mapping.py diff --git a/tests/regression/test_embedded_sphere.py b/tests/firedrake/regression/test_embedded_sphere.py similarity index 100% rename from tests/regression/test_embedded_sphere.py rename to tests/firedrake/regression/test_embedded_sphere.py diff --git a/tests/regression/test_ensembleparallelism.py b/tests/firedrake/regression/test_ensembleparallelism.py similarity index 98% rename from tests/regression/test_ensembleparallelism.py rename to tests/firedrake/regression/test_ensembleparallelism.py index faa3db99dc..23712cee51 100644 --- a/tests/regression/test_ensembleparallelism.py +++ b/tests/firedrake/regression/test_ensembleparallelism.py @@ -205,13 +205,13 @@ def test_ensemble_reduce(ensemble, mesh, W, urank, urank_sum, root, blocking): parallel_assert( lambda: error < 1e-12, subset=root_ranks, - msg=f"{error = :.5f}" + msg=f"{error = :.5f}" # noqa: E203, E251 ) error = errornorm(Function(W).assign(10), u_reduce) parallel_assert( lambda: error < 1e-12, subset={range(COMM_WORLD.size)} - root_ranks, - msg=f"{error = :.5f}" + msg=f"{error = :.5f}" # noqa: E203, E251 ) # check that u_reduce dat vector is still synchronised @@ -347,7 +347,7 @@ def test_send_and_recv(ensemble, mesh, W, blocking): parallel_assert( lambda: error < 1e-12, subset=root_ranks, - msg=f"{error = :.5f}" + msg=f"{error = :.5f}" # noqa: E203, E251 ) diff --git a/tests/regression/test_exodus_mesh.py b/tests/firedrake/regression/test_exodus_mesh.py similarity index 100% rename from tests/regression/test_exodus_mesh.py rename to tests/firedrake/regression/test_exodus_mesh.py diff --git a/tests/regression/test_expressions.py b/tests/firedrake/regression/test_expressions.py similarity index 100% rename from tests/regression/test_expressions.py rename to tests/firedrake/regression/test_expressions.py diff --git a/tests/regression/test_facet_avg.py b/tests/firedrake/regression/test_facet_avg.py similarity index 100% rename from tests/regression/test_facet_avg.py rename to tests/firedrake/regression/test_facet_avg.py diff --git a/tests/regression/test_facet_elements.py b/tests/firedrake/regression/test_facet_elements.py similarity index 100% rename from tests/regression/test_facet_elements.py rename to tests/firedrake/regression/test_facet_elements.py diff --git a/tests/regression/test_facet_normal.py b/tests/firedrake/regression/test_facet_normal.py similarity index 100% rename from tests/regression/test_facet_normal.py rename to tests/firedrake/regression/test_facet_normal.py diff --git a/tests/regression/test_facet_orientation.py b/tests/firedrake/regression/test_facet_orientation.py similarity index 100% rename from tests/regression/test_facet_orientation.py rename to tests/firedrake/regression/test_facet_orientation.py diff --git a/tests/regression/test_facet_split.py b/tests/firedrake/regression/test_facet_split.py similarity index 100% rename from tests/regression/test_facet_split.py rename to tests/firedrake/regression/test_facet_split.py diff --git a/tests/regression/test_facets.py b/tests/firedrake/regression/test_facets.py similarity index 100% rename from tests/regression/test_facets.py rename to tests/firedrake/regression/test_facets.py diff --git a/tests/regression/test_fas_snespatch.py b/tests/firedrake/regression/test_fas_snespatch.py similarity index 100% rename from tests/regression/test_fas_snespatch.py rename to tests/firedrake/regression/test_fas_snespatch.py diff --git a/tests/regression/test_fdm.py b/tests/firedrake/regression/test_fdm.py similarity index 100% rename from tests/regression/test_fdm.py rename to tests/firedrake/regression/test_fdm.py diff --git a/tests/regression/test_fieldsplit_breadcrumbs.py b/tests/firedrake/regression/test_fieldsplit_breadcrumbs.py similarity index 100% rename from tests/regression/test_fieldsplit_breadcrumbs.py rename to tests/firedrake/regression/test_fieldsplit_breadcrumbs.py diff --git a/tests/regression/test_fieldsplit_fieldsplit_aux_multigrid.py b/tests/firedrake/regression/test_fieldsplit_fieldsplit_aux_multigrid.py similarity index 100% rename from tests/regression/test_fieldsplit_fieldsplit_aux_multigrid.py rename to tests/firedrake/regression/test_fieldsplit_fieldsplit_aux_multigrid.py diff --git a/tests/regression/test_fieldsplit_split_reorder_bcs.py b/tests/firedrake/regression/test_fieldsplit_split_reorder_bcs.py similarity index 100% rename from tests/regression/test_fieldsplit_split_reorder_bcs.py rename to tests/firedrake/regression/test_fieldsplit_split_reorder_bcs.py diff --git a/tests/regression/test_fml.py b/tests/firedrake/regression/test_fml.py similarity index 100% rename from tests/regression/test_fml.py rename to tests/firedrake/regression/test_fml.py diff --git a/tests/regression/test_fs_caching.py b/tests/firedrake/regression/test_fs_caching.py similarity index 100% rename from tests/regression/test_fs_caching.py rename to tests/firedrake/regression/test_fs_caching.py diff --git a/tests/regression/test_function.py b/tests/firedrake/regression/test_function.py similarity index 100% rename from tests/regression/test_function.py rename to tests/firedrake/regression/test_function.py diff --git a/tests/regression/test_function_spaces.py b/tests/firedrake/regression/test_function_spaces.py similarity index 100% rename from tests/regression/test_function_spaces.py rename to tests/firedrake/regression/test_function_spaces.py diff --git a/tests/regression/test_garbage.py b/tests/firedrake/regression/test_garbage.py similarity index 100% rename from tests/regression/test_garbage.py rename to tests/firedrake/regression/test_garbage.py diff --git a/tests/regression/test_helmholtz.py b/tests/firedrake/regression/test_helmholtz.py similarity index 100% rename from tests/regression/test_helmholtz.py rename to tests/firedrake/regression/test_helmholtz.py diff --git a/tests/regression/test_helmholtz_bernstein.py b/tests/firedrake/regression/test_helmholtz_bernstein.py similarity index 100% rename from tests/regression/test_helmholtz_bernstein.py rename to tests/firedrake/regression/test_helmholtz_bernstein.py diff --git a/tests/regression/test_helmholtz_complex.py b/tests/firedrake/regression/test_helmholtz_complex.py similarity index 100% rename from tests/regression/test_helmholtz_complex.py rename to tests/firedrake/regression/test_helmholtz_complex.py diff --git a/tests/regression/test_helmholtz_mixed.py b/tests/firedrake/regression/test_helmholtz_mixed.py similarity index 100% rename from tests/regression/test_helmholtz_mixed.py rename to tests/firedrake/regression/test_helmholtz_mixed.py diff --git a/tests/regression/test_helmholtz_nonlinear_diffusion.py b/tests/firedrake/regression/test_helmholtz_nonlinear_diffusion.py similarity index 100% rename from tests/regression/test_helmholtz_nonlinear_diffusion.py rename to tests/firedrake/regression/test_helmholtz_nonlinear_diffusion.py diff --git a/tests/regression/test_helmholtz_serendipity.py b/tests/firedrake/regression/test_helmholtz_serendipity.py similarity index 100% rename from tests/regression/test_helmholtz_serendipity.py rename to tests/firedrake/regression/test_helmholtz_serendipity.py diff --git a/tests/regression/test_helmholtz_sphere.py b/tests/firedrake/regression/test_helmholtz_sphere.py similarity index 100% rename from tests/regression/test_helmholtz_sphere.py rename to tests/firedrake/regression/test_helmholtz_sphere.py diff --git a/tests/regression/test_helmholtz_zany.py b/tests/firedrake/regression/test_helmholtz_zany.py similarity index 100% rename from tests/regression/test_helmholtz_zany.py rename to tests/firedrake/regression/test_helmholtz_zany.py diff --git a/tests/regression/test_hypre_ads.py b/tests/firedrake/regression/test_hypre_ads.py similarity index 100% rename from tests/regression/test_hypre_ads.py rename to tests/firedrake/regression/test_hypre_ads.py diff --git a/tests/regression/test_hypre_ams.py b/tests/firedrake/regression/test_hypre_ams.py similarity index 100% rename from tests/regression/test_hypre_ams.py rename to tests/firedrake/regression/test_hypre_ams.py diff --git a/tests/regression/test_identity.py b/tests/firedrake/regression/test_identity.py similarity index 100% rename from tests/regression/test_identity.py rename to tests/firedrake/regression/test_identity.py diff --git a/tests/regression/test_import_applications.py b/tests/firedrake/regression/test_import_applications.py similarity index 100% rename from tests/regression/test_import_applications.py rename to tests/firedrake/regression/test_import_applications.py diff --git a/tests/regression/test_info.py b/tests/firedrake/regression/test_info.py similarity index 100% rename from tests/regression/test_info.py rename to tests/firedrake/regression/test_info.py diff --git a/tests/regression/test_integral_hex.py b/tests/firedrake/regression/test_integral_hex.py similarity index 100% rename from tests/regression/test_integral_hex.py rename to tests/firedrake/regression/test_integral_hex.py diff --git a/tests/regression/test_interior_bcs.py b/tests/firedrake/regression/test_interior_bcs.py similarity index 100% rename from tests/regression/test_interior_bcs.py rename to tests/firedrake/regression/test_interior_bcs.py diff --git a/tests/regression/test_interior_elements.py b/tests/firedrake/regression/test_interior_elements.py similarity index 100% rename from tests/regression/test_interior_elements.py rename to tests/firedrake/regression/test_interior_elements.py diff --git a/tests/regression/test_interior_facets.py b/tests/firedrake/regression/test_interior_facets.py similarity index 100% rename from tests/regression/test_interior_facets.py rename to tests/firedrake/regression/test_interior_facets.py diff --git a/tests/regression/test_interp_dual.py b/tests/firedrake/regression/test_interp_dual.py similarity index 100% rename from tests/regression/test_interp_dual.py rename to tests/firedrake/regression/test_interp_dual.py diff --git a/tests/regression/test_interpolate.py b/tests/firedrake/regression/test_interpolate.py similarity index 100% rename from tests/regression/test_interpolate.py rename to tests/firedrake/regression/test_interpolate.py diff --git a/tests/regression/test_interpolate_cross_mesh.py b/tests/firedrake/regression/test_interpolate_cross_mesh.py similarity index 100% rename from tests/regression/test_interpolate_cross_mesh.py rename to tests/firedrake/regression/test_interpolate_cross_mesh.py diff --git a/tests/regression/test_interpolate_p3intmoments.py b/tests/firedrake/regression/test_interpolate_p3intmoments.py similarity index 100% rename from tests/regression/test_interpolate_p3intmoments.py rename to tests/firedrake/regression/test_interpolate_p3intmoments.py diff --git a/tests/regression/test_interpolate_vs_project.py b/tests/firedrake/regression/test_interpolate_vs_project.py similarity index 100% rename from tests/regression/test_interpolate_vs_project.py rename to tests/firedrake/regression/test_interpolate_vs_project.py diff --git a/tests/regression/test_interpolate_zany.py b/tests/firedrake/regression/test_interpolate_zany.py similarity index 100% rename from tests/regression/test_interpolate_zany.py rename to tests/firedrake/regression/test_interpolate_zany.py diff --git a/tests/regression/test_interpolation_manual.py b/tests/firedrake/regression/test_interpolation_manual.py similarity index 100% rename from tests/regression/test_interpolation_manual.py rename to tests/firedrake/regression/test_interpolation_manual.py diff --git a/tests/regression/test_interpolation_nodes.py b/tests/firedrake/regression/test_interpolation_nodes.py similarity index 100% rename from tests/regression/test_interpolation_nodes.py rename to tests/firedrake/regression/test_interpolation_nodes.py diff --git a/tests/regression/test_ip_viscosity.py b/tests/firedrake/regression/test_ip_viscosity.py similarity index 100% rename from tests/regression/test_ip_viscosity.py rename to tests/firedrake/regression/test_ip_viscosity.py diff --git a/tests/regression/test_jacobian_invalidation.py b/tests/firedrake/regression/test_jacobian_invalidation.py similarity index 100% rename from tests/regression/test_jacobian_invalidation.py rename to tests/firedrake/regression/test_jacobian_invalidation.py diff --git a/tests/regression/test_jax_coupling.py b/tests/firedrake/regression/test_jax_coupling.py similarity index 100% rename from tests/regression/test_jax_coupling.py rename to tests/firedrake/regression/test_jax_coupling.py diff --git a/tests/regression/test_l2pullbacks.py b/tests/firedrake/regression/test_l2pullbacks.py similarity index 100% rename from tests/regression/test_l2pullbacks.py rename to tests/firedrake/regression/test_l2pullbacks.py diff --git a/tests/regression/test_line_smoother_periodic.py b/tests/firedrake/regression/test_line_smoother_periodic.py similarity index 100% rename from tests/regression/test_line_smoother_periodic.py rename to tests/firedrake/regression/test_line_smoother_periodic.py diff --git a/tests/regression/test_linear_solver_change_bc.py b/tests/firedrake/regression/test_linear_solver_change_bc.py similarity index 100% rename from tests/regression/test_linear_solver_change_bc.py rename to tests/firedrake/regression/test_linear_solver_change_bc.py diff --git a/tests/regression/test_linesmoother.py b/tests/firedrake/regression/test_linesmoother.py similarity index 100% rename from tests/regression/test_linesmoother.py rename to tests/firedrake/regression/test_linesmoother.py diff --git a/tests/regression/test_linesmoother_vfs.py b/tests/firedrake/regression/test_linesmoother_vfs.py similarity index 100% rename from tests/regression/test_linesmoother_vfs.py rename to tests/firedrake/regression/test_linesmoother_vfs.py diff --git a/tests/regression/test_load_mesh.py b/tests/firedrake/regression/test_load_mesh.py similarity index 100% rename from tests/regression/test_load_mesh.py rename to tests/firedrake/regression/test_load_mesh.py diff --git a/tests/regression/test_locate_cell.py b/tests/firedrake/regression/test_locate_cell.py similarity index 100% rename from tests/regression/test_locate_cell.py rename to tests/firedrake/regression/test_locate_cell.py diff --git a/tests/regression/test_manifolds.py b/tests/firedrake/regression/test_manifolds.py similarity index 98% rename from tests/regression/test_manifolds.py rename to tests/firedrake/regression/test_manifolds.py index 74fff831ec..312524baad 100644 --- a/tests/regression/test_manifolds.py +++ b/tests/firedrake/regression/test_manifolds.py @@ -1,10 +1,7 @@ -import firedrake_configuration from firedrake import * import pytest import numpy as np -config = firedrake_configuration.get_config() - # This test solves a mixed formulation of the Poisson equation with # inhomogeneous Neumann boundary conditions such that the exact diff --git a/tests/regression/test_manual_quadrature.py b/tests/firedrake/regression/test_manual_quadrature.py similarity index 100% rename from tests/regression/test_manual_quadrature.py rename to tests/firedrake/regression/test_manual_quadrature.py diff --git a/tests/regression/test_mark_entities.py b/tests/firedrake/regression/test_mark_entities.py similarity index 100% rename from tests/regression/test_mark_entities.py rename to tests/firedrake/regression/test_mark_entities.py diff --git a/tests/regression/test_mass_lumping.py b/tests/firedrake/regression/test_mass_lumping.py similarity index 100% rename from tests/regression/test_mass_lumping.py rename to tests/firedrake/regression/test_mass_lumping.py diff --git a/tests/regression/test_mat_type_dense.py b/tests/firedrake/regression/test_mat_type_dense.py similarity index 100% rename from tests/regression/test_mat_type_dense.py rename to tests/firedrake/regression/test_mat_type_dense.py diff --git a/tests/regression/test_matrix.py b/tests/firedrake/regression/test_matrix.py similarity index 100% rename from tests/regression/test_matrix.py rename to tests/firedrake/regression/test_matrix.py diff --git a/tests/regression/test_matrix_free.py b/tests/firedrake/regression/test_matrix_free.py similarity index 100% rename from tests/regression/test_matrix_free.py rename to tests/firedrake/regression/test_matrix_free.py diff --git a/tests/regression/test_matrix_prefix.py b/tests/firedrake/regression/test_matrix_prefix.py similarity index 100% rename from tests/regression/test_matrix_prefix.py rename to tests/firedrake/regression/test_matrix_prefix.py diff --git a/tests/regression/test_mesh_from_plex.py b/tests/firedrake/regression/test_mesh_from_plex.py similarity index 100% rename from tests/regression/test_mesh_from_plex.py rename to tests/firedrake/regression/test_mesh_from_plex.py diff --git a/tests/regression/test_mesh_generation.py b/tests/firedrake/regression/test_mesh_generation.py similarity index 100% rename from tests/regression/test_mesh_generation.py rename to tests/firedrake/regression/test_mesh_generation.py diff --git a/tests/regression/test_mesh_overlaps.py b/tests/firedrake/regression/test_mesh_overlaps.py similarity index 100% rename from tests/regression/test_mesh_overlaps.py rename to tests/firedrake/regression/test_mesh_overlaps.py diff --git a/tests/regression/test_mixed_interior_facets.py b/tests/firedrake/regression/test_mixed_interior_facets.py similarity index 100% rename from tests/regression/test_mixed_interior_facets.py rename to tests/firedrake/regression/test_mixed_interior_facets.py diff --git a/tests/regression/test_mixed_mats.py b/tests/firedrake/regression/test_mixed_mats.py similarity index 100% rename from tests/regression/test_mixed_mats.py rename to tests/firedrake/regression/test_mixed_mats.py diff --git a/tests/regression/test_mixed_tensor.py b/tests/firedrake/regression/test_mixed_tensor.py similarity index 100% rename from tests/regression/test_mixed_tensor.py rename to tests/firedrake/regression/test_mixed_tensor.py diff --git a/tests/regression/test_moore_spence.py b/tests/firedrake/regression/test_moore_spence.py similarity index 100% rename from tests/regression/test_moore_spence.py rename to tests/firedrake/regression/test_moore_spence.py diff --git a/tests/regression/test_mtw.py b/tests/firedrake/regression/test_mtw.py similarity index 100% rename from tests/regression/test_mtw.py rename to tests/firedrake/regression/test_mtw.py diff --git a/tests/regression/test_multiple_domains.py b/tests/firedrake/regression/test_multiple_domains.py similarity index 100% rename from tests/regression/test_multiple_domains.py rename to tests/firedrake/regression/test_multiple_domains.py diff --git a/tests/regression/test_nested_fieldsplit_solves.py b/tests/firedrake/regression/test_nested_fieldsplit_solves.py similarity index 100% rename from tests/regression/test_nested_fieldsplit_solves.py rename to tests/firedrake/regression/test_nested_fieldsplit_solves.py diff --git a/tests/regression/test_netgen.py b/tests/firedrake/regression/test_netgen.py similarity index 100% rename from tests/regression/test_netgen.py rename to tests/firedrake/regression/test_netgen.py diff --git a/tests/regression/test_nonlinear_helmholtz.py b/tests/firedrake/regression/test_nonlinear_helmholtz.py similarity index 100% rename from tests/regression/test_nonlinear_helmholtz.py rename to tests/firedrake/regression/test_nonlinear_helmholtz.py diff --git a/tests/regression/test_nonlinear_stokes_hdiv.py b/tests/firedrake/regression/test_nonlinear_stokes_hdiv.py similarity index 100% rename from tests/regression/test_nonlinear_stokes_hdiv.py rename to tests/firedrake/regression/test_nonlinear_stokes_hdiv.py diff --git a/tests/regression/test_norm.py b/tests/firedrake/regression/test_norm.py similarity index 100% rename from tests/regression/test_norm.py rename to tests/firedrake/regression/test_norm.py diff --git a/tests/regression/test_nullspace.py b/tests/firedrake/regression/test_nullspace.py similarity index 100% rename from tests/regression/test_nullspace.py rename to tests/firedrake/regression/test_nullspace.py diff --git a/tests/regression/test_octahedral_hemisphere.py b/tests/firedrake/regression/test_octahedral_hemisphere.py similarity index 100% rename from tests/regression/test_octahedral_hemisphere.py rename to tests/firedrake/regression/test_octahedral_hemisphere.py diff --git a/tests/regression/test_p1pc.py b/tests/firedrake/regression/test_p1pc.py similarity index 100% rename from tests/regression/test_p1pc.py rename to tests/firedrake/regression/test_p1pc.py diff --git a/tests/regression/test_par_loops.py b/tests/firedrake/regression/test_par_loops.py similarity index 100% rename from tests/regression/test_par_loops.py rename to tests/firedrake/regression/test_par_loops.py diff --git a/tests/regression/test_parallel_cr.py b/tests/firedrake/regression/test_parallel_cr.py similarity index 100% rename from tests/regression/test_parallel_cr.py rename to tests/firedrake/regression/test_parallel_cr.py diff --git a/tests/regression/test_parallel_kernel.py b/tests/firedrake/regression/test_parallel_kernel.py similarity index 100% rename from tests/regression/test_parallel_kernel.py rename to tests/firedrake/regression/test_parallel_kernel.py diff --git a/tests/regression/test_parameters.py b/tests/firedrake/regression/test_parameters.py similarity index 100% rename from tests/regression/test_parameters.py rename to tests/firedrake/regression/test_parameters.py diff --git a/tests/regression/test_partially_mixed_mat.py b/tests/firedrake/regression/test_partially_mixed_mat.py similarity index 100% rename from tests/regression/test_partially_mixed_mat.py rename to tests/firedrake/regression/test_partially_mixed_mat.py diff --git a/tests/regression/test_patch_pc.py b/tests/firedrake/regression/test_patch_pc.py similarity index 100% rename from tests/regression/test_patch_pc.py rename to tests/firedrake/regression/test_patch_pc.py diff --git a/tests/regression/test_patch_precompute_element_tensors.py b/tests/firedrake/regression/test_patch_precompute_element_tensors.py similarity index 100% rename from tests/regression/test_patch_precompute_element_tensors.py rename to tests/firedrake/regression/test_patch_precompute_element_tensors.py diff --git a/tests/regression/test_periodic_2d.py b/tests/firedrake/regression/test_periodic_2d.py similarity index 100% rename from tests/regression/test_periodic_2d.py rename to tests/firedrake/regression/test_periodic_2d.py diff --git a/tests/regression/test_periodic_interval_advection.py b/tests/firedrake/regression/test_periodic_interval_advection.py similarity index 100% rename from tests/regression/test_periodic_interval_advection.py rename to tests/firedrake/regression/test_periodic_interval_advection.py diff --git a/tests/regression/test_periodic_rectangle_advection.py b/tests/firedrake/regression/test_periodic_rectangle_advection.py similarity index 100% rename from tests/regression/test_periodic_rectangle_advection.py rename to tests/firedrake/regression/test_periodic_rectangle_advection.py diff --git a/tests/regression/test_piola_mixed_fn.py b/tests/firedrake/regression/test_piola_mixed_fn.py similarity index 100% rename from tests/regression/test_piola_mixed_fn.py rename to tests/firedrake/regression/test_piola_mixed_fn.py diff --git a/tests/regression/test_planesmoother.py b/tests/firedrake/regression/test_planesmoother.py similarity index 100% rename from tests/regression/test_planesmoother.py rename to tests/firedrake/regression/test_planesmoother.py diff --git a/tests/regression/test_point_eval_api.py b/tests/firedrake/regression/test_point_eval_api.py similarity index 100% rename from tests/regression/test_point_eval_api.py rename to tests/firedrake/regression/test_point_eval_api.py diff --git a/tests/regression/test_point_eval_cells.py b/tests/firedrake/regression/test_point_eval_cells.py similarity index 100% rename from tests/regression/test_point_eval_cells.py rename to tests/firedrake/regression/test_point_eval_cells.py diff --git a/tests/regression/test_point_eval_fs.py b/tests/firedrake/regression/test_point_eval_fs.py similarity index 100% rename from tests/regression/test_point_eval_fs.py rename to tests/firedrake/regression/test_point_eval_fs.py diff --git a/tests/regression/test_poisson_mixed_no_bcs.py b/tests/firedrake/regression/test_poisson_mixed_no_bcs.py similarity index 100% rename from tests/regression/test_poisson_mixed_no_bcs.py rename to tests/firedrake/regression/test_poisson_mixed_no_bcs.py diff --git a/tests/regression/test_poisson_mixed_strong_bcs.py b/tests/firedrake/regression/test_poisson_mixed_strong_bcs.py similarity index 100% rename from tests/regression/test_poisson_mixed_strong_bcs.py rename to tests/firedrake/regression/test_poisson_mixed_strong_bcs.py diff --git a/tests/regression/test_poisson_sphere.py b/tests/firedrake/regression/test_poisson_sphere.py similarity index 100% rename from tests/regression/test_poisson_sphere.py rename to tests/firedrake/regression/test_poisson_sphere.py diff --git a/tests/regression/test_poisson_strong_bcs.py b/tests/firedrake/regression/test_poisson_strong_bcs.py similarity index 100% rename from tests/regression/test_poisson_strong_bcs.py rename to tests/firedrake/regression/test_poisson_strong_bcs.py diff --git a/tests/regression/test_poisson_strong_bcs_nitsche.py b/tests/firedrake/regression/test_poisson_strong_bcs_nitsche.py similarity index 100% rename from tests/regression/test_poisson_strong_bcs_nitsche.py rename to tests/firedrake/regression/test_poisson_strong_bcs_nitsche.py diff --git a/tests/regression/test_project_interp_KMV.py b/tests/firedrake/regression/test_project_interp_KMV.py similarity index 96% rename from tests/regression/test_project_interp_KMV.py rename to tests/firedrake/regression/test_project_interp_KMV.py index 28ed787344..44ca5ec59c 100644 --- a/tests/regression/test_project_interp_KMV.py +++ b/tests/firedrake/regression/test_project_interp_KMV.py @@ -1,12 +1,9 @@ -import firedrake_configuration import pytest import numpy as np from firedrake import * from firedrake.__future__ import * import finat -config = firedrake_configuration.get_config() - @pytest.fixture(params=["square", "cube"]) def mesh_type(request): diff --git a/tests/regression/test_projection.py b/tests/firedrake/regression/test_projection.py similarity index 100% rename from tests/regression/test_projection.py rename to tests/firedrake/regression/test_projection.py diff --git a/tests/regression/test_projection_direct_serendipity.py b/tests/firedrake/regression/test_projection_direct_serendipity.py similarity index 100% rename from tests/regression/test_projection_direct_serendipity.py rename to tests/firedrake/regression/test_projection_direct_serendipity.py diff --git a/tests/regression/test_projection_symmetric_tensor.py b/tests/firedrake/regression/test_projection_symmetric_tensor.py similarity index 100% rename from tests/regression/test_projection_symmetric_tensor.py rename to tests/firedrake/regression/test_projection_symmetric_tensor.py diff --git a/tests/regression/test_projection_zany.py b/tests/firedrake/regression/test_projection_zany.py similarity index 100% rename from tests/regression/test_projection_zany.py rename to tests/firedrake/regression/test_projection_zany.py diff --git a/tests/regression/test_prolong_ncf_cube.py b/tests/firedrake/regression/test_prolong_ncf_cube.py similarity index 100% rename from tests/regression/test_prolong_ncf_cube.py rename to tests/firedrake/regression/test_prolong_ncf_cube.py diff --git a/tests/regression/test_pytorch_coupling.py b/tests/firedrake/regression/test_pytorch_coupling.py similarity index 100% rename from tests/regression/test_pytorch_coupling.py rename to tests/firedrake/regression/test_pytorch_coupling.py diff --git a/tests/regression/test_quadrature.py b/tests/firedrake/regression/test_quadrature.py similarity index 100% rename from tests/regression/test_quadrature.py rename to tests/firedrake/regression/test_quadrature.py diff --git a/tests/regression/test_real_space.py b/tests/firedrake/regression/test_real_space.py similarity index 100% rename from tests/regression/test_real_space.py rename to tests/firedrake/regression/test_real_space.py diff --git a/tests/regression/test_restricted_function_space.py b/tests/firedrake/regression/test_restricted_function_space.py similarity index 100% rename from tests/regression/test_restricted_function_space.py rename to tests/firedrake/regression/test_restricted_function_space.py diff --git a/tests/regression/test_scaled_mass.py b/tests/firedrake/regression/test_scaled_mass.py similarity index 100% rename from tests/regression/test_scaled_mass.py rename to tests/firedrake/regression/test_scaled_mass.py diff --git a/tests/regression/test_serendipity_biharmonic.py b/tests/firedrake/regression/test_serendipity_biharmonic.py similarity index 100% rename from tests/regression/test_serendipity_biharmonic.py rename to tests/firedrake/regression/test_serendipity_biharmonic.py diff --git a/tests/regression/test_slepc.py b/tests/firedrake/regression/test_slepc.py similarity index 100% rename from tests/regression/test_slepc.py rename to tests/firedrake/regression/test_slepc.py diff --git a/tests/regression/test_solver_error_checking.py b/tests/firedrake/regression/test_solver_error_checking.py similarity index 100% rename from tests/regression/test_solver_error_checking.py rename to tests/firedrake/regression/test_solver_error_checking.py diff --git a/tests/regression/test_solvers_options_prefix.py b/tests/firedrake/regression/test_solvers_options_prefix.py similarity index 100% rename from tests/regression/test_solvers_options_prefix.py rename to tests/firedrake/regression/test_solvers_options_prefix.py diff --git a/tests/regression/test_solving_interface.py b/tests/firedrake/regression/test_solving_interface.py similarity index 100% rename from tests/regression/test_solving_interface.py rename to tests/firedrake/regression/test_solving_interface.py diff --git a/tests/regression/test_split.py b/tests/firedrake/regression/test_split.py similarity index 100% rename from tests/regression/test_split.py rename to tests/firedrake/regression/test_split.py diff --git a/tests/regression/test_split_communicators.py b/tests/firedrake/regression/test_split_communicators.py similarity index 100% rename from tests/regression/test_split_communicators.py rename to tests/firedrake/regression/test_split_communicators.py diff --git a/tests/regression/test_star_pc.py b/tests/firedrake/regression/test_star_pc.py similarity index 100% rename from tests/regression/test_star_pc.py rename to tests/firedrake/regression/test_star_pc.py diff --git a/tests/regression/test_steady_advection_2D.py b/tests/firedrake/regression/test_steady_advection_2D.py similarity index 100% rename from tests/regression/test_steady_advection_2D.py rename to tests/firedrake/regression/test_steady_advection_2D.py diff --git a/tests/regression/test_steady_advection_3D.py b/tests/firedrake/regression/test_steady_advection_3D.py similarity index 100% rename from tests/regression/test_steady_advection_3D.py rename to tests/firedrake/regression/test_steady_advection_3D.py diff --git a/tests/regression/test_stokes_hdiv_parallel.py b/tests/firedrake/regression/test_stokes_hdiv_parallel.py similarity index 100% rename from tests/regression/test_stokes_hdiv_parallel.py rename to tests/firedrake/regression/test_stokes_hdiv_parallel.py diff --git a/tests/regression/test_stokes_mini.py b/tests/firedrake/regression/test_stokes_mini.py similarity index 100% rename from tests/regression/test_stokes_mini.py rename to tests/firedrake/regression/test_stokes_mini.py diff --git a/tests/regression/test_stress_elements.py b/tests/firedrake/regression/test_stress_elements.py similarity index 100% rename from tests/regression/test_stress_elements.py rename to tests/firedrake/regression/test_stress_elements.py diff --git a/tests/regression/test_subdomain.py b/tests/firedrake/regression/test_subdomain.py similarity index 100% rename from tests/regression/test_subdomain.py rename to tests/firedrake/regression/test_subdomain.py diff --git a/tests/regression/test_subdomain_integrals.py b/tests/firedrake/regression/test_subdomain_integrals.py similarity index 100% rename from tests/regression/test_subdomain_integrals.py rename to tests/firedrake/regression/test_subdomain_integrals.py diff --git a/tests/regression/test_taylor.py b/tests/firedrake/regression/test_taylor.py similarity index 100% rename from tests/regression/test_taylor.py rename to tests/firedrake/regression/test_taylor.py diff --git a/tests/regression/test_tensor_algebra.py b/tests/firedrake/regression/test_tensor_algebra.py similarity index 100% rename from tests/regression/test_tensor_algebra.py rename to tests/firedrake/regression/test_tensor_algebra.py diff --git a/tests/regression/test_tensor_elements.py b/tests/firedrake/regression/test_tensor_elements.py similarity index 100% rename from tests/regression/test_tensor_elements.py rename to tests/firedrake/regression/test_tensor_elements.py diff --git a/tests/regression/test_trace_galerkin_projection.py b/tests/firedrake/regression/test_trace_galerkin_projection.py similarity index 100% rename from tests/regression/test_trace_galerkin_projection.py rename to tests/firedrake/regression/test_trace_galerkin_projection.py diff --git a/tests/regression/test_ufl.py b/tests/firedrake/regression/test_ufl.py similarity index 100% rename from tests/regression/test_ufl.py rename to tests/firedrake/regression/test_ufl.py diff --git a/tests/regression/test_upwind_flux.py b/tests/firedrake/regression/test_upwind_flux.py similarity index 100% rename from tests/regression/test_upwind_flux.py rename to tests/firedrake/regression/test_upwind_flux.py diff --git a/tests/regression/test_variable_layers.py b/tests/firedrake/regression/test_variable_layers.py similarity index 100% rename from tests/regression/test_variable_layers.py rename to tests/firedrake/regression/test_variable_layers.py diff --git a/tests/regression/test_variants.py b/tests/firedrake/regression/test_variants.py similarity index 100% rename from tests/regression/test_variants.py rename to tests/firedrake/regression/test_variants.py diff --git a/tests/regression/test_vector.py b/tests/firedrake/regression/test_vector.py similarity index 100% rename from tests/regression/test_vector.py rename to tests/firedrake/regression/test_vector.py diff --git a/tests/regression/test_vector_laplace_on_quadrilaterals.py b/tests/firedrake/regression/test_vector_laplace_on_quadrilaterals.py similarity index 100% rename from tests/regression/test_vector_laplace_on_quadrilaterals.py rename to tests/firedrake/regression/test_vector_laplace_on_quadrilaterals.py diff --git a/tests/regression/test_vertex_based_limiter.py b/tests/firedrake/regression/test_vertex_based_limiter.py similarity index 100% rename from tests/regression/test_vertex_based_limiter.py rename to tests/firedrake/regression/test_vertex_based_limiter.py diff --git a/tests/regression/test_vfs_component_bcs.py b/tests/firedrake/regression/test_vfs_component_bcs.py similarity index 100% rename from tests/regression/test_vfs_component_bcs.py rename to tests/firedrake/regression/test_vfs_component_bcs.py diff --git a/tests/regression/test_work_functions.py b/tests/firedrake/regression/test_work_functions.py similarity index 100% rename from tests/regression/test_work_functions.py rename to tests/firedrake/regression/test_work_functions.py diff --git a/tests/regression/test_zero_forms.py b/tests/firedrake/regression/test_zero_forms.py similarity index 100% rename from tests/regression/test_zero_forms.py rename to tests/firedrake/regression/test_zero_forms.py diff --git a/tests/regression/test_zero_integrand.py b/tests/firedrake/regression/test_zero_integrand.py similarity index 100% rename from tests/regression/test_zero_integrand.py rename to tests/firedrake/regression/test_zero_integrand.py diff --git a/tests/slate/conftest.py b/tests/firedrake/slate/conftest.py similarity index 85% rename from tests/slate/conftest.py rename to tests/firedrake/slate/conftest.py index bfc31bad38..c2e6a7d9c9 100644 --- a/tests/slate/conftest.py +++ b/tests/firedrake/slate/conftest.py @@ -5,7 +5,7 @@ def pytest_collection_modifyitems(session, config, items): from firedrake.utils import complex_mode, SLATE_SUPPORTS_COMPLEX for item in items: test_file, *_ = item.location - if not test_file.startswith("tests/slate/"): + if not test_file.startswith("tests/firedrake/slate/"): continue if not SLATE_SUPPORTS_COMPLEX and complex_mode: item.add_marker(pytest.mark.skip(reason="Slate support for complex mode is missing")) diff --git a/tests/slate/script_logging.py b/tests/firedrake/slate/script_logging.py similarity index 100% rename from tests/slate/script_logging.py rename to tests/firedrake/slate/script_logging.py diff --git a/tests/slate/test_assemble_tensors.py b/tests/firedrake/slate/test_assemble_tensors.py similarity index 100% rename from tests/slate/test_assemble_tensors.py rename to tests/firedrake/slate/test_assemble_tensors.py diff --git a/tests/slate/test_cg_poisson.py b/tests/firedrake/slate/test_cg_poisson.py similarity index 100% rename from tests/slate/test_cg_poisson.py rename to tests/firedrake/slate/test_cg_poisson.py diff --git a/tests/slate/test_darcy_hybridized_mixed.py b/tests/firedrake/slate/test_darcy_hybridized_mixed.py similarity index 100% rename from tests/slate/test_darcy_hybridized_mixed.py rename to tests/firedrake/slate/test_darcy_hybridized_mixed.py diff --git a/tests/slate/test_facet_tensors.py b/tests/firedrake/slate/test_facet_tensors.py similarity index 100% rename from tests/slate/test_facet_tensors.py rename to tests/firedrake/slate/test_facet_tensors.py diff --git a/tests/slate/test_facet_tensors_extr.py b/tests/firedrake/slate/test_facet_tensors_extr.py similarity index 100% rename from tests/slate/test_facet_tensors_extr.py rename to tests/firedrake/slate/test_facet_tensors_extr.py diff --git a/tests/slate/test_hdg_poisson.py b/tests/firedrake/slate/test_hdg_poisson.py similarity index 100% rename from tests/slate/test_hdg_poisson.py rename to tests/firedrake/slate/test_hdg_poisson.py diff --git a/tests/slate/test_hybrid_poisson_sphere.py b/tests/firedrake/slate/test_hybrid_poisson_sphere.py similarity index 100% rename from tests/slate/test_hybrid_poisson_sphere.py rename to tests/firedrake/slate/test_hybrid_poisson_sphere.py diff --git a/tests/slate/test_linear_algebra.py b/tests/firedrake/slate/test_linear_algebra.py similarity index 100% rename from tests/slate/test_linear_algebra.py rename to tests/firedrake/slate/test_linear_algebra.py diff --git a/tests/slate/test_local_logging.py b/tests/firedrake/slate/test_local_logging.py similarity index 100% rename from tests/slate/test_local_logging.py rename to tests/firedrake/slate/test_local_logging.py diff --git a/tests/slate/test_matrix_free_hybridization.py b/tests/firedrake/slate/test_matrix_free_hybridization.py similarity index 100% rename from tests/slate/test_matrix_free_hybridization.py rename to tests/firedrake/slate/test_matrix_free_hybridization.py diff --git a/tests/slate/test_mimetic.py b/tests/firedrake/slate/test_mimetic.py similarity index 100% rename from tests/slate/test_mimetic.py rename to tests/firedrake/slate/test_mimetic.py diff --git a/tests/slate/test_optimise.py b/tests/firedrake/slate/test_optimise.py similarity index 100% rename from tests/slate/test_optimise.py rename to tests/firedrake/slate/test_optimise.py diff --git a/tests/slate/test_orientations.py b/tests/firedrake/slate/test_orientations.py similarity index 100% rename from tests/slate/test_orientations.py rename to tests/firedrake/slate/test_orientations.py diff --git a/tests/slate/test_scalar_tensors.py b/tests/firedrake/slate/test_scalar_tensors.py similarity index 100% rename from tests/slate/test_scalar_tensors.py rename to tests/firedrake/slate/test_scalar_tensors.py diff --git a/tests/slate/test_scalar_tensors_extr.py b/tests/firedrake/slate/test_scalar_tensors_extr.py similarity index 100% rename from tests/slate/test_scalar_tensors_extr.py rename to tests/firedrake/slate/test_scalar_tensors_extr.py diff --git a/tests/slate/test_slac.py b/tests/firedrake/slate/test_slac.py similarity index 100% rename from tests/slate/test_slac.py rename to tests/firedrake/slate/test_slac.py diff --git a/tests/slate/test_slac_parallel.py b/tests/firedrake/slate/test_slac_parallel.py similarity index 100% rename from tests/slate/test_slac_parallel.py rename to tests/firedrake/slate/test_slac_parallel.py diff --git a/tests/slate/test_slate_hybridization.py b/tests/firedrake/slate/test_slate_hybridization.py similarity index 100% rename from tests/slate/test_slate_hybridization.py rename to tests/firedrake/slate/test_slate_hybridization.py diff --git a/tests/slate/test_slate_hybridization_extr.py b/tests/firedrake/slate/test_slate_hybridization_extr.py similarity index 100% rename from tests/slate/test_slate_hybridization_extr.py rename to tests/firedrake/slate/test_slate_hybridization_extr.py diff --git a/tests/slate/test_slate_hybridized_mixed_bcs.py b/tests/firedrake/slate/test_slate_hybridized_mixed_bcs.py similarity index 100% rename from tests/slate/test_slate_hybridized_mixed_bcs.py rename to tests/firedrake/slate/test_slate_hybridized_mixed_bcs.py diff --git a/tests/slate/test_slate_infrastructure.py b/tests/firedrake/slate/test_slate_infrastructure.py similarity index 100% rename from tests/slate/test_slate_infrastructure.py rename to tests/firedrake/slate/test_slate_infrastructure.py diff --git a/tests/slate/test_slate_mixed_direct.py b/tests/firedrake/slate/test_slate_mixed_direct.py similarity index 100% rename from tests/slate/test_slate_mixed_direct.py rename to tests/firedrake/slate/test_slate_mixed_direct.py diff --git a/tests/slate/test_subdomains.py b/tests/firedrake/slate/test_subdomains.py similarity index 100% rename from tests/slate/test_subdomains.py rename to tests/firedrake/slate/test_subdomains.py diff --git a/tests/slate/test_unaryop_precedence.py b/tests/firedrake/slate/test_unaryop_precedence.py similarity index 100% rename from tests/slate/test_unaryop_precedence.py rename to tests/firedrake/slate/test_unaryop_precedence.py diff --git a/tests/slate/test_variational_prb.py b/tests/firedrake/slate/test_variational_prb.py similarity index 100% rename from tests/slate/test_variational_prb.py rename to tests/firedrake/slate/test_variational_prb.py diff --git a/tests/slate/test_zany_element_tensors.py b/tests/firedrake/slate/test_zany_element_tensors.py similarity index 100% rename from tests/slate/test_zany_element_tensors.py rename to tests/firedrake/slate/test_zany_element_tensors.py diff --git a/tests/submesh/test_submesh_interpolate.py b/tests/firedrake/submesh/test_submesh_interpolate.py similarity index 100% rename from tests/submesh/test_submesh_interpolate.py rename to tests/firedrake/submesh/test_submesh_interpolate.py diff --git a/tests/supermesh/test_assemble_mixed_mass_matrix.py b/tests/firedrake/supermesh/test_assemble_mixed_mass_matrix.py similarity index 100% rename from tests/supermesh/test_assemble_mixed_mass_matrix.py rename to tests/firedrake/supermesh/test_assemble_mixed_mass_matrix.py diff --git a/tests/supermesh/test_galerkin_projection.py b/tests/firedrake/supermesh/test_galerkin_projection.py similarity index 100% rename from tests/supermesh/test_galerkin_projection.py rename to tests/firedrake/supermesh/test_galerkin_projection.py diff --git a/tests/supermesh/test_intersection_finder_nested.py b/tests/firedrake/supermesh/test_intersection_finder_nested.py similarity index 100% rename from tests/supermesh/test_intersection_finder_nested.py rename to tests/firedrake/supermesh/test_intersection_finder_nested.py diff --git a/tests/supermesh/test_nonnested_project.py b/tests/firedrake/supermesh/test_nonnested_project.py similarity index 100% rename from tests/supermesh/test_nonnested_project.py rename to tests/firedrake/supermesh/test_nonnested_project.py diff --git a/tests/supermesh/test_nonnested_project_no_hierarchy.py b/tests/firedrake/supermesh/test_nonnested_project_no_hierarchy.py similarity index 100% rename from tests/supermesh/test_nonnested_project_no_hierarchy.py rename to tests/firedrake/supermesh/test_nonnested_project_no_hierarchy.py diff --git a/tests/supermesh/test_periodic.py b/tests/firedrake/supermesh/test_periodic.py similarity index 100% rename from tests/supermesh/test_periodic.py rename to tests/firedrake/supermesh/test_periodic.py diff --git a/tests/test_0init.py b/tests/firedrake/test_0init.py similarity index 70% rename from tests/test_0init.py rename to tests/firedrake/test_0init.py index 99f82e49c5..82d1a395ef 100644 --- a/tests/test_0init.py +++ b/tests/firedrake/test_0init.py @@ -1,6 +1,7 @@ import pytest import os from firedrake import * +from pathlib import Path # See https://pytest-xdist.readthedocs.io/en/stable/how-to.html#identifying-the-worker-process-during-a-test @@ -26,19 +27,7 @@ def test_pyop2_custom_init(): op2.configuration.reset() -def test_int_type(): - import firedrake_configuration - from firedrake.utils import IntType - - expected = firedrake_configuration.get_config()["options"]["petsc_int_type"] - actual = {4: "int32", 8: "int64"}[IntType.itemsize] - - assert expected == actual - - def test_pyop2_cache_dir_set_correctly(): - from firedrake_configuration import get_config - - config = get_config() - cache_dir = os.path.join(config["options"]["cache_dir"], "pyop2") + root = Path(os.environ.get("VIRTUAL_ENV", "~")).joinpath(".cache") + cache_dir = os.environ.get("PYOP2_CACHE_DIR", str(root.joinpath("pyop2"))) assert op2.configuration["cache_dir"] == cache_dir diff --git a/tests/test_tsfc_interface.py b/tests/firedrake/test_tsfc_interface.py similarity index 100% rename from tests/test_tsfc_interface.py rename to tests/firedrake/test_tsfc_interface.py diff --git a/tests/unit/test_fml/test_label.py b/tests/firedrake/unit/test_fml/test_label.py similarity index 100% rename from tests/unit/test_fml/test_label.py rename to tests/firedrake/unit/test_fml/test_label.py diff --git a/tests/unit/test_fml/test_label_map.py b/tests/firedrake/unit/test_fml/test_label_map.py similarity index 100% rename from tests/unit/test_fml/test_label_map.py rename to tests/firedrake/unit/test_fml/test_label_map.py diff --git a/tests/unit/test_fml/test_labelled_form.py b/tests/firedrake/unit/test_fml/test_labelled_form.py similarity index 100% rename from tests/unit/test_fml/test_labelled_form.py rename to tests/firedrake/unit/test_fml/test_labelled_form.py diff --git a/tests/unit/test_fml/test_replace_perp.py b/tests/firedrake/unit/test_fml/test_replace_perp.py similarity index 100% rename from tests/unit/test_fml/test_replace_perp.py rename to tests/firedrake/unit/test_fml/test_replace_perp.py diff --git a/tests/unit/test_fml/test_replacement.py b/tests/firedrake/unit/test_fml/test_replacement.py similarity index 100% rename from tests/unit/test_fml/test_replacement.py rename to tests/firedrake/unit/test_fml/test_replacement.py diff --git a/tests/unit/test_fml/test_term.py b/tests/firedrake/unit/test_fml/test_term.py similarity index 100% rename from tests/unit/test_fml/test_term.py rename to tests/firedrake/unit/test_fml/test_term.py diff --git a/tests/unit/test_utils/test_uid.py b/tests/firedrake/unit/test_utils/test_uid.py similarity index 100% rename from tests/unit/test_utils/test_uid.py rename to tests/firedrake/unit/test_utils/test_uid.py diff --git a/tests/vertexonly/test_different_comms.py b/tests/firedrake/vertexonly/test_different_comms.py similarity index 100% rename from tests/vertexonly/test_different_comms.py rename to tests/firedrake/vertexonly/test_different_comms.py diff --git a/tests/vertexonly/test_interpolation_from_parent.py b/tests/firedrake/vertexonly/test_interpolation_from_parent.py similarity index 100% rename from tests/vertexonly/test_interpolation_from_parent.py rename to tests/firedrake/vertexonly/test_interpolation_from_parent.py diff --git a/tests/vertexonly/test_point_eval_immersed_manifold.py b/tests/firedrake/vertexonly/test_point_eval_immersed_manifold.py similarity index 100% rename from tests/vertexonly/test_point_eval_immersed_manifold.py rename to tests/firedrake/vertexonly/test_point_eval_immersed_manifold.py diff --git a/tests/vertexonly/test_poisson_inverse_conductivity.py b/tests/firedrake/vertexonly/test_poisson_inverse_conductivity.py similarity index 100% rename from tests/vertexonly/test_poisson_inverse_conductivity.py rename to tests/firedrake/vertexonly/test_poisson_inverse_conductivity.py diff --git a/tests/vertexonly/test_swarm.py b/tests/firedrake/vertexonly/test_swarm.py similarity index 100% rename from tests/vertexonly/test_swarm.py rename to tests/firedrake/vertexonly/test_swarm.py diff --git a/tests/vertexonly/test_vertex_only_fs.py b/tests/firedrake/vertexonly/test_vertex_only_fs.py similarity index 100% rename from tests/vertexonly/test_vertex_only_fs.py rename to tests/firedrake/vertexonly/test_vertex_only_fs.py diff --git a/tests/vertexonly/test_vertex_only_manual.py b/tests/firedrake/vertexonly/test_vertex_only_manual.py similarity index 100% rename from tests/vertexonly/test_vertex_only_manual.py rename to tests/firedrake/vertexonly/test_vertex_only_manual.py diff --git a/tests/vertexonly/test_vertex_only_mesh_generation.py b/tests/firedrake/vertexonly/test_vertex_only_mesh_generation.py similarity index 100% rename from tests/vertexonly/test_vertex_only_mesh_generation.py rename to tests/firedrake/vertexonly/test_vertex_only_mesh_generation.py diff --git a/tests/output/test_config_exist.py b/tests/output/test_config_exist.py deleted file mode 100644 index bfc0a37145..0000000000 --- a/tests/output/test_config_exist.py +++ /dev/null @@ -1,4 +0,0 @@ -def test_config_exist(): - import firedrake_configuration - config = firedrake_configuration.get_config() - assert config is not None diff --git a/test/unit/test_api.py b/tests/pyop2/test_api.py similarity index 100% rename from test/unit/test_api.py rename to tests/pyop2/test_api.py diff --git a/test/unit/test_caching.py b/tests/pyop2/test_caching.py similarity index 100% rename from test/unit/test_caching.py rename to tests/pyop2/test_caching.py diff --git a/test/unit/test_callables.py b/tests/pyop2/test_callables.py similarity index 100% rename from test/unit/test_callables.py rename to tests/pyop2/test_callables.py diff --git a/test/unit/test_configuration.py b/tests/pyop2/test_configuration.py similarity index 100% rename from test/unit/test_configuration.py rename to tests/pyop2/test_configuration.py diff --git a/test/unit/test_dats.py b/tests/pyop2/test_dats.py similarity index 100% rename from test/unit/test_dats.py rename to tests/pyop2/test_dats.py diff --git a/test/unit/test_direct_loop.py b/tests/pyop2/test_direct_loop.py similarity index 100% rename from test/unit/test_direct_loop.py rename to tests/pyop2/test_direct_loop.py diff --git a/test/unit/test_extrusion.py b/tests/pyop2/test_extrusion.py similarity index 100% rename from test/unit/test_extrusion.py rename to tests/pyop2/test_extrusion.py diff --git a/test/unit/test_global_reduction.py b/tests/pyop2/test_global_reduction.py similarity index 100% rename from test/unit/test_global_reduction.py rename to tests/pyop2/test_global_reduction.py diff --git a/test/unit/test_globals.py b/tests/pyop2/test_globals.py similarity index 100% rename from test/unit/test_globals.py rename to tests/pyop2/test_globals.py diff --git a/test/unit/test_indirect_loop.py b/tests/pyop2/test_indirect_loop.py similarity index 100% rename from test/unit/test_indirect_loop.py rename to tests/pyop2/test_indirect_loop.py diff --git a/test/unit/test_iteration_space_dats.py b/tests/pyop2/test_iteration_space_dats.py similarity index 100% rename from test/unit/test_iteration_space_dats.py rename to tests/pyop2/test_iteration_space_dats.py diff --git a/test/unit/test_linalg.py b/tests/pyop2/test_linalg.py similarity index 100% rename from test/unit/test_linalg.py rename to tests/pyop2/test_linalg.py diff --git a/test/unit/test_linalg_complex.py b/tests/pyop2/test_linalg_complex.py similarity index 100% rename from test/unit/test_linalg_complex.py rename to tests/pyop2/test_linalg_complex.py diff --git a/test/unit/test_matrices.py b/tests/pyop2/test_matrices.py similarity index 100% rename from test/unit/test_matrices.py rename to tests/pyop2/test_matrices.py diff --git a/test/unit/test_petsc.py b/tests/pyop2/test_petsc.py similarity index 100% rename from test/unit/test_petsc.py rename to tests/pyop2/test_petsc.py diff --git a/test/unit/test_subset.py b/tests/pyop2/test_subset.py similarity index 100% rename from test/unit/test_subset.py rename to tests/pyop2/test_subset.py diff --git a/test/unit/test_vector_map.py b/tests/pyop2/test_vector_map.py similarity index 100% rename from test/unit/test_vector_map.py rename to tests/pyop2/test_vector_map.py