https://github.com/pnavaro/python-fortran
Python-Fortran bindings examples
https://github.com/pnavaro/python-fortran
f2py finite-differences jupyter-book python-fortran
Last synced: about 1 year ago
JSON representation
Python-Fortran bindings examples
- Host: GitHub
- URL: https://github.com/pnavaro/python-fortran
- Owner: pnavaro
- License: mit
- Created: 2019-10-23T12:00:10.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-12-02T08:48:57.000Z (over 1 year ago)
- Last Synced: 2025-01-17T10:06:20.131Z (over 1 year ago)
- Topics: f2py, finite-differences, jupyter-book, python-fortran
- Language: Jupyter Notebook
- Homepage: https://pnavaro.github.io/python-fortran/
- Size: 150 MB
- Stars: 53
- Watchers: 4
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Python-Fortran bindings examples
[](https://mybinder.org/v2/gh/pnavaro/python-fortran/master)
[](https://pnavaro.github.io/python-fortran)
```bash
git clone https://github.com/pnavaro/python-fortran.git
cd python-fortran
conda env create -f environment.yml
conda activate python-fortran
jupyter notebook
```
You can open py files or ipynb files in notebooks directory. They are synchronized with
jupytext.
- [Introduction to F2PY](https://pnavaro.github.io/python-fortran/01.f2py.html)
- [F2PY and Fortran 90 modules](https://pnavaro.github.io/python-fortran/02.f2py.html)
- [Comparison with Cython, Numba, Pythran and PyJulia : The Julia set example](https://pnavaro.github.io/python-fortran/03.julia-set.html)
- [The 1D1V Vlasov-Poisson solved with Semi-Lagrangian method](https://pnavaro.github.io/python-fortran/04.vlasov-poisson.html)
- [Co-rotating vortices solved with discrete vortex method](https://pnavaro.github.io/python-fortran/05.co-rotating-vortex.html)
- [Finite differences and the Gray-Scott model](https://pnavaro.github.io/python-fortran/06.gray-scott-model.html)
- [Finite differences on staggered grid to solve Maxwell equations in 2D](https://pnavaro.github.io/python-fortran/07.maxwell-fdtd-2d.html)
- [Short example with SWIG and CTYPES](https://pnavaro.github.io/python-fortran/08.swig.html)
Reminder: Build the Jupyter book
```bash
make
jupyter-book build notebooks
```
and eventually push the book to gh-pages
```bash
ghp-import -n -p -f notebooks/_build/html
```
Pierre Navaro IRMAR CNRS