Skip to content

Commit 0e4830a

Browse files
Tutorial for Edinburgh (#564)
* Installation instructions * Started on notebook on how to add a new problem class * Added loads of stuff to first tutorial notebook * Minor changes * Wrote most of pySDC+Firedrake notebook * Did more for the coupling thing * Started on third notebook * Cleaned up some stuff * Added notebook describing pySDC in general * Small fixes * Added section using pySDC as integrator within libs * Final touches * Cleanup * Replaced all pdf images with pngs
1 parent f260c40 commit 0e4830a

13 files changed

+2207
-0
lines changed

pySDC/playgrounds/PinT_Workshop_2025/0_pySDC.ipynb

Lines changed: 628 additions & 0 deletions
Large diffs are not rendered by default.

pySDC/playgrounds/PinT_Workshop_2025/1_Add_problem_class.ipynb

Lines changed: 649 additions & 0 deletions
Large diffs are not rendered by default.

pySDC/playgrounds/PinT_Workshop_2025/2_Coupling_pySDC_to_libraries.ipynb

Lines changed: 824 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
pySDC Tutorial at 14th PinT Workshop
2+
====================================
3+
**Time**: July 7, 2025
4+
5+
**Place**: ICMS, Edinburgh
6+
7+
Installation
8+
------------
9+
In order to start playing, install `pySDC` and its dependencies, ideally in developer mode.
10+
First, we need to download the repository.
11+
There are multiple ways to do that, but if you plan to work with `pySDC` directly, the best way is to
12+
(1) `fork <https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks>`_
13+
the main repository to your Github account and then
14+
(2) `clone <https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository>`_ it from there.
15+
This way you can work on a separate repository while being able to pull updates from the main one and
16+
starting pull requests to merge back your ideas.
17+
You can also clone the main repository, but this will not accept your pushes.
18+
Downloading `pySDC` as a tarball is the easiest, but also the least favorable solution.
19+
Finally, the code can also be obtained using ``pip install``, but then sources are not that easily accessible.
20+
21+
So, please go ahead and clone from your fork on Github:
22+
23+
.. code-block:: bash
24+
25+
git clone https://github.com/<your_account>/pySDC.git
26+
27+
Next, navigate to the directory that contains this file and setup up a virtual environment, e.g. by using `Micromamba <https://mamba.readthedocs.io/en/latest/user_guide/micromamba.html>`_.
28+
From the root directory of `pySDC`, you can run
29+
30+
.. code-block:: bash
31+
32+
cd <pySDC-root-dir>/pySDC/playgrounds/PinT_Workshop_2025
33+
34+
Now, create the virtual environment with the following command. If you are using ``conda`` instead of ``micromamba``, you can just replace ``micromamba`` with ``conda`` in the commands, or run first run ``conda install -c conda-forge micromamba``.
35+
36+
.. code-block:: bash
37+
38+
micromamba env create -f environment-tutorial.yml
39+
micromamba activate pySDC_tutorial
40+
41+
42+
This may take a while...
43+
Note that this folder and all changes in it will remain even if you leave the virtual environment.
44+
Only installations made with ``micromamba`` or ``pip`` are affected by changing the environment.
45+
Use `branches <https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-branches>`_ to isolate development work.
46+
**Please make sure to perform all the following steps inside the virtual environment!**
47+
48+
Finally, you can install `pySDC` via ``pip`` in editable mode using:
49+
50+
.. code-block:: bash
51+
52+
pip install -e <pySDC-root-dir>
53+
54+
You don't need to do this, but it can make life easier when it comes to setting path variables etc.
55+
56+
Testing
57+
-------
58+
59+
Change to `pySDC`'s root directory and run
60+
61+
.. code-block:: bash
62+
63+
pytest pySDC/tests -m "base and not slow"
64+
65+
This will check if "all" went well with the installation you just created.
66+
Note that at the time of creating this tutorial we had to remove `mpi4py_fft` from the dependencies.
67+
Therefore, 7 out of the 39 selected test cases may fail!
68+
Anyway, you are now ready to play with `pySDC`.
69+
70+
Jupyter
71+
-------
72+
In order to use our virtual environment within Jupyter, we make a kernel for it with all our nice packages.
73+
We do that with
74+
75+
.. code-block:: bash
76+
77+
python -m ipykernel install --user --name=pySDC_tutorial
78+
79+
Now, start jupyter and have a look at the notebooks!
80+
81+
.. code-block:: bash
82+
83+
jupyter notebook
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
3+
name: pySDC_tutorial
4+
channels:
5+
- conda-forge
6+
dependencies:
7+
- numpy>=1.15.4
8+
- scipy>=0.17.1
9+
- matplotlib>=3.0
10+
- dill>=0.2.6
11+
- vtk
12+
- mpich
13+
- mpi4py-fft
14+
- mpi4py>=3.0.0
15+
- pytest
16+
- pytest-cov
17+
- jupyter
18+
- ipyparallel
19+
- pip
20+
- ipython
21+
- pip:
22+
- jdc
23+
- qmat
586 KB
Loading
8.42 KB
Loading
606 KB
Loading
44.5 KB
Loading
34.2 KB
Loading

0 commit comments

Comments
 (0)