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

Uploaded CPython 3.13Windows x86-64

packlab-0.0.19-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

packlab-0.0.19-cp313-cp313-macosx_15_0_arm64.whl (4.7 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

packlab-0.0.19-cp312-cp312-win_amd64.whl (8.5 MB view details)

Uploaded CPython 3.12Windows x86-64

packlab-0.0.19-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

packlab-0.0.19-cp312-cp312-macosx_15_0_arm64.whl (3.6 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

packlab-0.0.19-cp311-cp311-win_amd64.whl (4.4 MB view details)

Uploaded CPython 3.11Windows x86-64

packlab-0.0.19-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

packlab-0.0.19-cp311-cp311-macosx_15_0_arm64.whl (2.4 MB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

File details

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

File metadata

  • Download URL: packlab-0.0.19-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 12.6 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.19-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 112cc17e01ac2acaad28f0ec8349df6fbe4a1e71348ca37ff7120c64441d840f
MD5 3198032827eb2e358d3f623894671612
BLAKE2b-256 6a0381ae3bfecfa3d7f41af578451ee303524624991da2b03cc6d2b740147b34

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.19-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 74607fc65a88f144d95ebfcab35f7a0a2298b74eeccdb8570ee6377693f4cf24
MD5 ddfcfb397c9b7d62becba3c5cfb58c7f
BLAKE2b-256 cd143077e5c48c850f92a0941756c7edfe5f9756fae1261d7e675885a8dbb716

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.19-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 e8c24808a4bfc26be34620f9046a5a1e2ceebf4f289d941c87387d4e24d9a4d8
MD5 8eb11619016024cbbb934b2ff6d0c7ba
BLAKE2b-256 f7598a44e5d2e5ec0b804ede3dd2c16e7621ffe1ababdf91d38d2647f87e36d1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: packlab-0.0.19-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 8.5 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.19-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c7bfcedc4edf1925423b135612e0d1c025cfab21cb49050c7c6ae1573a6659e1
MD5 52e46f2898e688b205308eab7bdda7fa
BLAKE2b-256 1b304223ee5b576e0b6cc99f59ca9d91a42058c8b4d081eadd4cbf8cab7153ff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.19-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 c0a92059be16b7c569aa2870c0c32f2d5534bbefba5e650e946101f2ff477219
MD5 a69794521e8380262461c4bb888c1da0
BLAKE2b-256 b1595c23f03e659700761b3fe89c321da696fbbe606fad0aefd68f7af8458b77

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.19-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 930e4ab4be827921574e29e5d5740fa6527d8727bc5cb8fba783bbd9a8956cce
MD5 99e73bf9550ba2a87fac41dedf308ecb
BLAKE2b-256 3c4fefebf330bc6831191dd224c9874a98a5033af0a09864b711fb377515e01e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: packlab-0.0.19-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 4.4 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.19-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 fbc8b83500568a1388e8f599fd6402a363b1b99e9de41c3fe7a9c3a5cd054686
MD5 e134386cb4c8e6928fb0cfdcdf9ce869
BLAKE2b-256 cb3465bd30652071794488c72e1f0680fca5a12de86e5f6415f3df64060d4b16

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.19-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 54f57683f7224bd4f9195301c60ccb29e17624b4ec6f387e16c0b55ff5fc3477
MD5 09dedec7df884f6d7a2dc286e41886d4
BLAKE2b-256 3a6317688df8b48c0fdb2f77df9c09046ef15cd7ec926b4e18cdba9782bdcc69

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.19-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 bd10832a3460d1383cccce30c2de4bbf8907eaf86b3c7f9d61f7bfbf8887ebaf
MD5 25af6ff1a76db0c643231823967ceb06
BLAKE2b-256 b74d7a6bf235c3f68005738b84febdcfef67a3e9d58260700146685024791b7a

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