Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

pysdm logo

Python 3 LLVM CUDA JAX Linux OK macOS OK Windows OK Jupyter Maintenance OpenHub status DOI Ask DeepWiki
EU Funding PL Funding US Funding

License: GPL v3

Github Actions Build Status Coverage Status
PyPI version API docs

PySDM is a package for simulating the dynamics of population of particles. It is intended to serve as a building block for simulation systems modelling fluid flows involving a dispersed phase, with PySDM being responsible for representation of the dispersed phase. Currently, the development is focused on atmospheric cloud physics applications, in particular on modelling the dynamics of particles immersed in moist air using the particle-based (a.k.a. super-droplet) approach to represent aerosol/cloud/rain microphysics. The package features a Pythonic high-performance implementation of the Super-Droplet Method (SDM) Monte-Carlo algorithm for representing collisional growth (Shima et al. 2009), hence the name.

PySDM documentation is maintained at: https://open-atmos.github.io/PySDM

There is a growing set of example Jupyter notebooks exemplifying how to perform various types of calculations and simulations using PySDM. Most of the example notebooks reproduce results and plot from literature, see below for a list of examples and links to the notebooks (which can be either executed or viewed "in the cloud").

There are also a growing set of tutorials, also in the form of Jupyter notebooks. These tutorials are intended for teaching purposes and include short explanations of cloud microphysical concepts paired with widgets for running interactive simulations using PySDM. Each tutorial also comes with a set of questions at the end that can be used as homework problems. Like the examples, these tutorials can be executed or viewed "in the cloud" making it an especially easy way for students to get started.

PySDM has three alternative parallel number-crunching backends available: multi-threaded CPU backend based on Numba and GPU-resident backend built on top of ThrustRTC. Additionally, a new hybrid backend built with Jax is being developed. The Numba backend (aliased CPU) features multi-threaded parallelism for multi-core CPUs, it uses the just-in-time compilation technique based on the LLVM infrastructure. The ThrustRTC backend (aliased GPU) offers GPU-resident operation of PySDM leveraging the SIMT parallelisation model. Using the GPU backend requires nVidia hardware and CUDA driver. The Jax backend (aliased JAX) is flexible and works with any device configurations (CPU/GPU/TPU), utilising the same backend API. As It is in early development, only simple coagulation cases in single-cell simulations are supported.

For an overview of PySDM features (and the preferred way to cite PySDM in papers), please refer to our JOSS papers:

PySDM includes an extension of the SDM scheme to represent collisional breakup described in de Jong, Mackay et al. 2023.
For a list of talks and other materials on PySDM as well as a list of published papers featuring PySDM simulations, see the project wiki.

Dependencies and Installation

PySDM dependencies are: Numpy, Numba, Jax, SciPy, Pint, chempy, pyevtk, ThrustRTC and CURandRTC.

