Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

PyParticles3

PyParticles3 is an independent modernization and continuation of Simone Riva's original PyParticles project.

The goal is to preserve the original project's unusually clear, educational architecture while updating it for modern Python, NumPy, SciPy, PyOpenGL and PyOpenCL environments. PyParticles3 is also a practical study project for GPU particle simulation, OpenCL acceleration and OpenCL/OpenGL interoperability.

PyParticles3 is not presented as an official release endorsed by Simone Riva. Original copyright notices and the GPL-3.0-or-later license are preserved.

Highlights

  • simple ParticlesSet -> Force -> Solver -> Animation/Renderer architecture;
  • Euler, Leapfrog, Runge-Kutta, Midpoint and Stormer-Verlet style integrators;
  • gravity, springs, constant force, drag, damping, Lennard-Jones, electrostatic and electromagnetic models;
  • constrained particles and constrained force interactions;
  • OpenGL interactive visualization;
  • optional PyOpenCL acceleration;
  • persistent OpenCL buffers to avoid unnecessary PCIe transfers;
  • fused OpenCL integration paths;
  • OpenCL/OpenGL shared VBO rendering;
  • double-buffered CL/GL synchronization with GL fences;
  • asynchronous OpenGL GPU timer queries;
  • an optimized fountain example used as a GPU performance case study.

Installation

The first PyPI release is planned as PyParticles3 0.4.0rc1.

Once published:

python -m pip install PyParticles3

For OpenCL support:

python -m pip install 'PyParticles3[opencl]'

The OpenCL runtime/ICD and an OpenGL/FreeGLUT implementation are system-level dependencies and are not installed by pip.

Current import namespace

The initial PyParticles3 packaging release intentionally keeps the historical Python import namespace:

import pyparticles

This avoids mixing a package-wide namespace migration with the packaging release. A future release may introduce a dedicated pyparticles3 namespace after a controlled compatibility migration.

Command line

The modern package exposes:

pyparticles3 --help
pyparticles3 --version

The historical command is also kept as a compatibility entry point:

pyparticles_app --help

Examples:

pyparticles3 --demo springs
pyparticles3 --demo solar_system
pyparticles3 --demo bubble
pyparticles3 --demo gas_lj
pyparticles3 --demo elmag_field
pyparticles3 --demo galaxy
pyparticles3 --demo fountain

Architecture

ParticlesSet
    |
    +--> Force / MultipleForce
    |        |
    |        v
    +----> ODE Solver
             |
             v
        Animation
             |
             v
          Renderer

The accelerated paths preserve these conceptual roles rather than replacing the whole program with an opaque GPU pipeline.

OpenCL/OpenGL fountain path

The modern fountain demo can keep simulation state resident on the GPU and render from shared OpenGL buffers. The optimized fused path writes both the canonical OpenCL position buffer and the shared render VBO from the integration kernel, eliminating a separate device-to-device position copy.

Profiling can be enabled with:

PYPARTICLES_PROFILE_CLGL=1 \
PYPARTICLES_PROFILE_FRAMES=1000 \
PYPARTICLES_PROFILE_WARMUP=200 \
pyparticles3 --demo fountain

The experimental fused render mirror is currently selected with:

PYPARTICLES_CLGL_FUSED_MIRROR=1 \
pyparticles3 --demo fountain

Development

git clone https://github.com/jamaj69/pyparticles.git
cd pyparticles
git switch package/pyparticles3

python -m venv .venv
source .venv/bin/activate
python -m pip install -U pip
python -m pip install -e '.[dev]'

python -m compileall -q pyparticles tests
python -W default -m unittest discover -v -s tests

Build the PyPI artifacts with:

python -m build
python -m twine check dist/*

Project links

When releases are published through PyPI Trusted Publishing from this GitHub repository, PyPI can verify the GitHub project links carried in the distribution metadata.

Origin and attribution

PyParticles was created by Simone Riva in 2012. PyParticles3 is an independent modernization built from that GPL-licensed codebase. The modernization focuses on Python 3 compatibility, modern scientific Python libraries, testing, GPU acceleration, CL/GL interoperability and documentation while preserving the original educational structure.

License

GPL-3.0-or-later. See LICENSE-gpl-3.0.txt.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyparticles3-0.4.0rc1.tar.gz (710.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyparticles3-0.4.0rc1-py3-none-any.whl (164.8 kB view details)

Uploaded Python 3

File details

Details for the file pyparticles3-0.4.0rc1.tar.gz.

File metadata

  • Download URL: pyparticles3-0.4.0rc1.tar.gz
  • Upload date:
  • Size: 710.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pyparticles3-0.4.0rc1.tar.gz
Algorithm Hash digest
SHA256 e3e7ab0b808f2f26fe2d41f72f7baf1a1ffcc28441055ca9b18ba19f75126023
MD5 e8137284f3d585d490a4227f1a45f8ff
BLAKE2b-256 ccd56bd5e030648f7a53d5f44604473b4cbaabe2c85640d6f4ec02665648b075

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyparticles3-0.4.0rc1.tar.gz:

Publisher: release.yml on jamaj69/pyparticles

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyparticles3-0.4.0rc1-py3-none-any.whl.

File metadata

  • Download URL: pyparticles3-0.4.0rc1-py3-none-any.whl
  • Upload date:
  • Size: 164.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pyparticles3-0.4.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 de4ce4e02cd8c8dbdd53ef6b13123e5c467916df635a7a819d42945a1be670e5
MD5 096ee1280481322235a3cffe1b059575
BLAKE2b-256 966da8f8f8bc39f0c95de44dcaaac86d0f10c3784f06700010d679bbb414fa5c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyparticles3-0.4.0rc1-py3-none-any.whl:

Publisher: release.yml on jamaj69/pyparticles

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.4.0

2 files

This release

0.4.0rc1 This release

2 files

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