You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25-4Lines changed: 25 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,15 +10,36 @@ If you have any comments, corrections or questions, please submit an issue in th
10
10
11
11
## Contributing
12
12
13
-
If you want to contribute to this tutorial, please make a fork of the repository, make your changes, and test that the CI passes. You can do this locally by downloading [act](https://github.com/nektos/act) and call
13
+
If you want to contribute to this tutorial, please make a fork of the repository, make your changes, and test that the CI passes.
14
14
15
+
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.
16
+
17
+
Any code added to the tutorial should work in parallel. If any changes are made to `ipynb` files, please ensure that these changes are reflected in the corresponding `py` files by using [`jupytext`](https://jupytext.readthedocs.io/en/latest/faq.html#can-i-use-jupytext-with-jupyterhub-binder-nteract-colab-saturn-or-azure):
18
+
19
+
20
+
## Building the book and running code
21
+
The book is built using [jupyterbook](https://jupyterbook.org/). The following environment variables should be set if you want to build the book
15
22
```bash
16
-
act -j test-nightly
23
+
PYVISTA_OFF_SCREEN=false
24
+
PYVISTA_JUPYTER_BACKEND="html"
25
+
JUPYTER_EXTENSION_ENABLED=true
26
+
LIBGL_ALWAYS_SOFTWARE=1
17
27
```
18
28
19
-
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.
29
+
If you run the tutorial using `jupyter-lab`, for instance through `conda`, one should set the following environment variables
30
+
```bash
31
+
PYVISTA_OFF_SCREEN=false
32
+
PYVISTA_JUPYTER_BACKEND="trame"
33
+
JUPYTER_EXTENSION_ENABLED=true
34
+
LIBGL_ALWAYS_SOFTWARE=1
35
+
```
36
+
If you use docker to run your code, you should set the following variables:
To run python scripts, either choose `PYVISTA_OFF_SCREEN=True` to get screenshots, or render interactive plots with `PYVISTA_OFF_SCREEN=False`
20
42
21
-
Any code added to the tutorial should work in parallel. If any changes are made to `ipynb` files, please ensure that these changes are reflected in the corresponding `py` files by using [`jupytext`](https://jupytext.readthedocs.io/en/latest/faq.html#can-i-use-jupytext-with-jupyterhub-binder-nteract-colab-saturn-or-azure):
Copy file name to clipboardExpand all lines: chapter1/fundamentals_code.ipynb
+5-3Lines changed: 5 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -407,9 +407,10 @@
407
407
"source": [
408
408
"## Plotting the mesh using pyvista\n",
409
409
"We will visualizing the mesh using [pyvista](https://docs.pyvista.org/), an interface to the VTK toolkit.\n",
410
-
"We start by converting the mesh to a format that can be used with `pyvista`.\n",
411
-
"To do this we use the function `dolfinx.plot.vtk_mesh`. The first step is to create an unstructured grid that can be used by `pyvista`.\n",
412
-
"We need to start a virtual framebuffer for plotting through docker containers. You can print the current backend and change it with `pyvista.set_jupyter_backend(backend)`"
410
+
"We start by converting the mesh to a format that can be used with {py:mod}`pyvista`.\n",
411
+
"To do this we use the function {py:func}`dolfinx.plot.vtk_mesh`.\n",
412
+
"It creates the data required to create a {py:class}`pyvista.UnstructuredGrid`.\n",
413
+
"You can print the current backend and change it with {py:func}`pyvista.set_jupyter_backend`."
Copy file name to clipboardExpand all lines: chapter1/fundamentals_code.py
+4-3Lines changed: 4 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -222,9 +222,10 @@
222
222
223
223
# ## Plotting the mesh using pyvista
224
224
# We will visualizing the mesh using [pyvista](https://docs.pyvista.org/), an interface to the VTK toolkit.
225
-
# We start by converting the mesh to a format that can be used with `pyvista`.
226
-
# To do this we use the function `dolfinx.plot.vtk_mesh`. The first step is to create an unstructured grid that can be used by `pyvista`.
227
-
# We need to start a virtual framebuffer for plotting through docker containers. You can print the current backend and change it with `pyvista.set_jupyter_backend(backend)`
225
+
# We start by converting the mesh to a format that can be used with {py:mod}`pyvista`.
226
+
# To do this we use the function {py:func}`dolfinx.plot.vtk_mesh`.
227
+
# It creates the data required to create a {py:class}`pyvista.UnstructuredGrid`.
228
+
# You can print the current backend and change it with {py:func}`pyvista.set_jupyter_backend`.
0 commit comments