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

Uploaded CPython 3.13Windows x86-64

packlab-0.0.15-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

packlab-0.0.15-cp313-cp313-macosx_15_0_arm64.whl (2.7 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

packlab-0.0.15-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.15-cp312-cp312-macosx_15_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

packlab-0.0.15-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (709.0 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

packlab-0.0.15-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.15-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: packlab-0.0.15-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.15-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 228ade7d45354b42469e2736ff907e6215df581c7aa01c296c2d61dca782ed18
MD5 179e27a44d6ed6408d3c635b1956c41a
BLAKE2b-256 c4970aba916c821c2914fb584bfedf6ad9788c102c741f7f662fb7cfeee4ca3f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.15-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 f4d491e9b1d772f32a1188dc52c1d8747e0671ae99986a58b5d00ea032548d26
MD5 7bd89bd5cfa93397602375c3a37d46c1
BLAKE2b-256 7d72032cdb9da12119ab7d08be4fae77a0e6583faf7c5b46a20ac23120c87460

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.15-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 aaac0385e050ecd0fc5332f64ae323bb08fb4bef47f2c8005198db202994dd33
MD5 962b65806162fdac286a5d9b8932923a
BLAKE2b-256 ba346a6fa01503992d12ce001782a7a1ef3e4b824ea89a676c787734562b817c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: packlab-0.0.15-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.15-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 54ba34a4789fbeaafe7d2c73de8bade40ebf2a564526d77cd386d5f4123505ad
MD5 a569c7064f9dcbe516e09c5cb248c4d9
BLAKE2b-256 d002490861c71c5ee1ea123137eb8644639ded888158e72b2ec24746c9533816

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.15-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 b34107b9c5c0544a270b938184aa4249292832fe3f878613dcbd2bbb868ceb0f
MD5 3be5dc5881fa143181aea0e07c78dd81
BLAKE2b-256 2753a8965f9c1ac58eab7428e440b2ac8e1adca60c0798fc057b683f990c56b1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.15-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 82e5781a6fe68283e68e1927810ea17e00d4a773b6c0b11b7666f3ac4b55642b
MD5 c56672ec0f939fc05445025939853b00
BLAKE2b-256 9d8d8f9f16792e2a1642a4c06280d186d94507ea881b731e67192b3653e83dd8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: packlab-0.0.15-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.15-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 1e9866d0f38dc8cffad2862fae3146a8fd9884670c664f16c11cbe80b1870ba9
MD5 53c1713d3fbfcf3cacfc259e39d63bfa
BLAKE2b-256 b48d69c875cb39ff1d916988cfee15de710233be95ee021a2218ee7a5c52bf78

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.15-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 afd8c4e00fa81895c4b1e9a424d84284b2c51d480de6c61f48e8d22e2e660776
MD5 b0b5c5d81779f887db51c38fb487c6f1
BLAKE2b-256 b2fb9317ee918a4f2a37e2ac739d1bdaa382948a7d8dff5a7f0ff04e2b7e648a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.15-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 c815af0fd90a1ba43b374980d78cc5a1ca4630ae87aa757675cb93b2675475c1
MD5 fc3569949a2c8af89a450efbc2cb0ba4
BLAKE2b-256 650d886c544b68dcb499096297bcea78e8ffd056a98e0e37b67f513ae505948d

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