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

Uploaded CPython 3.13Windows x86-64

packlab-0.0.14-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.14-cp313-cp313-macosx_15_0_arm64.whl (2.6 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 15.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

packlab-0.0.14-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (695.7 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

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

File metadata

  • Download URL: packlab-0.0.14-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.14-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 4d65d11a694d732cfe1dfc45e6e34a9a6f8ec56735b58cfe38a10afba57f7671
MD5 02cef7f4158bb7fd230e399d906cc13c
BLAKE2b-256 b2c211ef364d8ec9f95ddb8b78db618018789fdb584ecf6faede6ec1bb1f0439

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.14-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 16bfd0020ef7f047daf04bf1ef1e70eb08fb1c1deb71745e39c0ee62e39f668a
MD5 530502fec7bed195bf4ebe6382ac5d2f
BLAKE2b-256 fd0c03e3abf847278a15dc82a20633f7b31448e2064d1cb114982bd4539d49d0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.14-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 d1f9feeb3b939e025f1126b70c0b474442e7c46ac7c8c0df4a4ad541ff1a59fd
MD5 89cbd49c0b159ccae82b48b91e0c857d
BLAKE2b-256 27288917930d3c296f7802dd84a6035fd24a578f0c0d8c009aeaf5b019ae9058

See more details on using hashes here.

File details

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

File metadata

  • Download URL: packlab-0.0.14-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.14-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 19a318dc3dd931da9523132b5a39cd50717a08baf1f2a2be6f2d0fdd86cc1300
MD5 7bbbcccd9697b3dc1cb815d3bfd898f9
BLAKE2b-256 08824675d85bd5feb2bd491ad9519226500b2d36e59dbeb3a4385088496841a3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.14-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 e68cf3922773590d48fd97249a874cb1d8ac2a14dfd40f1be6d809da8088665b
MD5 606cc0c8610ed430576ff5a56d4d3c94
BLAKE2b-256 3e2d5dc653f89e90402948e81f79592a60e8c7187325c17f146acffb798c2ef9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.14-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 8f721816d49cf3a5277f3838e4f305ae419d02ff11f6b1ca0d05df9b3c18e901
MD5 6e5945b9a0d7fea8eda9b5a77bea19f6
BLAKE2b-256 49c33c9445d419915b884fea68ffc186d17161e4de72a5a120cebb09f5ee9206

See more details on using hashes here.

File details

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

File metadata

  • Download URL: packlab-0.0.14-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.14-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 d096f117f1d2eedda440f58945325db3842a366d362f22b73a638c0689e2213c
MD5 64fc25a147e69bfa31f55622cbbbfea9
BLAKE2b-256 95f4018e1f058797b2a0cb4486a24c2844f4697f2250ceaed537b20b7835d557

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.14-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 546f2ee3b50723198ab8ce41ece52a971fc1e801086ee087207616fc7f83fbb9
MD5 bc0430ae79e627dce97f9a55942d97ee
BLAKE2b-256 c343d277c21c9c9e106efe46c77d53cabf30dd7bfe59903630d79895c60acca3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.14-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 77f6261e33a65ebf15234445ecf3b82820af485088b8a41c3b13a8b6da62a1a1
MD5 391f29d1fb40ee2957c851fd2ba90b22
BLAKE2b-256 ccd7479e578cefa9056100bd0efb30f512384ae2748a27593b82017168529f05

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