diff --git a/.github/workflows/book_stable.yml b/.github/workflows/book_stable.yml index b33b0a8d..77e83091 100644 --- a/.github/workflows/book_stable.yml +++ b/.github/workflows/book_stable.yml @@ -15,13 +15,13 @@ env: jobs: build-book: runs-on: ubuntu-latest - container: ghcr.io/fenics/dolfinx/lab:v0.7.1 + container: ghcr.io/fenics/dolfinx/lab:v0.7.2 env: PYVISTA_TRAME_SERVER_PROXY_PREFIX: "/proxy/" PYVISTA_TRAME_SERVER_PROXY_ENABLED: "True" PYVISTA_OFF_SCREEN: false - PYVISTA_JUPYTER_BACKEND: "panel" + PYVISTA_JUPYTER_BACKEND: "html" steps: - uses: actions/checkout@v4 @@ -30,7 +30,7 @@ jobs: uses: ./.github/actions/install-dependencies - name: Install book deps - run: python3 -m pip install -r docker/requirements.txt + run: python3 -m pip install --no-binary=h5py . - name: Build the book run: jupyter-book build . -W diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index bf1d5bdd..ade2d945 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -44,7 +44,7 @@ jobs: uses: actions/checkout@v4 - name: Setup Pages - uses: actions/configure-pages@v2 + uses: actions/configure-pages@v4 - name: Download docs artifact uses: actions/download-artifact@v3 @@ -53,10 +53,10 @@ jobs: path: "./public" - name: Upload page artifact - uses: actions/upload-pages-artifact@v1 + uses: actions/upload-pages-artifact@v2 with: path: "./public" - name: Deploy coverage report to GH Pages id: deployment - uses: actions/deploy-pages@v1 + uses: actions/deploy-pages@v3 diff --git a/.github/workflows/publish_docker.yml b/.github/workflows/publish_docker.yml index d7113459..fd2bdc84 100644 --- a/.github/workflows/publish_docker.yml +++ b/.github/workflows/publish_docker.yml @@ -44,7 +44,7 @@ jobs: - name: Build and push Docker image uses: docker/build-push-action@v3 with: - context: ./docker + context: . push: true file: docker/Dockerfile platforms: linux/amd64,linux/arm64 diff --git a/.github/workflows/test_nightly.yml b/.github/workflows/test_nightly.yml index 484fe202..ccb882b5 100644 --- a/.github/workflows/test_nightly.yml +++ b/.github/workflows/test_nightly.yml @@ -17,7 +17,7 @@ jobs: test-nightly: # The type of runner that the job will run on runs-on: ubuntu-latest - container: ghcr.io/fenics/dolfinx/lab:v0.7.1 + container: ghcr.io/fenics/dolfinx/lab:nightly env: HDF5_MPI: "ON" @@ -42,7 +42,7 @@ jobs: uses: ./.github/actions/install-dependencies - name: Install requirements - run: python3 -m pip install --no-cache-dir -r docker/requirements.txt --upgrade + run: python3 -m pip install --no-cache-dir --no-binary=h5py . --upgrade - name: Test complex notebooks in parallel run: | diff --git a/.github/workflows/test_stable.yml b/.github/workflows/test_stable.yml index 6b9bc42e..86e2fd8d 100644 --- a/.github/workflows/test_stable.yml +++ b/.github/workflows/test_stable.yml @@ -20,7 +20,7 @@ jobs: test: # The type of runner that the job will run on runs-on: ubuntu-latest - container: ghcr.io/fenics/dolfinx/lab:v0.7.1 + container: ghcr.io/fenics/dolfinx/lab:v0.7.2 env: PYVISTA_OFF_SCREEN: true @@ -32,7 +32,7 @@ jobs: - name: Install additional deps run: | - python3 -m pip install -r docker/requirements.txt + python3 -m pip install --no-binary=h5py . - name: Test complex notebooks in parallel run: | diff --git a/.gitignore b/.gitignore index 66096926..91fd7f7c 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,5 @@ _build **/.cache *.png *.pvtu -*.msh \ No newline at end of file +*.msh +*.bp \ No newline at end of file diff --git a/Changelog.md b/Changelog.md index 685ff8c6..d9bce872 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,9 @@ # Changelog +## v0.7.2 + - Change pyvista backend to `html`, using Pyvista main branch + - Using DOLFINx v0.7.2 https://github.com/FEniCS/dolfinx/releases/tag/v0.7.2 as base + ## v0.7.1 - No API changes, release due to various bug-fixes from the 0.7.0 release, see: https://github.com/FEniCS/dolfinx/releases/tag/v0.7.1 for more information diff --git a/Dockerfile b/Dockerfile index 59e0ad18..4de36870 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/jorgensd/dolfinx-tutorial:v0.7.1 +FROM ghcr.io/jorgensd/dolfinx-tutorial:v0.7.2 # create user with a home directory ARG NB_USER=jovyan diff --git a/README.md b/README.md index 6afd68b6..398c1008 100644 --- a/README.md +++ b/README.md @@ -16,18 +16,24 @@ Any code added to the tutorial should work in parallel. Alternatively, if you want to add a separate chapter, a Jupyter notebook can be added to a pull request, without integrating it into the tutorial. If so, the notebook will be reviewed and modified to be included in the tutorial. +## Dependencies +It is adviced to use a pre-installed version of DOLFINx, for instance through conda or docker. Remaining dependencies can be installed with +```bash +python3 -m pip install --no-binary=h5py -e . +``` + # Docker images Docker images for this tutorial can be found in the [packages tab](https://github.com/jorgensd/dolfinx-tutorial/pkgs/container/dolfinx-tutorial) -Additional requirements on top of the `dolfinx/lab:nightly` images can be found at [Dockerfile](docker/Dockerfile) and [requirements.txt](docker/requirements.txt) +Additional requirements on top of the `dolfinx/lab:nightly` images can be found at [Dockerfile](docker/Dockerfile) and [pyproject.toml](./pyproject.toml) ## An image building DOLFINx, Basix, UFL and FFCx from source can be built using: ```bash cd docker -docker build -f LocalDockerfile -t local_lab_env . +docker build -f ./docker/Dockerfile -t local_lab_env . ``` -and run +from the root of this repository, and run ```bash docker run --rm -ti -v $(pwd):/root/shared -w /root/shared --init -p 8888:8888 local_lab_env ``` diff --git a/_config.yml b/_config.yml index 11695961..e2b77778 100644 --- a/_config.yml +++ b/_config.yml @@ -38,8 +38,8 @@ sphinx: # To avoid warning about default changing due to # https://github.com/pydata/pydata-sphinx-theme/issues/1492 - html_theme_options: - navigation_with_keys: false + # html_theme_options: + # navigation_with_keys: false parse: myst_enable_extensions: - "amsmath" diff --git a/docker/Dockerfile b/docker/Dockerfile index 6987ffec..2aafeb5a 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,6 +1,6 @@ # Execute from root of repo as: docker buildx build --platform=linux/arm64,linux/amd64 -f docker/Dockerfile ./docker/ --progress=plain -FROM ghcr.io/fenics/dolfinx/lab:v0.7.1 +FROM ghcr.io/fenics/dolfinx/lab:v0.7.2 ARG TARGETPLATFORM @@ -29,8 +29,8 @@ RUN echo ${TARGETPLATFORM} RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then python3 -m pip install "https://github.com/finsberg/vtk-aarch64/releases/download/vtk-9.2.6-cp310/vtk-9.2.6.dev0-cp310-cp310-linux_aarch64.whl"; fi RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then python3 -m pip install vtk; fi -ADD requirements.txt /tmp/requirements.txt -RUN python3 -m pip install --no-cache-dir -v -r requirements.txt +ADD pyproject.toml /tmp/pyproject.toml +RUN python3 -m pip install --no-cache-dir --no-binary=h5py -v pyproject.toml RUN python3 -m pip cache purge RUN jupyter lab build ENTRYPOINT ["jupyter", "lab", "--ip", "0.0.0.0", "--no-browser", "--allow-root"] diff --git a/docker/requirements.txt b/docker/requirements.txt deleted file mode 100644 index 768e58b6..00000000 --- a/docker/requirements.txt +++ /dev/null @@ -1,22 +0,0 @@ -# Pyvista -panel - -# Jupyter-book -jupyter-book -# Pin docutils due to https://github.com/executablebooks/jupyter-book/issues/1970#issuecomment-1466051277 -docutils==0.17.1 - -# Meshio -meshio ---no-binary=h5py -h5py - -# Visualization with pandas -seaborn -pandas - -# Progress bar -tqdm - -# Pyvista -pyvista[all] diff --git a/fem.md b/fem.md index 3c5e3feb..17e654e6 100644 --- a/fem.md +++ b/fem.md @@ -40,13 +40,13 @@ The tutorial uses several dependencies for meshing, plotting and timings. A comp To use the notebooks in this tutorial with DOLFINx on your own computer, you should use the docker image using the following command: ```bash - docker run --init -p 8888:8888 -v "$(pwd)":/root/shared ghcr.io/jorgensd/dolfinx-tutorial:v0.7.1 + docker run --init -p 8888:8888 -v "$(pwd)":/root/shared ghcr.io/jorgensd/dolfinx-tutorial:v0.7.2 ``` This image can also be used as a normal docker container by adding: ```bash - docker run --ti -v "$(pwd)":/root/shared --entrypoint="/bin/bash" ghcr.io/jorgensd/dolfinx-tutorial:v0.7.1 + docker run --ti -v "$(pwd)":/root/shared --entrypoint="/bin/bash" ghcr.io/jorgensd/dolfinx-tutorial:v0.7.2 ``` The tutorials can also be exported as a notebook or PDF by clicking the ![Download](save.png)-symbol in the top right corner of the relevant tutorial. The notebook can in turn be used with a Python kernel which has DOLFINx. @@ -58,7 +58,7 @@ The [Dockerfile](https://github.com/FEniCS/dolfinx/blob/main/docker/Dockerfile) provides a definitive build recipe. As the DOLFINx docker images are hosted at Docker-hub, one can directly access the image: ``` -docker run dolfinx/dolfinx:v0.7.1 +docker run dolfinx/dolfinx:v0.7.2 ``` There are several ways of customizing a docker container, such as mounting volumes/sharing folder, setting a working directory, sharing graphical interfaces etc. See `docker run --help` for an extensive list. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..d3811cb8 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,27 @@ +[build-system] +requires = ["setuptools>=64.4.0", "wheel", "pip>=22.3"] +build-backend = "setuptools.build_meta" + +[project] +name = "DOLFINx_Tutorial" +version = "0.7.2" +dependencies = ["jupyter-book", +# Pin docutils due to https://github.com/executablebooks/jupyter-book/issues/1970#issuecomment-1466051277 +"docutils==0.17.1", +"meshio", +"h5py", +"seaborn", +"pandas", +"tqdm", +"pyvista[all]@git+https://github.com/pyvista/pyvista", +"fenics-dolfinx>=0.7.0" +] + +[project.optional-dependencies] +dev = [ + "pdbpp", + "ipython", +] + +[tool.setuptools] +packages = []