SkillAgentSearch skills...

PyPartMC

Python (and C++) interface to PartMC with Jupyter/Python, Julia and Matlab examples

Install / Use

/learn @open-atmos/PyPartMC

README

logo

PyPartMC

PyPartMC is a Python interface to PartMC, a particle-resolved Monte-Carlo code for atmospheric aerosol simulation. Development of PyPartMC has been intended to remove limitations to the use of Fortran-implemented PartMC. PyPartMC facilitates the dissemination of computational research results by streamlining independent execution of PartMC simulations (also during peer-review processes). Additionally, the ability to easily package examples, simple simulations, and results in a web-based notebook allows PyPartMC to support the efforts of many members of the scientific community, including researchers, instructors, and students, with nominal software and hardware requirements.

Documentation of PyPartMC is hosted at https://open-atmos.github.io/PyPartMC. PyPartMC is implemented in C++ and it also constitutes a C++ API to the PartMC Fortran internals. The Python API can facilitate using PartMC from other environments - see, e.g., Julia and Matlab examples below.

For an outline of the project, rationale, architecture, and features, refer to: D'Aquino et al., 2024 (SoftwareX) (please cite if PyPartMC is used in your research). For a list of talks and other relevant resources, please see project Wiki. If interested in contributing to PyPartMC, please have a look a the notes for developers.

US Funding PL Funding

License: GPL v3 Copyright tests+pypi API docs codecov DOI PyPI version Project Status: Active – The project has reached a stable, usable state and is being actively developed. pyOpenSci Peer-Reviewed

Python 3 Linux OK macOS OK Windows OK Jupyter

Installation

Using the command-line pip tool (also applies to conda environments)

pip install PyPartMC

Note that, depending on the environment (OS, hardware, Python version), the pip-install invocation may either trigger a download of a pre-compiled binary, or trigger compilation of PyPartMC. In the latter case, a Fortran compiler and some development tools includiong CMake, m4 and perl are required (while all non-Python dependencies are included in the PyPartMC source archive). In both cases, all Python dependencies will be resolved by pip.

In a Jupyter notebook cell (also on Colab or jupyter-hub instances)

! pip install PyPartMC
import PyPartMC

Jupyter notebooks with examples

Note: clicking the badges below redirects to cloud-computing platforms. The mybinder.org links allow anonymous execution, Google Colab requires logging in with a Google account, ARM JupyerHub requires logging in with an ARM account (and directing Jupyter to a particular notebook within the examples folder).

The example notebooks feature additional dependencies that can be installed with:

pip install PyPartMC[examples]
  • Urban plume scenario demo (as in PartMC):
    View notebook Open In Colab Binder ARM JupyterHub
  • Chamber simulation example from Barrel Study (Tian el al., 2017):
    View notebook Open In Colab Binder ARM JupyterHub
  • Dry-Wet Particle Size Equilibration with PartMC and PySDM:
    View notebook Open In Colab Binder ARM JupyterHub Voila
  • Simulation output processing example (loading from netCDF files using PyPartMC):
    View notebook Open In Colab Binder ARM JupyterHub
  • Optical properties calculation using external Python package (PyMieScatt):
    View notebook Open In Colab [Binder](https://myb

Related Skills

View on GitHub
GitHub Stars31
CategoryEducation
Updated18d ago
Forks14

Languages

C++

Security Score

95/100

Audited on Mar 8, 2026

No findings