Installation
plasmacoll needs Python 3.10 or newer. It depends on NumPy and cunumpy, which selects NumPy or CuPy as the array backend.
pip install plasmacollFor development, clone the repository and install it in editable mode:
git clone https://github.com/max-models/plasmacollcd plasmacollpip install -e ".[dev]"or with uv:
make install # uv sync --extra dev, plus the pre-commit hooksOn a machine with CuPy installed, select the CuPy backend before the first array is created:
CUNUMPY_BACKEND=cupy python my_simulation.pyor cunumpy.set_backend("cupy") at the start of the program. plasmacoll then creates its arrays and
random numbers on the GPU. The test suite also runs on cunumpy’s host-memory stand-in for CuPy,
so the CuPy code paths are checked without a GPU:
make test-cupy # CUNUMPY_FAKE_CUPY=1 CUNUMPY_BACKEND=cupy pytestOptional extras
Section titled “Optional extras”| Extra | Installs |
|---|---|
units | astropy, for settings given as quantities (300 * u.K, "1 ns") |
test | pytest, pytest-cov and astropy |
docs | the notebook runner, plasma-plots and griffe for the API reference |
dev | ruff, pyright, ty and pre-commit, plus the test and docs extras |
The physical settings (densities, temperatures, masses, energies, cross sections, time steps)
take astropy Quantities or strings such as "300 K" as well as plain numbers in their documented
units; astropy is imported only when one is given:
pip install "plasmacoll[units]"