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

Uploaded CPython 3.13Windows x86-64

packlab-0.0.18-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.18-cp313-cp313-macosx_15_0_arm64.whl (4.7 MB view details)

Uploaded CPython 3.13macOS 15.0+ ARM64

packlab-0.0.18-cp312-cp312-win_amd64.whl (8.4 MB view details)

Uploaded CPython 3.12Windows x86-64

packlab-0.0.18-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.18-cp312-cp312-macosx_15_0_arm64.whl (3.5 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

packlab-0.0.18-cp311-cp311-win_amd64.whl (4.3 MB view details)

Uploaded CPython 3.11Windows x86-64

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

File metadata

  • Download URL: packlab-0.0.18-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 12.5 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.18-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 fef9535d2f88d99e70bef856a5930988b77b827d17c3c4a1838f4bacf0507f13
MD5 a7e6f322a775c7f09d71b439d65c2df8
BLAKE2b-256 edef33eab53c3d9b76cc13d824884f2838504d73d4278b9d48ccd4b6fd725791

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.18-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 916d38a80828ce12828c18227429015b4dd78f59e1acc886756dd9bf75311678
MD5 17e86d16e88062b4feb9c37efe502e00
BLAKE2b-256 5db9bfc4783cd439b9744f7ba3647cd89e8a7e48e3723f4d69585e9249239762

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.18-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 c029a84f40535b4835ca3467a7e83d6738d67fcd752bac49b26db156f8e4a356
MD5 d2fc81f3d10baecfe30b212d7d8b4a0d
BLAKE2b-256 4f4a98388b6d3843f38b9a93db2c144eba8606adce819ad06bd7c8ce9ba661fc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: packlab-0.0.18-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 8.4 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.18-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 77ea3a5ee3051a253be6e7189a4030de1df4a63c2c0efacdf3b392718afba985
MD5 fd84b87d0536e6038c984ba347c0e8db
BLAKE2b-256 d69a4835d54945951db0d2ce3d62c7b6a9b0ee1529e7345eb20797fbe74db3d3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.18-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 195d9fc760f364b44d62c2b658eb58eedfda848afe0ff1d330f26fcf607b3b6b
MD5 4abeb7a24cd8a2a33b4dbeb83c8879f0
BLAKE2b-256 d36b0471a558da91bd960ef6b66c475b5cc25f497e4fd1cdd098ed9561ae7d87

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.18-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 90e1bf95d9d334d8325746914fa48cebd46e28b6072c0ef44b3527ae7e9cc531
MD5 48849f15ac242d9d96bcaa7d84b4137d
BLAKE2b-256 18cb1c667f819df106322e274e96d50e54c9453f0533df37653fcb75203efd3f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: packlab-0.0.18-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 4.3 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.18-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 1a6591c70fe98302ef9a903d8e299968e5739b71610d86db678817677b777972
MD5 25d5aec83f68a56e94e219c4d4619f26
BLAKE2b-256 0f4b2f30418c9c12770698daf57107585851b05991022d5686a93f1765ecfea1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.18-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 4ade31867377256e51b24f1210a30ceddacd8f74c49756db85a38c0963e8e6d5
MD5 08448373a542b3734973d2ccfa14cc4c
BLAKE2b-256 2a779dfcd392f1269121e2134bbefad4f5115be00c7ceeff37d99b988ec9b15c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.18-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 4b7cd67b7fdf250a6a91d7f6112f8b251bcfbf80744b9d08674a5e7dd054ee7c
MD5 8ac07381619380133f8ab24aaf73de69
BLAKE2b-256 83900f1ebd22f5209e1979b27629315025db3597fb4bf0691154b0737d760ef5

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