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

Uploaded CPython 3.13Windows x86-64

packlab-0.0.6-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

packlab-0.0.6-cp313-cp313-macosx_15_0_arm64.whl (2.5 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

packlab-0.0.6-cp312-cp312-win_amd64.whl (4.2 MB view details)

Uploaded CPython 3.12Windows x86-64

packlab-0.0.6-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

packlab-0.0.6-cp312-cp312-macosx_15_0_arm64.whl (2.0 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

packlab-0.0.6-cp311-cp311-win_amd64.whl (2.1 MB view details)

Uploaded CPython 3.11Windows x86-64

packlab-0.0.6-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (637.5 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

packlab-0.0.6-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.6-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: packlab-0.0.6-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 6.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.6-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 644a2cb2b583dcf1e01880466c4478122a8ace6a1f8e52258f76a09e2fcaae49
MD5 e453de8b60ca603a11a6d5e86a8637b0
BLAKE2b-256 f2adb2ae6be22407b9365d4533cf2fda452fa469a4ea442c392d28dead0983d3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.6-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 d4e6ad5b7af641eb907d0410eed9f820405a0fd9738d4a0b756bf71c99a54a53
MD5 b7f2696750de7922809b43513b5a9200
BLAKE2b-256 ff742cddfd6a0904af1d3536f6056d5b0ff228410c1052fe018d9ed9c53506ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.6-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 ffb2b2f0236599a6d7f5ecbb702bf6701a494ee88243074567b2fb79a0af2461
MD5 000b3377058426a788842abc4e3244dc
BLAKE2b-256 75fda5c9e70ef390ba911956774cdcd4d35fdb8fbe3a988df0656ca2761aea09

See more details on using hashes here.

File details

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

File metadata

  • Download URL: packlab-0.0.6-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 4.2 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.6-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 62475eb2f4ba5a6f70c2401735da753e0a2c9d417d3d02c2fc88793e099d92be
MD5 16e3d7f5d0bcd2e6d71cb5723042cf1d
BLAKE2b-256 ca162d74d3f09e5925e0ff8a04bb36d934ec1d53dcaf594628fdca30cae5bc04

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.6-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 a5b130b0f7a4cbade877e8f0dadb514790e58693927d62d603417b0587ead4f9
MD5 8549ca4ece2b80e64995f3466416846d
BLAKE2b-256 7674cefff66b86f639dff1aedb3a37213346c72c5f76cbb4dc6cf43eb157a627

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.6-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 befb8ba4cab38667d7f6d31aea1dc3cc7d853c50a38c43f897a69cc8ec24ab14
MD5 cb1e0cf290a17ffd45d6fc0f29aab0aa
BLAKE2b-256 0d93bb612c2cb1e5fccb5c701f9df5b29609adcbeb16f98cdb7bf3072f543d30

See more details on using hashes here.

File details

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

File metadata

  • Download URL: packlab-0.0.6-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 2.1 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.6-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 dacf55a2dd7e82b41a61b2a085364f83e8cf1571d18ac217a867dd3433bf705c
MD5 34f9c973416328c5541d162a09ec05f0
BLAKE2b-256 f33fa7670da291d978e140485039b8e7f32a24d077109027b33993142be28fc3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.6-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 5cf45327294df89ecd1b3c0a1b976608154e2c71e139b5a2f91e1927737cc7d1
MD5 a187c253a07a751d62ff9905780f9d1d
BLAKE2b-256 7ce059a642bd1ef9c5833e1925071a2c8ee77a6e4692dfac07236c4eaa410d06

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.6-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 9a5ef8eed6e61873151911ff70c6a37e83e5ef0b799c2d9f5a8450c065da62a6
MD5 2fe26911d8333ed87b9cbe1916f128e2
BLAKE2b-256 3f345086608db27927eea01b343f0075f30dd88bb7b5d89d15bf1181db09581d

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