Offline

PyPartMC: A Pythonic interface enhancing Fortran-based simulation package

Track:
Jupyter and Scientific Python
Type:
Poster
Level:
beginner
Duration:
60 minutes
View in the schedule

Abstract

PyPartMC is a Pythonic interface to PartMC. PartMC (Particle Monte Carlo) is a stochastic, particle-resolved atmospheric aerosol dynamics model, used for solving aerosol processes such as coagulation, nucleation, emission, and deposition. Both projects are free and open-source.

One of the main aims of the PyPartMC project is streamlining user experience. To use PartMC, you have to: work with UNIX shell, provide Fortran and C libraries, and perform standard Fortran and C source code configuration, compilation and linking. All of that boils down to a single pip package manager call with PyPartMC. Depending on the OS, PyPartMC will install from a binary wheel or compile from a source wheel containing all the dependencies.

PyPartMC can operate on Linux, Windows and MacOS, and has been tested to install correctly on Google Colab Jupyter notebook cloud platform. The API is also callable from C++, Julia, and MATLAB. PyPartMC ships with a collection of introductory notebook examples, that can help with learning the library's API.

From the developers point of view, PyPartMC is an interesting challenge, due to its multi-language environment. A C++ API is built on top of the Fortran one, leveraging the C-Fortran API. The Python interface is then constructed with the help of nanobind library.

PyPartMC is part of open-atmos, which is a multi-institutional community hub for projects in atmospheric sciences (https://github.com/open-atmos). The development of this package is a collaboration between AGH University of Krakow and University of Illinois Urbana-Champaign.

In the poster, I will outline the package features and architecture, and also highlight the newly engineered components and CI workflows engineered in our team at AGH.


Resources