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

Uploaded CPython 3.13Windows x86-64

packlab-0.0.7-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.7-cp313-cp313-macosx_15_0_arm64.whl (2.5 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

packlab-0.0.7-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.7-cp312-cp312-macosx_15_0_arm64.whl (2.0 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

packlab-0.0.7-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (644.8 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

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

File metadata

  • Download URL: packlab-0.0.7-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.7-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 23e449ab609ff7a3f4d1323be5072429a8e0aea9bd2d3557fa5ede779a4e50d4
MD5 73f7680c8c4dbbab68e8ce92bf57fde6
BLAKE2b-256 493f75535cede015a2fa656d15c03117e1caa7edef86aa09a052cc84fc993850

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.7-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 307f537f866d8de61447f8c1969fe812bba724de8f66804ea0319dd1f0ad1bd5
MD5 01f1f34d9a0dc0f7914ed16d2c87ff23
BLAKE2b-256 e0396b2799010b39a817cbd339debe8d02be5d6c1adf61822792e0fe190b0ef7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.7-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 4176d5bef7aab6e4e101a51b2f1a8615dc59c6624821a30f9b948187d086dd9d
MD5 e3f7fed37c52cf5c167e2cf710c05459
BLAKE2b-256 0b9960073665f6dda0c447ad13e946901f73e2b769de72d1c0936e29fa7875af

See more details on using hashes here.

File details

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

File metadata

  • Download URL: packlab-0.0.7-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.7-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 d11ca60ab65f78b5af1e99167a38610839f2e24b80ef161353a984b0232ad75b
MD5 bda25c3cab059af49a53285980e5ce57
BLAKE2b-256 0666854120d19fc2f165565e5c8f2722581c85d869b2edf67c5071898eb77d86

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.7-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 b707a0a6d1bc434089c125d293075e6f0e45ce61488006b39e59bf4ea04c30b4
MD5 0a0c5845bac4fd1da9184e4f76a38586
BLAKE2b-256 0b0710684118ebb763ae5041d58943b44f63835cc6a83222e7f68c09e536ea12

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.7-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 4cc599801ef11f587cf1a9b3c94e41a6765dbdfc2752fb119092ab353a1ea58b
MD5 571c5e47ebd0203877c3f98a4d0fd0eb
BLAKE2b-256 ce7112e3221b4727ab0bfc3991cb42997e76339e0db2a20b9b0132b6d4ce0b11

See more details on using hashes here.

File details

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

File metadata

  • Download URL: packlab-0.0.7-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.7-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 34bde21f6965ae314f53b8d97cc8cb4f5f53d100920ba1c588dbbb88955b0883
MD5 e456a4728c2bfa93782f4370a32e9646
BLAKE2b-256 7002fb8f32f78274ccda9bc2861b260b0001d2efca4699f157345b85508f5f20

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.7-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 73cd8f266efda263cb7b06e497230c9f0cb2d8ee9225c0aa68bfb11097616e0c
MD5 f96220fd3b9f5cbfce6362466d16c189
BLAKE2b-256 01e5d32dab9f456fe4221575e7ff7802a7d86cdee5c6413b1aac514c8df2b10b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.7-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 e8a68a9d5857b801d7972a99838d1312e305615e3c9fb4aefe9a6528b9714827
MD5 ddb04976b13d4dd17414dae82e7d7050
BLAKE2b-256 63e44b9a769ba1e93dc64666f27b1eebc5d558c228e4ea49de0725128fd7fe99

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