Skip to content
Projects

Installation

freeofcharge needs Python 3.10 or newer. Install it from GitHub with pip:

Terminal window
pip install "freeofcharge @ git+https://github.com/max-models/freeofcharge"

or, for development, clone the repository and install it with uv (make install runs uv sync --extra dev and installs the pre-commit hooks) or pip:

Terminal window
git clone https://github.com/max-models/freeofcharge
cd freeofcharge
pip install -e ".[dev]"

Besides NumPy, SciPy and xarray, freeofcharge is built on the max-models building blocks, which pip installs with it:

PackageUsed forInstalled from
cunumpyarrays on NumPy or CuPyPyPI
maybempiMPI when launched with mpiexec, a serial stand-in otherwisePyPI
plasmacollthe markers (ParticleArrays), random streams and constantsGitHub, devel
simgeometrythe grid and the boundary and wall polygonsGitHub, devel

plasmacoll and simgeometry come from their devel branches on GitHub, so pip needs git.

The arrays live on the cunumpy backend. To run on a GPU, install CuPy and select its backend before importing freeofcharge:

Terminal window
export CUNUMPY_BACKEND=cupy

With MPI (install mpi4py), pass a communicator as comm= to NeutralBeam.gaussian, deposit and slow_down: each rank draws and traces its own markers, and the profiles are summed over the ranks once.

ExtraInstalls
testpytest and pytest-cov
docsthe notebook runner, griffe, matplotlib and plasma-plots
devruff, pyright, pre-commit and JupyterLab, plus test and docs
Terminal window
pip install -e ".[docs]" # to run the tutorials and examples