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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 15.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 15.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

packlab-0.0.9-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (661.2 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

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

File metadata

  • Download URL: packlab-0.0.9-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.9-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 4040665dfc28307ed3f0d1f00d3c87af47e467295e8a4e801fba676cb4233e24
MD5 be0e1132847795c30b19af5683dbf15d
BLAKE2b-256 7539248e2b9cfa4f4e83f0fcb32981745a7a828156eb5f1265fe498574bb33ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.9-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 457b0f03da380bb1f18079f17b6a01789568ebc6c48d6882218dfd60177bde27
MD5 d0d65385f9cfe12674073f97c16153e7
BLAKE2b-256 0b6648e5420b614decf3e6a010e035783e1955d3635ba6d8389d86d9196fdb30

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.9-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 a7d13a854b2547160daed230d7b40331606aa8251092a035c8914d6151fa6d43
MD5 1dd62181a8da7e8702db79c502a5bb0a
BLAKE2b-256 54ae43710f0a59831d73493ce1b54f936acb1a3fa550dd40138f4e9db79a6ec0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: packlab-0.0.9-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.9-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 bd59a9b6a900170f0ba4a22970321aa6fcb8a9b2827e71f70db49422ef4c0ef1
MD5 e1875f53371369015fcf1cbce7042760
BLAKE2b-256 c3f92f9ecc7a3085fa0fcbd2059a5c42dd447f3c9d61e6768fb1437f1cbb5521

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.9-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 d41ab298850bdf0a53dbece3f9db9d05d6ce0408230ffc323e9c04da76df0dd1
MD5 fe7e8c60de2c8445a37823aaf472eea0
BLAKE2b-256 65bfec43e5e7b3dcafd1dd69c6424c76e60161eb422ab2df6fb93d2324f9f19c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.9-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 e1354589ba2972bf0f31d86672f740faa4dc3a6307e33a03381030d0d2bf8b95
MD5 fdb98d0efe40d300c9bcd4346a3746ee
BLAKE2b-256 c13eeda0f059e6da480525d298c534ac0ae02d6a0088e4ce5aa8fed27531fdd4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: packlab-0.0.9-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.9-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 3a5b998a423b0b8f7f0dcb1d1abfcb571106144be3ebf07919a1da0b7452d2c3
MD5 2c52ebcf1f0afac2176fb2c530d02134
BLAKE2b-256 5994be9bd446ed072e3984f82f02a7d628710d5a996bcd7d2a902bf98909c523

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.9-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 012b182bcc5e9bc621cd9f55323fb42df7b970c80b46ba5c5ceedd8579d3ef13
MD5 b820badf389ca8fde1ab0bf49afdad01
BLAKE2b-256 85e6aa6ce9f787f612dff2973eaca76b09446eae5bd0cbc00fdda6b6b74fdd7a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.9-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 fb5319cd03bb3df1bb4c0e31dd6b07720f838333957be5a8d9bc8fc2b3e7fc9f
MD5 fad9bcff4f6c7de06ac6347befcd55aa
BLAKE2b-256 2796142396d0cd0fdded104ef3f10ed06dc3af60f5fb242250354a892c494667

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