To install PySDM using pip, use: pip install PySDM (or pip install git+https://github.com/open-atmos/PySDM.git to get updates beyond the latest release).

Conda users may use pip as well, see the Installing non-conda packages section in the conda docs.

For development purposes, we suggest cloning the repository and installing it using pip -e. Test-time dependencies can be installed with pip -e .[tests].

PySDM examples constitute the PySDM-examples package. The examples have additional dependencies listed in PySDM_examples package pyproject.toml file. Running the example Jupyter notebooks requires the PySDM_examples package to be installed. The suggested install and launch steps are:

git clone https://github.com/open-atmos/PySDM.git
pip install -e PySDM
pip install -e PySDM/examples
jupyter-notebook PySDM/examples/PySDM_examples

Alternatively, one can also install the examples package from pypi.org by using pip install PySDM-examples (note that this does not apply to notebooks itself, only the supporting .py files).

Contributing, reporting issues, seeking support

Our technologicial stack:

Python 3 Numba LLVM CUDA JAX NumPy pytest
Colab Codecov PyPI GithubActions Jupyter PyCharm

Submitting new code to the project, please preferably use GitHub pull requests - it helps to keep record of code authorship, track and archive the code review workflow and allows to benefit from the continuous integration setup which automates execution of tests with the newly added code.

Code contributions are assumed to imply transfer of copyright. Should there be a need to make an exception, please indicate it when creating a pull request or contributing code in any other way. In any case, the license of the contributed code must be compatible with GPL v3.

Developing the code, we follow The Way of Python and the KISS principle. The codebase has greatly benefited from PyCharm code inspections and Pylint, Black and isort code analysis (which are all part of the CI workflows).

We also use pre-commit hooks. In our case, the hooks modify files and re-format them. The pre-commit hooks can be run locally, and then the resultant changes need to be staged before committing. To set up the hooks locally, install pre-commit via pip install pre-commit and set up the git hooks via pre-commit install (this needs to be done every time you clone the project). To run all pre-commit hooks, run pre-commit run --all-files. The .pre-commit-config.yaml file can be modified in case new hooks are to be added or existing ones need to be altered.

Further hints addressed at PySDM developers are maintained in the open-atmos/python-dev-hints Wiki and in PySDM HOWTOs.

Issues regarding any incorrect, unintuitive or undocumented bahaviour of PySDM are best to be reported on the GitHub issue tracker. Feature requests are recorded in the "Ideas..." PySDM wiki page.

We encourage to use the GitHub Discussions feature (rather than the issue tracker) for seeking support in understanding, using and extending PySDM code.

We look forward to your contributions and feedback.

Licensing:

copyright: Jagiellonian University (2019-2023) & AGH University of Krakow (2023-...)
licence: GPL v3

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pysdm-3.0.0rc40.tar.gz (9.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pysdm-3.0.0rc40-py3-none-any.whl (368.6 kB view details)

Uploaded Python 3

File details

Details for the file pysdm-3.0.0rc40.tar.gz.

File metadata

  • Download URL: pysdm-3.0.0rc40.tar.gz
  • Upload date:
  • Size: 9.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pysdm-3.0.0rc40.tar.gz
Algorithm Hash digest
SHA256 52acd5aa61e86d7ce63df43b0b74b2dba7dfeb423c69c43d501e873563dea277
MD5 59cb058c08877343c087b1d3c8f95d0a
BLAKE2b-256 dc36dedf00ea83d3601430065aa2990970fddffc1a6f09d7d6b46ee510b6f05d

See more details on using hashes here.

File details

Details for the file pysdm-3.0.0rc40-py3-none-any.whl.

File metadata

  • Download URL: pysdm-3.0.0rc40-py3-none-any.whl
  • Upload date:
  • Size: 368.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pysdm-3.0.0rc40-py3-none-any.whl
Algorithm Hash digest
SHA256 bd2e1641516a04f6c2761885899c70072e03a8e819ba636b2e519267f4e6d18a
MD5 201135b40745f570b2b1c2110c0d5b7d
BLAKE2b-256 465cc09af5aa5ffc6d0f4fd8eead66ce915bfa07c1c615ae61aeec4f9a50c4a5

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

3.0.0rc40 This release

2 files

2.131

2 files

2.130

2 files

2.129

2 files

2.128

2 files

2.127

2 files

2.126

2 files

2.125

2 files

2.124

2 files

2.123

2 files

2.122

2 files

2.121

2 files

2.120

2 files

2.119

2 files

2.118

2 files

2.117

2 files

2.116

2 files

2.115

2 files

2.114

2 files

2.113

2 files

2.112

2 files

2.111

2 files

2.110

2 files

2.109

2 files

2.108

2 files

2.107

2 files

2.106

2 files

2.105

2 files

2.104

2 files

2.103

2 files

2.102

2 files

2.101

2 files

2.100

2 files

2.99

2 files

2.98

2 files

2.97

2 files

2.96

2 files

2.95

2 files

2.94

2 files

2.93

2 files

2.92

2 files

2.91

2 files

2.90

2 files

2.89

2 files

2.88

2 files

2.87

2 files

2.86

2 files

2.85

2 files

2.84

2 files

2.83

2 files

2.82

2 files

2.81

2 files

2.80

2 files

2.79

2 files

2.78

2 files

2.77

2 files

2.76

2 files

2.74

2 files

2.73

2 files

2.72

2 files

2.71

2 files

2.70

2 files

2.69

2 files

2.68

2 files

2.67

2 files

2.66

2 files

2.65

2 files

2.64

2 files

2.63

2 files

2.62

2 files

2.61

2 files

2.60

2 files

2.59

2 files

2.58

2 files

2.54

2 files

2.53

2 files

2.52

2 files

2.50

2 files

2.49

2 files

2.48

2 files

2.47

2 files

2.46

2 files

2.45

2 files

2.44

2 files

2.43

2 files

2.42

2 files

2.41

2 files

2.40

2 files

2.39

2 files

2.35

2 files

2.34

2 files

2.33

2 files

2.32

2 files

2.31

2 files

2.30

2 files

2.29

2 files

2.28

2 files

2.27

2 files

2.26

2 files

2.25

2 files

2.24

2 files

2.23

2 files

2.22

2 files

2.21

2 files

2.20

2 files

2.19

2 files

2.18

2 files

2.17

2 files

2.15

2 files

2.14

2 files

2.13

2 files

2.12

2 files

2.11

2 files

2.10

2 files

2.9

2 files

2.8

2 files

2.7

2 files

2.6

2 files

2.5

2 files

2.4

2 files

2.3

2 files

2.2

2 files

2.1

2 files

2.0

2 files

1.27

2 files

1.26

2 files

1.25

2 files

1.24

2 files

1.23

2 files

1.22

2 files

1.21

2 files

1.20

2 files

1.19

2 files

1.18

2 files

1.17

2 files

1.16

2 files

1.15

2 files

1.14

2 files

1.13

2 files

1.12

2 files

1.11

2 files

1.10

2 files

1.9

2 files

1.8

2 files

1.7

2 files

1.6

2 files

1.5

2 files

1.4

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page