Skip to main content

spheropack

PyPI Python versions CI Docs License: MIT Ruff

Random sphere packings in Python, generated with the event-driven Lubachevsky-Stillinger algorithm: spheres move ballistically, collide and grow until a target density is reached or the packing jams or crystallises.

import spheropack as sp

p = sp.pack(n=1000, density=0.6, seed=1)  # target volume fraction
q = sp.pack(n=1000, density="max", seed=1)  # until jammed (isostatic within a few %)
q.positions, q.radii, q.density, q.status
q.to_csv("packing.csv")
  • Periodic boxes, flat walls (slabs, closed boxes), cylinders (packed tubes), spherical containers and disks; 2D and 3D; mono- and polydisperse.
  • A fast, exact C++20 event-driven core (header-only, no dependencies) with a nanobind Python interface. The GIL is released and Ctrl-C works.
  • A well-defined, dimensionless growth rate and composable stopping criteria, including a quasi-static jamming protocol.
  • Structure analysis: pair distribution function, contact numbers, rattlers (from the collision forces), isostaticity, Steinhardt bond order, crystallinity, density profiles next to walls, radial porosity profiles in tubes.
  • A command-line tool, including drop-in replacements of the legacy generate_periodic_packing and generate_packed_tube.

The next version will also make available the rejection-free, event-driven Monte Carlo method of E.A.J.F. Peters and G. de With, Rejection-free Monte Carlo sampling for general potentials, Phys. Rev. E 85, 026703 (2012).

Status: first release (0.1). The rejection-free Monte Carlo module follows in 0.2; see the roadmap.

Installation

pip install spheropack

Wheels are available for Linux, macOS and Windows (Python 3.10 and newer). Building from source needs a C++20 compiler and CMake 3.18 or newer: pip install .

Optional extras: pip install "spheropack[plot]" for the matplotlib helpers.

Documentation

https://computational-chemical-engineering.github.io/spheropack: user guide, example notebooks, Python and C++ reference. To build it locally from docs/:

pip install sphinx pydata-sphinx-theme myst-nb breathe sphinx-copybutton sphinxcontrib-bibtex matplotlib
cd docs && sphinx-build -b html . _build/html

Citing

If you use spheropack, please cite it (see CITATION.cff); for the rejection-free Monte Carlo method, cite Peters and de With (2012).

Contributing

See CONTRIBUTING.md. Bug reports and feature requests are welcome as issues.

License

MIT

Metadata

Release files for spheropack 0.1.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 spheropack 0.1.0
File Size Uploaded
spheropack-0.1.0.tar.gz 86.5 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for spheropack 0.1.0
File
spheropack-0.1.0-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details
spheropack-0.1.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 abi3 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details
spheropack-0.1.0-cp312-abi3-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl CPython 3.12 abi3 Linux glibc 2.28+ ARM64, Linux glibc 2.27+ ARM64 Details
spheropack-0.1.0-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details
spheropack-0.1.0-cp312-abi3-macosx_10_15_x86_64.whl CPython 3.12 abi3 macOS 10.15+ x86-64 Details
spheropack-0.1.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
spheropack-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details
spheropack-0.1.0-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ ARM64, Linux glibc 2.27+ ARM64 Details
spheropack-0.1.0-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
spheropack-0.1.0-cp311-cp311-macosx_10_15_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.15+ x86-64 Details
spheropack-0.1.0-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
spheropack-0.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details
spheropack-0.1.0-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ ARM64, Linux glibc 2.27+ ARM64 Details
spheropack-0.1.0-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details
spheropack-0.1.0-cp310-cp310-macosx_10_15_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.15+ x86-64 Details

Total release size: 1.9 MB

Release files / spheropack-0.1.0.tar.gz

Download URL spheropack-0.1.0.tar.gz
Size 86.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ddcfbed8cd258b5626fda283b7ab306683e8aad3d95a2762995ca1ca37b257d4
BLAKE2b-256 checksum
How to use checksums
24e267dd300c588db9d2daa73a7b7cc23bef58c4a33b4c9f46f876d886f3f289
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 1, 2026.

Transparency log

Release files / spheropack-0.1.0-cp312-abi3-win_amd64.whl

Download URL spheropack-0.1.0-cp312-abi3-win_amd64.whl
Size 140.9 kB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
915b50f3a6bbcb58ab510b1acbb84846e7a75acf1b9b8194a4b557adb1d0f66e
BLAKE2b-256 checksum
How to use checksums
aee084134f176964acbfa4cc86670bdb5ed44728adb475927e5276ef9b1434aa
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 1, 2026.

Transparency log

Release files / spheropack-0.1.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL spheropack-0.1.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 124.4 kB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
d419dcf358f0bcf1ea957c8e7f703c7c2121c7e6667e100826abf2145e47aded
BLAKE2b-256 checksum
How to use checksums
4d64582aa676a0738951a9361a9c4668677bea2156dc6871e98b999351b748cf
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 1, 2026.

Transparency log

Release files / spheropack-0.1.0-cp312-abi3-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl

Download URL spheropack-0.1.0-cp312-abi3-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Size 119.6 kB
Tags CPython 3.12 Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
8cf40245d5dbf8a85abd33846dc2fadea677393e7c2560b446097540f2a54721
BLAKE2b-256 checksum
How to use checksums
185c553df012df4defe9be404de019ef2c38846eae74ac32af927665ce50b699
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 1, 2026.

Transparency log

Release files / spheropack-0.1.0-cp312-abi3-macosx_11_0_arm64.whl

