Skip to main content

Random Sequential Addition (RSA) particle packing with a fast C++ core.

Project description

PackLab logo

Meta

Python

Documentation Status

Testing

Unittest Status

Unittest coverage

Google Colab

PyPI

PyPI version

PyPI downloads

Anaconda

Anaconda version

Anaconda downloads

Latest release date

PackLab

PackLab is a fast Random Sequential Addition (RSA) particle packing library with a C plus plus core and Python bindings. It helps you generate non overlapping sphere configurations inside a 3D box with optional periodic boundaries. It supports mono disperse and poly disperse radius sampling through a flexible sampling interface.

Features

  • Fast C++ implementation with Python bindings

  • 3D box domain with optional periodic boundaries

  • Configurable stopping criteria: maximum attempts, maximum consecutive rejections, target packing fraction, maximum spheres

  • Radius samplers designed for future extension to poly disperse systems

  • Python level convenience API with plotting utilities and summary statistics

Installation

From PyPI:

pip install packlab

From conda:

conda install -c martinpdes packlab

From source:

git clone https://github.com/MartinPdeS/PackLab.git
cd PackLab
pip install -e .[testing]

Quick start

 from PackLab import Domain, Options, Simulator, UniformRadiusSampler

 domain = Domain(
     length_x=6.0,
     length_y=6.0,
     length_z=6.0,
     use_periodic_boundaries=True
 )

 radius_sampler = UniformRadiusSampler(
     minimum_radius=0.1,
     maximum_radius=0.4
 )

 options = Options()
 options.random_seed = 42
 options.maximum_attempts = 4_000_000
 options.maximum_consecutive_rejections = 80_000
 options.target_packing_fraction = 0.55
 options.minimum_center_separation_addition = 0.0

 rsa_simulator = Simulator(
     domain=domain,
     radius_sampler=radius_sampler,
     options=options
 )

 result = rsa_simulator.run()

 result.statistics.print()

 result.plot_slice_2d()

 result.plot_pair_correlation(maximum_number_of_pairs=3_000_000)

import PackLab

Testing

To test locally, clone the repository, install dependencies, and run pytest.

git clone https://github.com/MartinPdeS/PackLab.git
cd PackLab
pip install -e .[testing]
pytest

Documentation

The documentation includes tutorials, API reference, and gallery examples.

See Documentation Status.

Contributing

Issues and pull requests are welcome. If you are using PackLab in research, citations and links to your work are appreciated.

Contact Information

As of 2025, the project is still under development. If you want to collaborate, it would be a pleasure. Feel free to contact me.

PackLab was written by Martin Poinsinet de Sivry Houle.

Email: martin.poinsinet.de.sivry@gmail.com.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

packlab-0.0.17-cp313-cp313-win_amd64.whl (12.3 MB view details)

Uploaded CPython 3.13Windows x86-64

packlab-0.0.17-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

packlab-0.0.17-cp313-cp313-macosx_15_0_arm64.whl (4.5 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

packlab-0.0.17-cp312-cp312-win_amd64.whl (8.3 MB view details)

Uploaded CPython 3.12Windows x86-64

packlab-0.0.17-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

packlab-0.0.17-cp312-cp312-macosx_15_0_arm64.whl (3.4 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

packlab-0.0.17-cp311-cp311-win_amd64.whl (4.3 MB view details)

Uploaded CPython 3.11Windows x86-64

packlab-0.0.17-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

packlab-0.0.17-cp311-cp311-macosx_15_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

File details

Details for the file packlab-0.0.17-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: packlab-0.0.17-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 12.3 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for packlab-0.0.17-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 6a562c68af6d40a8290f8e920207b10b25cec3e68d9b3feccd0dc47bc84c00c6
MD5 7abb522780eaedfffb0f146636c8f374
BLAKE2b-256 cf3b4c81c2f7e6c2499b6f97838c47ba6cf21724152133c44d1e9f6dfef77d08

See more details on using hashes here.

File details

Details for the file packlab-0.0.17-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for packlab-0.0.17-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 86f3bba4d1e05a35e9a1f07ac8df5d3c8d5001a04c20285f0e2c4dc4f7bbf856
MD5 e8d111458cf5afd41219e551de15195d
BLAKE2b-256 5f6033f22235c1234d1424a686f7205b8e9bd5b1e09135280eac82caa774ef7a

See more details on using hashes here.

File details

Details for the file packlab-0.0.17-cp313-cp313-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for packlab-0.0.17-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 867701c9d0cb06cc57e3f7843ea4f6c276f6b1915cf1aa842c46a79a191a4e07
MD5 416a22a44e6e58bc061ff9656c587189
BLAKE2b-256 f6d0d1b9e08413f317bae4954d29b4ac67e30b689c72c8f5d12bebffc4c93154

See more details on using hashes here.

File details

Details for the file packlab-0.0.17-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: packlab-0.0.17-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 8.3 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for packlab-0.0.17-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5aa627cf642c81373ee69f632711f5ba0febcf3f81c269ae4ef65064bf880606
MD5 3e5b72fba906434b67c95df16e887ee5
BLAKE2b-256 32a4aa22336f40d13d22e4c07ca81563db07fa3f7fbe80964dccb2be4230e6d4

See more details on using hashes here.

File details

Details for the file packlab-0.0.17-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for packlab-0.0.17-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 7ea987f25e7e69766ab49dfecc62674b667920214a13c86d68c33c38882de335
MD5 22532eba89b982fe8351b9c0ad1f6102
BLAKE2b-256 2a85e8c9b586d7560a186377ce05aa7485cfb5571901b2ec507bc06cc8611e10

See more details on using hashes here.

File details

Details for the file packlab-0.0.17-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for packlab-0.0.17-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 bdeb88f8705d44d7a72b4adecb719e461c5e5b88b6820eb8b539813ee1a61dbc
MD5 a0b25db94e401e00404b15ca98cce52c
BLAKE2b-256 13b8b584c00fbabd58935c413c232fa43fef545750e7d8a9c799dcc62c4f5bb0

See more details on using hashes here.

File details

Details for the file packlab-0.0.17-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: packlab-0.0.17-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 4.3 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for packlab-0.0.17-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 6602364e8a9568c91beaf322ed8807fc787fd47facbb4de213dbc539f54c9b19
MD5 26c327e5e1cb5930626ae3eda06c3725
BLAKE2b-256 40aa5269d6146d68414bb117cf8ccf4a19d7585ab5effc8bd2c4e366033be176

See more details on using hashes here.

File details

Details for the file packlab-0.0.17-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for packlab-0.0.17-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 6e8ef136de893237e93f4c965fef81e4b6b777d5f0257419d6c320f725711eec
MD5 37888bcf6f6b3cbde8edacb3a02b0464
BLAKE2b-256 e593cb438ed20d8bdb3bb7341f444439adc450e29218a5b184f299e4cdf2c9ed

See more details on using hashes here.

File details

Details for the file packlab-0.0.17-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for packlab-0.0.17-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 43f1a15e717cfb04b46f44c886967fe85ff76a9000b11301a7184fb5391a3c3b
MD5 2bf5ad6d4aefc4e7abbe30329e33ed0e
BLAKE2b-256 d70ca3e7c54d4cd5abbd490aa7c12d2ceafbd38402534aeb6af2d42226bba0ca

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page