Skip to content
Smoothed particle hydrodynamics analysis and visualization with Python
Python Other
  1. Python 99.0%
  2. Other 1.0%
Branch: master
Clone or download
dmentipl Add pull request template
This template is a modified version of the one at

Also specify Python version in bug report.
Latest commit 03628d6 Aug 17, 2019


Smoothed particle hydrodynamics analysis and visualization with Python.

Build Status Documentation Status Anaconda Version Anaconda Platform License


Plonk supports the following SPH file formats:

  • Phantom output in HDF format.

Note: you can convert Phantom standard dumps to HDF. See the Phantom wiki.

Basic usage

To read in a simulation with dump files like disc_00000.h5, ..., and evolution files like disc01.ev, ..., in the current directory, and see what dumps there are:

>>> import plonk

>>> simulation = plonk.Simulation(prefix='disc')
>>> simulation.dumps
[<plonk.Dump: "disc_00000.h5">,
 <plonk.Dump: "disc_01000.h5">]

The Dump objects contain the particle and sinks arrays, lazily loaded from the HDF5 file, as well as the dump header stored as a dictionary.

To visualize a single dump file:

>>> dump = plonk.Dump('disc_00000.h5')

>>> plonk.Visualization(
...     dump=dump,
...     render='density',
...     extent=[-200, 200, -200, 200]
...     )

For further usage, see examples folder and documentation. The code is internally documented with docstrings. Try, for example, help(plonk.Dump) or help(plonk.Visualization).


Plonk is a Python 3 only package.


The easiest and recommended way to install Plonk is via the package manager Conda

conda install plonk --channel dmentipl


conda config --add channels dmentipl
conda install plonk

Note: Using this method you don't need to have this repository on your machine.

This will install the required dependencies. For details on Conda, see

Getting help

If you need help, try the following, in order:

  1. Check the documentation.
  2. Ask questions on Stack Overflow using the plonk tag.
  3. File an issue, as a bug report or feature request, using the issue tracker.

If you don't get an immediate response, please be patient. Plonk is run by one person, @dmentipl.


Thank you for considering contributing to Plonk. Contributions are welcome.

See for guidelines on how to contribute.


If you use Plonk in a scientific publication, please cite

Plonk: Smoothed particle hydrodynamics data analysis and visualization

You should also consider citing any other scientific software packages that you use.

You can’t perform that action at this time.