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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 15.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 15.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

packlab-0.0.10-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.10-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.10-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: packlab-0.0.10-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.10-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 7a63f2d3612498085128e00fbcaa100b08c19aa4b8a0745e9d766f13135ac021
MD5 aafd6e73fb8c29992f538949fd488be1
BLAKE2b-256 226caaabd35d067518e8c4eb9573c5f0ee79a55adb0201dcf6dc4f7f04b14402

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.10-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 8c5733c9a638a1fdcae53c7b733d2b0b6b50e08d62c384a4d9e270c60935cbb9
MD5 439dce99254ae1ffe833d0494634288e
BLAKE2b-256 a457b4131baa2117c9997d1901bd38d7aa1043e5b86f12983a0f0ebb3cfa69a9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.10-cp313-cp313-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 9f944a4990eaa829c0f6835acd1a34a368b8ecffdc4187a67677021dcf499010
MD5 1680485e9662508d4b372131eb99e096
BLAKE2b-256 452c1266da1e931d2ba8c1b69fe1099520bafa5c1a8425079ead6f680137911f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: packlab-0.0.10-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.10-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 85434fb017526ac79298132334eb280cfb6823e75c99831fff32c0d9c93a3a09
MD5 2195f5b204e213d20753d7eb09dbb29e
BLAKE2b-256 b683cfdf12bda435b54372347bfd7e4fdcb8376ed29fff263eca4abf4e8dde2d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.10-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 f02036b0d85a5ddee4ba6458d075c4817eae5e661e9fd4293e8739d2ee9a4da2
MD5 8c183af8f72bf9f46e84828c63a161ed
BLAKE2b-256 7ba2e6eeac8b5fdfce3e0fa6867d4a8942c7d3dc69d8927da66671940c8091b8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.10-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 eed729b5fc1c1c9cc250b7474bd938c42a1d09a97972037082e4f0c84c7c10b8
MD5 295b6400eefa08be31543caa57871825
BLAKE2b-256 f3af9694055e658dcc72ad3edc85e95eb06f3f1153fcc590a1c7df69380b5978

See more details on using hashes here.

File details

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

File metadata

  • Download URL: packlab-0.0.10-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.10-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 8603e3c306835a56650458f3e677f0cea661bd551dfb44f95bf4a8ef7763c18e
MD5 d6401b2b87af59592ffc6d913aa161ed
BLAKE2b-256 38ea125720230aa7311c02786a57f27866c7d39216b3d951ce0f39d4a49bd052

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.10-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 29c389113cb3da7ebb8636ccfd5d16e88a4ebdec897badb4b840852dc838cb6b
MD5 97a2232bd78a2dbd4e25acd5b6e8408f
BLAKE2b-256 da5ce3ac86c9681e871eaa93d0e6d48e7b3100ef90a42cdcce41b06635771a86

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for packlab-0.0.10-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 372c37f45c7c051a21c9ff6c4cc5e3c10de4362764e9b773d00e98866ef89d3f
MD5 c661fc2eaa70b4f4e9b78dd912f4a3b8
BLAKE2b-256 8c16edf3bfdc4e7f71fa01010bae25cc60bca415983782f318c5915f08f63835

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