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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 15.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 15.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

packlab-0.0.13-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (687.4 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

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

File metadata

  • Download URL: packlab-0.0.13-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.13-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 28da94897ec7f8545f107b4511c89b2e06df9fc3f7e01567248bf896d0e26c75
MD5 6c1351a0b0b3661782af283c8772667a
BLAKE2b-256 a12a5b68cfbfc825a6b7468c8cc4d2a62bdfbbf4e6d7cc1537415422ab277c30

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.13-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 08551070d0c4761b4329f3ce4ce02cc365e3f491f0a060df6bc84a84824b9871
MD5 d8723cdbee34225cf7b09797654b15a5
BLAKE2b-256 77729b04f56ad2c383712dbfaf981d656fa2125b83af70e39adcccc696821d6e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.13-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 8656b2927cdab154d55fe4922966c86a30740c0f388ec6c3d8790364fa84909c
MD5 b6da2bcf949cfe9a304a541f13457774
BLAKE2b-256 e209d92d3c80486188097893ddf9d1264c4145e4e080263ae16462c234f55788

See more details on using hashes here.

File details

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

File metadata

  • Download URL: packlab-0.0.13-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.13-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 1645f965343c7361d12ffe14d542af333af0ef275b4e42da19cfda2db39e6681
MD5 a2c3ee601e8c46074b10c71b73d29427
BLAKE2b-256 d7d6fccfefac010a6684b9bc6e94c8f1d5ef1867e977333c6a728038e016a9a6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.13-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 76c66d1156ae66ba13a6d2826f5b771bf0624762fc5b33d40b32397f9128639c
MD5 5e98bb2b194e0fb1cb9b23f9fe69d4a9
BLAKE2b-256 930b832bc63821893ea2d74f2d3d36b219f6ebfd5db3b4843fdaad7bdbe38e5c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.13-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 ebd04c1526c3770df2f15c372402162f90ed8ac93d4acf76ed362b3dbc5ab85a
MD5 92f6be5099cc58e9c52b6206a57b7ade
BLAKE2b-256 94fb7367974f3f3bdf8372a2d0a4fe4697f0fd811acf3de333ed875bac15c4c1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: packlab-0.0.13-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.13-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 df25184587bc7a9830af6749972474c60359bc0e6d231e33b3407fae38f596c9
MD5 ff53c9eacc11637d62079dbccb634d03
BLAKE2b-256 82a3fcf16ada1dfb5d620400aec063a5420ea02ea44f144a96d01cd53ea0f542

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.13-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 2abbb8cf62ca699a4e22c00622c1bcceef9f21624ccbe134ffd4217b0aca0b1a
MD5 33152086bea3d600d23a5288545ebdd9
BLAKE2b-256 50c09c666ad81a153d8249ffbe8a3f3c1ec03e57ee64a2d13216b7f400174e64

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.13-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 a98eac416cca54f63c2f1188d29f97521fce98927720f040332e96e51031522a
MD5 3c7596d52e5fcc6b47eb7b0390878b55
BLAKE2b-256 1b3caa4456001d0565f3bdd2cbcc06480dfe2cae53f865f8a86f8b4b02de61c0

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