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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 15.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

packlab-0.1.0-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.1.0-cp312-cp312-macosx_15_0_arm64.whl (3.6 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

packlab-0.1.0-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.1.0-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.1.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: packlab-0.1.0-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.1.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 d7cbf106d5ef72143e901beba7d62d331344c9e6503ecd6da7c9d2c1390e7ac3
MD5 6b864d7765588aafed3b00a82e67cda4
BLAKE2b-256 3d9e4c66ec8b00b6bee530ef4be15b3944e66251067dfe01fca59c5ff42d7cf4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.1.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 f92f593ac7091dff4e53f799d289aede12d44c40be45b6de3701cd4915708e24
MD5 7c8e7b0bdc71fe360781592ba86afb97
BLAKE2b-256 b87ff899a7b2446841408b24fb0ea440fc3370a7c3aa813a099998752383a618

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.1.0-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 4e9f7feaf1ef9744f4e95d3fb505245e86519edcee593394f1a098304b64f470
MD5 ce053a9de555137df62023fb34a37d47
BLAKE2b-256 7855de6e6d7433fd615eaa58295a4c8e1ca29db6b7ec1814562325588ad2a4bb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: packlab-0.1.0-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.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 edb7886974bd433b6349ac656aa938966f87b8eac7a74a32516325af38c8d581
MD5 ebc2c677dab13dbe1ce4752af6c1eeec
BLAKE2b-256 7c608f91d971878138fca0749be9ccf7e622dfc7e210e262a216d1d027a4f548

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.1.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 7a876df0d66df9f5ae6bc960ae5f88f4b767671855ad4f12d8ea6fe74ef693a1
MD5 b0830287b97d5738fe96e8f1b1d8fef1
BLAKE2b-256 aa9195fe506f81a8ac7c898ed5171a816e785f034b5ab51f10d1bc35218f56bf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.1.0-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 07ff306b2a169cd71ebd47af8591eb17f83f34164063c3e60c497410fadfde57
MD5 5398a7d3c709abd27b9de46d757b3426
BLAKE2b-256 7dd4bbbca931c4bcf357fdbeb63656ae69a46f08421b90dcded38bcc3c3a8ff3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: packlab-0.1.0-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.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 eabf44609f83f78782e070f965c4a5fc4be9be41ba1dbc554e24b26e187f4f69
MD5 2ab0ba151ed56a53085fa6a9427b82d8
BLAKE2b-256 91742de5b23dd869227e071ad552350971e176f65e8884fbf6a8abbddceef27b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.1.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 094fa0846fbee736703a7ea3052c31077232e65a82812a00a0a1f3b4f5a67b55
MD5 56670a4bfaa5bb7f17dc107c31fbef7c
BLAKE2b-256 d5eda6429795d4d41c74e9d8a3eee5b4d224498e91cf7d7ef11d69d4eff3fa4a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.1.0-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 640346aaa6aa7556ac3c701131d13857656f2d98eab1aab3256e982718ccb0da
MD5 453cbcf1285f2a2b57ceb2ce827d2255
BLAKE2b-256 fa4e0c883beef21218d428db3c2971daae037834f234bd922c3c8fcecc8bd2fd

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