Skip to main content

PyECLOUD

PyPI version Python 3.11 or newer Platforms: Linux and macOS License: Apache-2.0 Documentation build status

PyECLOUD is a 2D macro-particle code for the simulation of electron cloud effects in particle accelerators.

Installation

Create a Conda environment with Python 3.13 and the compilers and numerical libraries, then install the released PyHEADTAIL and PyECLOUD packages:

conda create -n ecloud -c conda-forge python=3.13 pip
conda activate ecloud
conda install -c conda-forge c-compiler cxx-compiler fortran-compiler
conda install -c conda-forge numpy scipy matplotlib
pip install --upgrade pyheadtail
pip install --upgrade pyecloud

Keep the environment active when installing packages and running simulations.

PyECLOUD and its Poisson solver package, pypic-poisson, are published as source distributions only, so pip compiles their native extensions during installation; this is why the compilers are needed. Pip installs pypic-poisson and the other dependencies automatically. The packages are imported as PyECLOUD and PyPIC.

PyKLU is installed as the default sparse solver because it is faster than SciPy's SuperLU. To use SciPy instead, set sparse_solver = 'scipy_slu' in simulation_parameters.input.

PyHEADTAIL is only needed for beam-dynamics simulations. It can also be installed together with the optional frequency-analysis package nafflib through the tracking extra: pip install "pyecloud[tracking]".

Development installation

For development, install PyECLOUD in editable mode from a Git checkout. If you are also working on PyPIC, clone both repositories side by side and run from their parent directory:

python -m pip install -e ./PyPIC
python -m pip install -e ./PyECLOUD

Otherwise, run python -m pip install -e . inside the PyECLOUD checkout; pip then installs pypic-poisson from PyPI. See the installation guide for details.

Pip installs the build dependencies (Cython, Meson, and Ninja) and compiles seven Fortran extensions with F2PY and two Cython/C extensions. Changes to Python files take effect immediately. After changing Fortran, Cython, or C sources, run the installation command again. make and ./setup_pyecloud are shortcuts for python -m pip install -e ..

Do not install the unrelated pypic package from PyPI; PyECLOUD's Poisson solvers come from pypic-poisson.

Running simulations

A buildup simulation reads its settings from an input folder:

from PyECLOUD.buildup_simulation import BuildupSimulation

sim = BuildupSimulation(pyecl_input_folder="/path/to/input_folder")
sim.run()

The input folder contains simulation_parameters.input, the machine and secondary emission parameter files, and the beam file. The output files are written relative to the current working directory.

The same can be done with the scripts in examples/getting_started/, which also show how to resume from a saved simulation state:

python examples/getting_started/000_run_simulation.py /path/to/input_folder
python examples/getting_started/001_reload_state_and_run.py /path/to/input_folder /path/to/simulation_state_0.pkl

Repository layout and tests

  • PyECLOUD/: Python modules, Cython/C sources, and fortran/ sources.
  • PyPARIS/, PyPARIS_sim_class/, PyPARIS_CoupledBunch_sim_class/: launchers and simulation classes for coupled PyECLOUD–PyHEADTAIL simulations.
  • tests/: automated installation and numerical smoke tests.
  • testing/: simulation regression cases and their reference data. They are kept in the repository and are not part of the installed package.
  • examples/: launch scripts, example simulations, and studies.
  • docs/: documentation sources, and the original reference manual under legacy_tex/.

To run the tests and build the package:

python -m pip install -e '.[tests]'
python -m pytest
python -m pip install build
python -m build

The tests check the compiled extensions and run a short buildup simulation. python -m build creates a source distribution and builds a wheel from it.

The package version is set in PyECLOUD/_version.py. Each simulation log records the PyECLOUD version and, when running from a Git checkout, the commit.

Publishing a source release

Publish the required pypic-poisson release first. Set the new version in PyECLOUD/_version.py, then build and check the source archive:

python -m pip install build twine
python -m build --sdist
python -m twine check --strict dist/*.tar.gz

After testing the archive, commit and push the release changes to main, then run from the repository root:

./release.sh

The script reads the version from PyECLOUD/_version.py, checks that the current commit is on main and that the sdist builds and passes twine check, then creates and pushes the tag v<version>. A failed check stops the script before anything is tagged. The tag is pushed to origin; set REMOTE to push elsewhere, e.g. REMOTE=upstream ./release.sh.

Pushing the tag to PyCOMPLETE/PyECLOUD starts the Publish to PyPI workflow (.github/workflows/publish.yml). It checks that the tagged commit is on main and that the tag matches _version.py, builds and checks the sdist, and uploads it to PyPI using trusted publishing, so no PyPI token is needed. No wheels are uploaded. Follow the run in the repository's Actions tab. Tags pushed to forks build the archive but do not publish.

Documentation

The documentation site includes installation, simulation tutorials, input and output references, and links to the physical models. See Working on the documentation for local builds, previews, and publishing. Building the site does not require installing the simulation packages or compiling their native extensions.

The original Wiki remains available as a historical source. See the migration and audit notes for how its content was carried over.

Metadata

Release files for PyECLOUD 8.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PyECLOUD 8.9.0
File Size Uploaded Provenance Actions
pyecloud-8.9.0.tar.gz 193.5 kB With provenance Details for pyecloud-8.9.0.tar.gz

Release files / pyecloud-8.9.0.tar.gz

Download URL pyecloud-8.9.0.tar.gz
Size 193.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ec0c4a64935bc27c3d1b92b5f186fd22527a28c33c44ca0d2a2667a3a9f425ec
BLAKE2b-256 checksum
How to use checksums
3c6cd3adbf897547e7d90a272c23b60e2e626a5c1467a6b3be6cfcb00ff53c80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Security for PyECLOUD 8.9.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

1 file in this release has been uploaded with provenance metadata.

Attestation for pyecloud-8.9.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page