PyPartMC 1.3.13__cp38-cp38-macosx_13_0_x86_64.whl → 2.0.0rc3__cp38-cp38-macosx_13_0_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of PyPartMC might be problematic. Click here for more details.

Binary file
Binary file
Binary file
PyPartMC/__init__.py CHANGED
@@ -1,13 +1,18 @@
1
1
  """
2
- .. include::../README.md
2
+ .. include::../../README.md
3
3
  """
4
4
 
5
+ # pylint: disable=invalid-name
6
+ import importlib.metadata
7
+
5
8
  # pylint: disable=invalid-name,wrong-import-position
6
9
  import os
7
10
  from collections import namedtuple
8
11
  from contextlib import contextmanager
9
12
  from pathlib import Path
10
13
 
14
+ import nanobind
15
+
11
16
 
12
17
  # https://github.com/diegoferigo/cmake-build-extension/blob/master/src/cmake_build_extension/__init__.py
13
18
  @contextmanager
@@ -69,10 +74,13 @@ si = __generate_si()
69
74
  SI-prefix-aware unit multipliers, resulting in e.g.: `p = 1000 * si.hPa`
70
75
  notation. Note: no dimensional analysis is done! """
71
76
 
72
- with __build_extension_env():
73
- import _PyPartMC
74
- from _PyPartMC import *
75
- from _PyPartMC import __all__ as _PyPartMC_all # pylint: disable=no-name-in-module
76
- from _PyPartMC import __version__, __versions_of_build_time_dependencies__
77
+ from ._PyPartMC import * # pylint: disable=import-error
78
+ from ._PyPartMC import ( # pylint: disable=import-error
79
+ __versions_of_build_time_dependencies__,
80
+ )
81
+
82
+ __version__ = importlib.metadata.version(__package__)
77
83
 
78
- __all__ = tuple([*_PyPartMC_all, "si"])
84
+ # walkaround for MATLAB bindings
85
+ # pylint: disable=undefined-variable
86
+ setattr(nanobind, "nb_type_0", type(_PyPartMC.AeroData))
@@ -1,23 +1,28 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: PyPartMC
3
- Version: 1.3.13
3
+ Version: 2.0.0rc3
4
4
  Summary: Python interface to PartMC
5
- Author: PyPartMC team (see https://github.com/open-atmos/PyPartMC/graphs/contributors)
6
- Author-email: nriemer@illinois.edu
7
- License: GPL-3.0
8
- Project-URL: Tracker, https://github.com/open-atmos/PyPartMC/issues
5
+ Author-Email: "https://github.com/open-atmos/PyPartMC/graphs/contributors" <nriemer@illinois.edu>
6
+ License-Expression: GPL-3.0
9
7
  Project-URL: Documentation, https://open-atmos.github.io/PyPartMC
10
8
  Project-URL: Source, https://github.com/open-atmos/PyPartMC/
11
- Requires-Python: >=3.7
12
- Description-Content-Type: text/markdown
13
- License-File: LICENSE
9
+ Project-URL: Tracker, https://github.com/open-atmos/PyPartMC/issues
10
+ Requires-Python: >=3.8
14
11
  Requires-Dist: numpy
12
+ Requires-Dist: nanobind
15
13
  Provides-Extra: tests
16
14
  Requires-Dist: pytest; extra == "tests"
17
15
  Requires-Dist: pytest-order; extra == "tests"
18
- Requires-Dist: fastcore!=1.5.8; extra == "tests"
19
- Requires-Dist: ghapi; extra == "tests"
20
- Requires-Dist: scipy; extra == "tests"
16
+ Provides-Extra: examples
17
+ Requires-Dist: matplotlib!=3.10.0; extra == "examples"
18
+ Requires-Dist: ipywidgets; extra == "examples"
19
+ Requires-Dist: voila; extra == "examples"
20
+ Requires-Dist: open-atmos-jupyter-utils; extra == "examples"
21
+ Requires-Dist: PySDM; extra == "examples"
22
+ Requires-Dist: PyMieScatt; extra == "examples"
23
+ Requires-Dist: SciPy; extra == "examples"
24
+ Requires-Dist: dustpy; platform_system != "Windows" and extra == "examples"
25
+ Description-Content-Type: text/markdown
21
26
 
22
27
  ![logo](https://raw.githubusercontent.com/wiki/open-atmos/PyPartMC/logo.svg)
23
28
 
@@ -32,6 +37,7 @@ Additionally, the ability to easily package examples, simple simulations, and re
32
37
  allows PyPartMC to support the efforts of many members of the scientific community, including researchers,
33
38
  instructors, and students, with nominal software and hardware requirements.
34
39
 
40
+ Documentation of PyPartMC is hosted at https://open-atmos.github.io/PyPartMC.
35
41
  PyPartMC is implemented in C++ and it also constitutes a C++ API to the PartMC Fortran internals.
36
42
  The Python API can facilitate using PartMC from other environments - see, e.g., Julia and Matlab examples below.
37
43
 
@@ -43,14 +49,13 @@ If interested in contributing to PyPartMC, please have a look a the [notes for d
43
49
 
44
50
  [![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.html)
45
51
  [![Copyright](https://img.shields.io/static/v1?label=Copyright&color=249fe2&message=UIUC&)](https://atmos.illinois.edu/)
46
- [![Github Actions Build Status](https://github.com/open-atmos/PyPartMC/workflows/tests+pypi/badge.svg?branch=main)](https://github.com/open-atmos/PyPartMC/actions)
52
+ [![tests+pypi](https://github.com/open-atmos/PyPartMC/actions/workflows/buildwheels.yml/badge.svg)](https://github.com/open-atmos/PyPartMC/actions/workflows/buildwheels.yml)
47
53
  [![API docs](https://shields.mitmproxy.org/badge/docs-pdoc.dev-brightgreen.svg)](https://open-atmos.github.io/PyPartMC/)
48
54
  [![codecov](https://codecov.io/gh/open-atmos/PyPartMC/graph/badge.svg?token=27IK9ZIQXE)](https://codecov.io/gh/open-atmos/PyPartMC)
49
55
  [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7662635.svg)](https://doi.org/10.5281/zenodo.7662635)
50
56
  [![PyPI version](https://badge.fury.io/py/PyPartMC.svg)](https://pypi.org/p/PyPartMC)
51
57
  [![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
52
-
53
- ## TL;DR (try in a Jupyter notebook)
58
+ [![pyOpenSci Peer-Reviewed](https://pyopensci.org/badges/peer-reviewed.svg)](https://github.com/pyOpenSci/software-review/issues/179)
54
59
 
55
60
  [![Python 3](https://img.shields.io/static/v1?label=Python&logo=Python&color=3776AB&message=3)](https://www.python.org/)
56
61
  [![Linux OK](https://img.shields.io/static/v1?label=Linux&logo=Linux&color=yellow&message=%E2%9C%93)](https://en.wikipedia.org/wiki/Linux)
@@ -58,9 +63,11 @@ If interested in contributing to PyPartMC, please have a look a the [notes for d
58
63
  [![Windows OK](https://img.shields.io/static/v1?label=Windows&logo=Windows&color=white&message=%E2%9C%93)](https://en.wikipedia.org/wiki/Windows)
59
64
  [![Jupyter](https://img.shields.io/static/v1?label=Jupyter&logo=Jupyter&color=f37626&message=%E2%9C%93)](https://jupyter.org/)
60
65
 
61
- ```python
62
- ! pip install PyPartMC
63
- import PyPartMC
66
+ ## Installation
67
+
68
+ ### Using the command-line `pip` tool (also applies to conda environments)
69
+ ```bash
70
+ pip install PyPartMC
64
71
  ```
65
72
 
66
73
  Note that, depending on the environment (OS, hardware, Python version), the pip-install invocation
@@ -69,9 +76,21 @@ In the latter case, a Fortran compiler and some development tools includiong CMa
69
76
  are required (while all non-Python dependencies are included in the PyPartMC source archive).
70
77
  In both cases, all Python dependencies will be resolved by pip.
71
78
 
79
+ ### In a Jupyter notebook cell (also on Colab or jupyter-hub instances)
80
+
81
+ ```python
82
+ ! pip install PyPartMC
83
+ import PyPartMC
84
+ ```
85
+
72
86
  #### Jupyter notebooks with examples
73
87
  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).
74
88
 
89
+ The example notebooks feature additional dependencies that can be installed with:
90
+ ```bash
91
+ pip install PyPartMC[examples]
92
+ ```
93
+
75
94
  - Urban plume scenario demo (as in [PartMC](https://github.com/compdyn/partmc/tree/master/scenarios/1_urban_plume)):
76
95
  [![View notebook](https://img.shields.io/static/v1?label=render%20on&logo=github&color=87ce3e&message=GitHub)](https://github.com/open-atmos/PyPartMC/blob/main/examples/particle_simulation.ipynb)
77
96
  [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/open-atmos/PyPartMC/blob/main/examples/particle_simulation.ipynb)
@@ -98,6 +117,11 @@ Note: clicking the badges below redirects to cloud-computing platforms. The mybi
98
117
  [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/open-atmos/PyPartMC/blob/main/examples/cloud_parcel.ipynb)
99
118
  [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/open-atmos/PyPartMC.git/main?urlpath=lab/tree/examples/cloud_parcel.ipynb)
100
119
  [![ARM JupyterHub](https://img.shields.io/static/v1?label=launch%20in&logo=jupyter&color=lightblue&message=ARM+JupyterHub)](https://jupyterhub.arm.gov/hub/user-redirect/git-pull?repo=https%3A//github.com/open-atmos/PyPartMC&branch=main&urlPath=)
120
+ - Coagulation model intercomparison for additive (Golovin) kernel with: PyPartMC, [PySDM](https://open-atmos.github.io/PySDM), [Droplets.jl](https://github.com/emmacware/droplets.jl) and [dustpy](https://stammler.github.io/dustpy/):
121
+ [![View notebook](https://img.shields.io/static/v1?label=render%20on&logo=github&color=87ce3e&message=GitHub)](https://github.com/open-atmos//PyPartMC/blob/main/examples/additive_coag_comparison.ipynb)
122
+ [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/open-atmos/PyPartMC/blob/main/examples/additive_coag_comparison.ipynb)
123
+ [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/open-atmos/PyPartMC.git/main?urlpath=lab/tree/examples/additive_coag_comparison.ipynb)
124
+ [![ARM JupyterHub](https://img.shields.io/static/v1?label=launch%20in&logo=jupyter&color=lightblue&message=ARM+JupyterHub)](https://jupyterhub.arm.gov/hub/user-redirect/git-pull?repo=https%3A//github.com/open-atmos/PyPartMC&branch=main&urlPath=)
101
125
 
102
126
  ## Features
103
127
 
@@ -145,9 +169,7 @@ aero_dist = ppmc.AeroDist(
145
169
  "num_conc": 3200 / si.cm**3,
146
170
  "geom_mean_diam": 8.64 * si.nm,
147
171
  "log10_geom_std_dev": 0.28,
148
- }
149
- },
150
- {
172
+ },
151
173
  "diesel": {
152
174
  "mass_frac": [{"OC": [0.3]}, {"BC": [0.7]}],
153
175
  "diam_type": "geometric",
@@ -189,9 +211,7 @@ aero_dist = ppmc.AeroDist(aero_data, (
189
211
  "num_conc" => 3200 / si.cm^3,
190
212
  "geom_mean_diam" => 8.64 * si.nm,
191
213
  "log10_geom_std_dev" => .28,
192
- )
193
- ),
194
- Dict(
214
+ ),
195
215
  "diesel" => Dict(
196
216
  "mass_frac" => (Dict("OC" => (.3,)), Dict("BC" => (.7,))),
197
217
  "diam_type" => "geometric",
@@ -200,7 +220,7 @@ aero_dist = ppmc.AeroDist(aero_data, (
200
220
  "geom_mean_diam" => 50 * si.nm,
201
221
  "log10_geom_std_dev" => .24,
202
222
  )
203
- )
223
+ ),
204
224
  ))
205
225
 
206
226
  n_part = 100
@@ -214,7 +234,6 @@ print(aero_state.masses()'aero_state.num_concs, "# kg/m3")
214
234
  notes (see the [PyPartMC Matlab CI workflow](https://github.com/open-atmos/PyPartMC/blob/main/.github/workflows/readme_listings.yml) for an example on how to achieve it on Ubuntu 20):
215
235
  - Matlab ships with convenience copies of C, C++ and Fortran runtime libraries which are `dlopened()` by default; one way to make PyPartMC OK with it is to [pip-]install by compiling from source using the very same version of GCC that Matlab borrowed these libraries from (e.g., [GCC 9 for Matlab R2022a, etc](https://www.mathworks.com/support/requirements/supported-compilers-linux.html));
216
236
  - Matlab needs to [use the same Python interpretter/venv](https://www.mathworks.com/support/requirements/python-compatibility.html) as the pip invocation used to install PyPartMC;
217
- - a single-line `pybind11_builtins.py` file with just `pybind11_type=type` inside needs to be placed within Matlab's `PYTHONPATH` to sort out a [Matlab-pybind11 incompatibility](https://github.com/pybind/pybind11/issues/3945).
218
237
 
219
238
  ````Matlab
220
239
  ppmc = py.importlib.import_module('PyPartMC');
@@ -234,9 +253,7 @@ aero_dist = ppmc.AeroDist(aero_data, py.tuple({ ...
234
253
  "num_conc", 3200 / si.cm^3, ...
235
254
  "geom_mean_diam", 8.64 * si.nm, ...
236
255
  "log10_geom_std_dev", .28 ...
237
- )) ...
238
- )), ...
239
- py.dict(pyargs( ...
256
+ )), ...
240
257
  "diesel", py.dict(pyargs( ...
241
258
  "mass_frac", py.tuple({ ...
242
259
  py.dict(pyargs("OC", py.tuple({.3}))), ...
@@ -263,6 +280,17 @@ fprintf('%g # kg/m3\n', dot([masses{:}], [num_concs{:}]))
263
280
 
264
281
  PyPartMC is used within the [test workflow of the PySDM project](https://github.com/atmos-cloud-sim-uj/PySDM/tree/main/tests/smoke_tests/box/partmc).
265
282
 
283
+ ## Other packages with relevant feature scope
284
+
285
+ - [aerosolGDEFoam](https://openaerosol.sourceforge.io/): OpenFOAM CFD-coupled aerosol dynamics including nucleation, coagulation, and surface growth
286
+ - [AIOMFAC and AIOMFAC-web](http://www.aiomfac.caltech.edu/): Fortran-implemented aerosol thermodynamic model for calculation of activity coefficients in organic-inorganic mixtures – from simple binary solutions to complex multicomponent systems
287
+ - [DustPy](https://stammler.github.io/dustpy/): Python package for modelling dust evolution in protoplanetary disks (differences: focus on astrophysical applications vs. atmospheric aerosol)
288
+ - [multilayerpy](https://github.com/tintin554/multilayerpy): kinetic multi-layer model for aerosol particles and films
289
+ - [PyBox](https://pybox.readthedocs.io): aerosol simulation model featuring gas and particle chamistry (differences: PyBox focuses on chemical mechanisms; PyPartMC is an interface to PartMC which focuses on physics - e.g., collisions of aerosol particles - while chemical processes are handled with external software, e.g., CAMP or MOSAIC)
290
+ - [PyCHAM](https://github.com/simonom/PyCHAM): CHemistry with Aerosol Microphysics in Python Box Model for modelling of indoor environments, including aerosol chambers
291
+ - [PySDM](https://open-atmos.github.io/PySDM): particle-based Monte-Carlo aerosol-cloud simulation package (differences: PySDM focuses on growth and breakup processes relevant to cloud droplets; PyPartMC focuses on processes relevant to air pollutants and their chemical and physical transformations)
292
+ - [SSH-aerosol](https://github.com/sshaerosol/ssh-aerosol): C++/Fortran package for simulating evolution of primary and secondary atmospheric aerosols
293
+
266
294
  ## FAQ
267
295
  - Q: How to install PyPartMC with MOSAIC enabled?
268
296
  A: Installation can be done using `pip`, however, `pip` needs to be instructed not to use binary packages available at pypi.org but rather to compile from source (pip will download the source from pip.org), and the path to compiled MOSAIC library needs to be provided at compile-time; the following command should convey it:
@@ -304,6 +332,47 @@ Could not find NC_M4 using the following names: m4, m4.exe
304
332
  ```
305
333
  Try installing `m4` (e.g., using [MSYS2](https://packages.msys2.org/package/m4?repo=msys&variant=x86_64) on Windows).
306
334
 
335
+ ## Acknowledgement and citations
336
+
337
+ We would greatly appreciate citation of the PartMC model description paper (Riemer et al., 2009)
338
+ and the PyPartMC description paper (D’Aquino et al., 2024) if PyPartMC was used in your study.
339
+ The citations are:
340
+ - Riemer, N., M. West, R. A. Zaveri, R. C. Easter: Simulating the evolution of soot
341
+ mixing-state with a particle-resolved aerosol model
342
+ J. Geophys. Res., 114, D09202, 2009, DOI: [10.1029/2008JD011073](https://doi.org/10.1029/2008JD011073)
343
+ - D’Aquino, Z., S. Arabas, J. H. Curtis, A. Vaishnav, N. Riemer, M. West: PyPartMC: A
344
+ pythonic interfact to a particle-resolved, Monte Carlo aerosol simulation framework
345
+ SoftwareX, 25, 101613, 2024, DOI: [10.1016/j.softx.2023.101613](https://doi.org/10.1016/j.softx.2023.101613)
346
+
347
+ The following paragraph provides a more substantial description of PartMC (text released into the public domain and can be freely copied by anyone for any purpose):
348
+
349
+ > PartMC is a stochastic, particle-resolved aerosol box model. It tracks the
350
+ composition of many computational particles (10<sup>4</sup> to 10<sup>6</sup>) within a well-mixed air
351
+ volume, each represented by a composition vector that evolves based on physical
352
+ and chemical processes. The physical processes—including Brownian coagulation,
353
+ new particle formation, emissions, dilution, and deposition—are simulated using a
354
+ stochastic Monte Carlo approach via a Poisson process while chemical processes are
355
+ simulated deterministically for each computational particle. The weighted flow
356
+ algorithm (DeVille, Riemer, and West, 2011, 2019) enhances efficiency and reduces
357
+ ensemble variance. Detailed numerical methods are described in Riemer et al.
358
+ (2009), DeVille et al. (2011, 2019), and Curtis et al. (2016). PartMC is open-source
359
+ under the GNU GPL v2 and available at
360
+ [github.com/compdyn/partmc](https://github.com/compdyn/partmc).
361
+ >
362
+ > References:
363
+ > - Curtis, J. H., M. D. Michelotti, N. Riemer, M. T. Heath, M. West: Accelerated
364
+ simulation of stochastic particle removal processes in particle-resolved aerosol
365
+ models, J. Computational Phys., 322, 21-32, 2016, DOI: [10.1016/j.jcp.2016.06.029](https://doi.org/10.1016/j.jcp.2016.06.029)
366
+ > - DeVille, L., N. Riemer, M. West, Convergence of a generalized weighted flow
367
+ algorithm for stochastic particle coagulation, J. Computational Dynamics, 6, 69-94,
368
+ 2019, DOI: [10.3934/jcd.2019003](https://doi.org/10.3934/jcd.2019003)
369
+ > - DeVille, R. E. L., N. Riemer, M. West, The Weighted Flow Algorithm (WFA) for
370
+ stochastic particle coagulation, J. Computational Phys., 230, 8427-8451, 2011,
371
+ DOI: [10.1016/j.jcp.2011.07.027](https://doi.org/10.1016/j.jcp.2011.07.027)
372
+ > - Riemer, N., M. West, R. A. Zaveri, R. C. Easter, Simulating the evolution of soot
373
+ mixing-state with a particle-resolved aerosol model, J. Geophys. Res., 114, D09202,
374
+ 2009., DOI: [10.1029/2008JD011073](https://doi.org/10.1029/2008JD011073)
375
+
307
376
  ## Credits
308
377
 
309
378
  #### PyPartMC:
@@ -0,0 +1,9 @@
1
+ pypartmc-2.0.0rc3.dist-info/RECORD,,
2
+ pypartmc-2.0.0rc3.dist-info/WHEEL,sha256=QYFdNGzXwuBjBNCy_HhT_OkFdKSB_RjbuJI9OL8ME3Q,113
3
+ pypartmc-2.0.0rc3.dist-info/METADATA,sha256=4aUTawjPsb6pM4Ri_j8vmVSsCzx-O8mdi8jichPcoSs,26630
4
+ pypartmc-2.0.0rc3.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
5
+ PyPartMC/__init__.py,sha256=e1ngb8Sodfqneb__Vmf_K5eIOoOY11gvrSHmlIZbruM,2349
6
+ PyPartMC/_PyPartMC.cpython-38-darwin.so,sha256=tM4uERBnCARVwKhlu01YrEU-7jsWYcesQv1FmEtFh9k,8484928
7
+ PyPartMC/.dylibs/libgfortran.5.dylib,sha256=uZj18mk7PGjzH0FQclHZLMRAcsG4TETIRZt_8CGlEpg,3988672
8
+ PyPartMC/.dylibs/libquadmath.0.dylib,sha256=19PcPx5n69p9h9xP2dOhLmhRI2hzljSQcJBXLyFC2go,379200
9
+ PyPartMC/.dylibs/libgcc_s.1.1.dylib,sha256=mW61tfzTB6d8xKZxf5SR2V03z7kbDW950dagh_mLK_U,266112
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.3.0)
2
+ Generator: scikit-build-core 0.11.5
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp38-cp38-macosx_13_0_x86_64
5
5
 
@@ -1,7 +0,0 @@
1
- _PyPartMC.cpython-38-darwin.so,sha256=3nyuUig-m2u4eb8sWRPdoE772t_8NKWUjfkofgr0jXg,8563080
2
- PyPartMC/__init__.py,sha256=VAqwePpJZEFJ7YieM1GbUvfluRhUyWXciP89pY9xIH4,2217
3
- PyPartMC-1.3.13.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
4
- PyPartMC-1.3.13.dist-info/METADATA,sha256=55XZpDN4ldmVIvGE412KtsGHu__WRuk3Yq8UDjfIj0g,20422
5
- PyPartMC-1.3.13.dist-info/WHEEL,sha256=OzbVqQDGgCN-oj-FNGUZi3Dga71LFiZj1IqKmk_Y6R4,108
6
- PyPartMC-1.3.13.dist-info/top_level.txt,sha256=PJxy22pTnxcBhqrb6r4AIL32rkxA61gzw7ohlzybgSM,19
7
- PyPartMC-1.3.13.dist-info/RECORD,,
@@ -1,2 +0,0 @@
1
- PyPartMC
2
- _PyPartMC