Pack water molecules into atomic systems for molecular simulations
Project description
Water Packer
Pack water molecules into atomic systems for molecular simulations. High-performance, O(1) collision detection using spatial hashing.
Installation
pip install water-packer
For hyobj support:
pip install "water-packer[hyobj]"
Quick Start
from water_packer import WaterPacker
from molecular_builder import create_bulk_crystal
# Create a MgO slab
mgo = create_bulk_crystal("periclase", [15.0, 15.0, 15.0])
# Create packer and pack water
packer = WaterPacker(
water_density=1.0, # target density in g/cm³
pairwise_distances={('O', 'Mg'): 2.0},
seed=42,
)
result = packer.pack(mgo)
print(f"Added {(len(result) - len(mgo))//3} water molecules")
Features
- Multiple input formats: ASE Atoms, hyobj PeriodicSystem, or raw arrays
- Species-specific distances: Different minimum distances per atom pair
- Automatic density calculation: Computes number of waters from target density
- Volume-aware packing: Accounts for substrate exclusion volume
- Physics Safeguards: Warns user if requested density exceeds physical packing limits
- Hybrid Relaxation: Supports optional MC/minimization steps for fitting water into tight surface features
API
WaterPacker
WaterPacker(
min_distance=2.0, # Default minimum distance (Å)
pairwise_distances=None, # Species-specific: {('O', 'Mg'): 2.0}
water_density=1.0, # Target density (g/cm³)
seed=None, # Random seed
)
pack_water (convenience function)
from water_packer import pack_water
result = pack_water(system, n_waters=10, water_density=1.0)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file water_packer-0.2.4.tar.gz.
File metadata
- Download URL: water_packer-0.2.4.tar.gz
- Upload date:
- Size: 19.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3555817d4b4af83db2ff419e282ab770f12e88592b62b116f31bf2d3646309a8
|
|
| MD5 |
44e66f92a344c8b946ce634b888e106e
|
|
| BLAKE2b-256 |
b221ff631816161209dac5437c9a28b9d9e1f0c9dcb6c845261e88e888d43762
|
Provenance
The following attestation bundles were made for water_packer-0.2.4.tar.gz:
Publisher:
publish.yml on henriasv/water-packer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
water_packer-0.2.4.tar.gz -
Subject digest:
3555817d4b4af83db2ff419e282ab770f12e88592b62b116f31bf2d3646309a8 - Sigstore transparency entry: 863316568
- Sigstore integration time:
-
Permalink:
henriasv/water-packer@9a3afb98abe823015f91cb89c5263a69b71729d0 -
Branch / Tag:
refs/tags/v0.2.4 - Owner: https://github.com/henriasv
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9a3afb98abe823015f91cb89c5263a69b71729d0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file water_packer-0.2.4-py3-none-any.whl.
File metadata
- Download URL: water_packer-0.2.4-py3-none-any.whl
- Upload date:
- Size: 24.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57be16c534b41698630d4645c7f3e24b82eda2ec2add07c5acf83f84c71e585e
|
|
| MD5 |
3ea68d17d7dbdae4806af27056023c41
|
|
| BLAKE2b-256 |
7ace7f30e0e32efd65fb87c117c0bcf20a03e140d324bf811524fd8903db9044
|
Provenance
The following attestation bundles were made for water_packer-0.2.4-py3-none-any.whl:
Publisher:
publish.yml on henriasv/water-packer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
water_packer-0.2.4-py3-none-any.whl -
Subject digest:
57be16c534b41698630d4645c7f3e24b82eda2ec2add07c5acf83f84c71e585e - Sigstore transparency entry: 863316572
- Sigstore integration time:
-
Permalink:
henriasv/water-packer@9a3afb98abe823015f91cb89c5263a69b71729d0 -
Branch / Tag:
refs/tags/v0.2.4 - Owner: https://github.com/henriasv
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9a3afb98abe823015f91cb89c5263a69b71729d0 -
Trigger Event:
push
-
Statement type: