PyPartMC: Removing barriers in aerosol modeling

 

Submitter

Riemer, Nicole — University of Illinois Urbana-Champaign
West, Matthew — University of Illinois at Urbana-Champaign

Area of research

Aerosol Processes

Journal Reference

D’Aquino Z, S Arabas, J Curtis, A Vaishnav, N Riemer, and M West. 2024. "PyPartMC: A Pythonic interface to a particle-resolved, Monte Carlo aerosol simulation framework." SoftwareX, 25, 101613, 10.1016/j.softx.2023.101613.

Science

PartMC is a powerful open-source tool for aerosol simulations. However, it requires knowledge of shell and CMake, C and Fortran compilers, and installation and configuration of several C and Fortran dependencies. This is a significant hurdle for those with little experience in computation. PyPartMC offers a single-step installation process of PartMC and all dependencies through the pip Python package manager on Linux, macOS, and Windows. It provides streamlined access to the unmodified and versioned Fortran internals of the PartMC codebase from both Python and other interoperable environments (e.g., Julia through PyCall).

Impact

  • Ability to run PartMC simulations in the cloud, including using the ARM Jupyter Hub.
  • Increasing accessibility of scientific software introduces more diversity to the community as researchers and students from various backgrounds and institutions can implement and advance the same research area.

Summary

PyPartMC is a Pythonic interface to PartMC, a stochastic, particle-resolved aerosol model implemented in Fortran. Both PyPartMC and PartMC are free, libre, and open-source. PyPartMC reduces the number of steps and mitigates the effort necessary to install and use the resources of PartMC. Without PyPartMC, setting up PartMC requires: working with UNIX shell, providing Fortran and C libraries, and performing standard Fortran and C source code configuration, compilation, and linking. This can be challenging for those less experienced with computational research or those intending to use PartMC in environments where provision of UNIX tools is less straightforward (e.g., on Windows). PyPartMC offers a single-step installation/upgrade process of PartMC and all dependencies through the pip Python package manager on Linux, macOS, and Windows. This allows streamlined access to the unmodified and versioned Fortran internals of the PartMC codebase from both Python and other interoperable environments (e.g., Julia through PyCall). In particular, PyPartMC can be set up to handle the time-stepping loop for PartMC simulations, making it possible to couple PartMC with other Python-interoperable packages for either online diagnostics or additional simulation logic. Altogether, users of PyPartMC can set up, run, process, and visualize output of PartMC simulations using a single general-purpose programming language.