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.11-cp313-cp313-win_amd64.whl (6.4 MB view details)

Uploaded CPython 3.13Windows x86-64

packlab-0.0.11-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

packlab-0.0.11-cp313-cp313-macosx_15_0_arm64.whl (2.6 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

packlab-0.0.11-cp312-cp312-win_amd64.whl (4.3 MB view details)

Uploaded CPython 3.12Windows x86-64

packlab-0.0.11-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

packlab-0.0.11-cp312-cp312-macosx_15_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

packlab-0.0.11-cp311-cp311-win_amd64.whl (2.2 MB view details)

Uploaded CPython 3.11Windows x86-64

packlab-0.0.11-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (689.9 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

packlab-0.0.11-cp311-cp311-macosx_15_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

File details

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

File metadata

  • Download URL: packlab-0.0.11-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 6.4 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.11-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 f5465e0dfeb90f9add65d9b87f145e6eb18df0fecd862148d2260ae950ed3410
MD5 91a694c6875f5b59462ebda3c224a34f
BLAKE2b-256 2d7542595542b83ce8410229a02be60ddcb0d5328a8cf5c41474873cdab6d873

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.11-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 0367c66c38e9e5d9788bf82f2c196272efe6a40ede48cedfb44dc58bf2f78cd0
MD5 69ffad317063893df9cb6bdf0fc81ba6
BLAKE2b-256 99cd0166691217bbce1a04efd094e3a72534675abaab3320eb16bb453b0edd84

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.11-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 88b6ba1e823b804c032c0b3dd569ced7099bc4715c897259ceaef30a03a98428
MD5 15306ef7eab70d64983650d30c0dd833
BLAKE2b-256 e0071def85cb6e3b475f512446eb7cf8675341a38882ed63feff90eaf9dcbf81

See more details on using hashes here.

File details

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

File metadata

  • Download URL: packlab-0.0.11-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 4.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.11-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 0cfa7e85b9e1d704566565206e3257647a4db9f201b2c5653a80deaa425dd706
MD5 f3e43c49a9345817f54525874404dc17
BLAKE2b-256 e6a086adb159e5b43eab8f657cb47cbd5a9cd9c57e815549b9893f07276ad2c9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.11-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 c6b4a45e3cb0ccb7fca115b869da2239a5b3a5a7124ee907b499c789e86bb599
MD5 ac7fbc6421ecbcad1ec7b63668490db3
BLAKE2b-256 0a10552d223834fcf80c5ef88ac87cd33521949d40a0bd2600cb49031d5976b7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.11-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 438b14820c944a389843d0b592a77f92262ced141a1dd1d8b2a8993f215750b8
MD5 522478b56d81ff64f8c1ec70fb43ef3e
BLAKE2b-256 de87739c48572fa7215da29ef51e5aad66b9c0011dc47193f6d115db5689538e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: packlab-0.0.11-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 2.2 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.11-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 2701cb314753f53884f42fad620c898d73ca26097beb20df443af08d607b8614
MD5 2b254c8b7f21f700cc02e4ec086f1589
BLAKE2b-256 f381a6806922a573c31628b2cfa0595eac5d30c0d085c367d4e2d452b27f34a0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.11-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 d90365fa3ad92b06098c57aa384de626309de8ec535dcf45fae39ee507f36543
MD5 f5ae77fcdebb8a97a10ef567e1c53d15
BLAKE2b-256 602fdaa5c3b92ae27d12b0579fd67fe4f0e7550f01f9f7d348caf087e9b4dcd8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.11-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 84577f9dc06ec4409e3ebf2a4e6399a42add388f8441d07b157825c04abf4cc3
MD5 62e01aa3bb93b3552a5644cf36b1b32c
BLAKE2b-256 0243b0822dd706fa2d635237bd2c04134583c5fb5eff21c7bcb129f4377bb1d6

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