Download URL spheropack-0.1.0-cp312-abi3-macosx_11_0_arm64.whl
Size 110.8 kB
Tags CPython 3.12 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
6b85e286f58aabf8e131a5c0346111735903238b21d4218d51b7dfbf525fce39
BLAKE2b-256 checksum
How to use checksums
af08f2ffece681d287cfacee6446d37dafaf18965be0b82a012e24663255aa28
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 1, 2026.

Transparency log

Release files / spheropack-0.1.0-cp312-abi3-macosx_10_15_x86_64.whl

Download URL spheropack-0.1.0-cp312-abi3-macosx_10_15_x86_64.whl
Size 114.9 kB
Tags CPython 3.12 abi3 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
131d90382cbb39b59c43f355bfd2a6c1d4d2cdb64dbc58d8c0195f675558ffec
BLAKE2b-256 checksum
How to use checksums
668f39c3b9e1a146c356d6de791b4fb1b6a40c9e21461ff6266b87dec387fe5f
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 1, 2026.

Transparency log

Release files / spheropack-0.1.0-cp311-cp311-win_amd64.whl

Download URL spheropack-0.1.0-cp311-cp311-win_amd64.whl
Size 141.5 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
12f68b2136586a71e29370f239e07e9af36a56a613b1099506745cb50313ca1e
BLAKE2b-256 checksum
How to use checksums
b60991ce92e12ea68dd3ecc8440f8c50faa0d04dfed131e07b052169d9c1ae3c
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 1, 2026.

Transparency log

Release files / spheropack-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL spheropack-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 128.4 kB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
dd7f2260bbc1e4864cca699b5203e1b808214408b006296d85026cd080ea5a51
BLAKE2b-256 checksum
How to use checksums
9bad7198e992ce6a42900fd52e8785ee58558b2d97a9d9113d0f2f06bf84e7f9
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 1, 2026.

Transparency log

Release files / spheropack-0.1.0-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl

Download URL spheropack-0.1.0-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Size 122.9 kB
Tags CPython 3.11 Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
b0a7f0abce1345a267e40590240639f4bb39f4ccb62f452f5ec0387bacfd4991
BLAKE2b-256 checksum
How to use checksums
49a7db0d718fc6452582a1af5737f6bdd0b5f689ad4a4c1009e9505c51ce8088
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 1, 2026.

Transparency log

Release files / spheropack-0.1.0-cp311-cp311-macosx_11_0_arm64.whl

Download URL spheropack-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
Size 112.9 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
1b3c2f7a377ad680e81a9a3c9ffe799f1fda9060dc33c35ef086796034d08786
BLAKE2b-256 checksum
How to use checksums
043302a8bd8ff9348e75d7ff61eebd073a4216746bd5e0b2d9ae7134f6473cf5
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 1, 2026.

Transparency log

Release files / spheropack-0.1.0-cp311-cp311-macosx_10_15_x86_64.whl

Download URL spheropack-0.1.0-cp311-cp311-macosx_10_15_x86_64.whl
Size 116.7 kB
Tags CPython 3.11 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
9f7bec7632339c3a63dcc19706fe7b776f1a285d074483c1386248395674efed
BLAKE2b-256 checksum
How to use checksums
bc94ac5a1c4f4873b417b3d31d25d00d8db1f4d1af03c072c839054c2f9d7a18
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 1, 2026.

Transparency log

Release files / spheropack-0.1.0-cp310-cp310-win_amd64.whl

Download URL spheropack-0.1.0-cp310-cp310-win_amd64.whl
Size 141.5 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
adcd92bdece933461e22d151848447738152bb917b741e01a22c22fe6e4c1827
BLAKE2b-256 checksum
How to use checksums
12803f35cb217488010a9c38f6cd871c9bc608036f257c6223104ffac4ae7486
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 1, 2026.

Transparency log

Release files / spheropack-0.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL spheropack-0.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 128.8 kB
Tags CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
2dd5dea5c9012d5ae1a871d2978d2f75918da743bd35877ef6d63199cef104fd
BLAKE2b-256 checksum
How to use checksums
470a0bcc4a1a4c9e61b611855079d3f95c6a0f865fcad6bd86b7888e45db9572
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 1, 2026.

Transparency log

Release files / spheropack-0.1.0-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl

Download URL spheropack-0.1.0-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Size 123.3 kB
Tags CPython 3.10 Linux glibc 2.27+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
df1dce5688131a62539000d99a04475472fed01781ef250ce6eea3b81f00230e
BLAKE2b-256 checksum
How to use checksums
eee88e56c08847a470265a30e123033fb0ac405b4a9ab01296b1e9b5e39ffd71
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 1, 2026.

Transparency log

Release files / spheropack-0.1.0-cp310-cp310-macosx_11_0_arm64.whl

Download URL spheropack-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
Size 113.2 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ce05e81b1b93762b5ff08e70b9aa538aa53e30e03b54465b948e093ea1a9b257
BLAKE2b-256 checksum
How to use checksums
255fca10ae839e1bc271927f653ae0ef8bcbca3d6e45ed428acf2fcd9241f748
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 1, 2026.

Transparency log

Release files / spheropack-0.1.0-cp310-cp310-macosx_10_15_x86_64.whl

Download URL spheropack-0.1.0-cp310-cp310-macosx_10_15_x86_64.whl
Size 117.0 kB
Tags CPython 3.10 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
cb2ce7e1dce2164fca8fb2170f02ede72690296c0b3a3f34e7647447c220bdb6
BLAKE2b-256 checksum
How to use checksums
a21da170364ff2a015ef1347b8d1b6799599e27eb2541a76f7199fef5c04f23f
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 1, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

16 release 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