Skip to main content

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")

Solvated Periclase

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

# Option A: Pack exactly 10 waters
result = pack_water(system, n_waters=10)

# Option B: Pack using target density (mutually exclusive with n_waters)
result = pack_water(system, water_density=1.0)

Metadata

Release files for water-packer 0.2.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for water-packer 0.2.6
File Size Uploaded Provenance Actions
water_packer-0.2.6.tar.gz 19.5 kB With provenance Details for water_packer-0.2.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for water-packer 0.2.6
File Interpreter ABI Platform Actions
water_packer-0.2.6-py3-none-any.whl Python 3 none any Details for water_packer-0.2.6-py3-none-any.whl

Total release size: 44.5 kB

Release files / water_packer-0.2.6.tar.gz

Download URL water_packer-0.2.6.tar.gz
Size 19.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e0101a7f1f9446d2de5dd1bc1042c06f41ee99a4ccba633b46888b2d1acac3b8
BLAKE2b-256 checksum
How to use checksums
cf13a94ef15c9101568eab1bd62d32928f22c555243cca4e834fbb15e137eaf5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 27, 2026.

Transparency log

Release files / water_packer-0.2.6-py3-none-any.whl

Download URL water_packer-0.2.6-py3-none-any.whl
Size 25.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8fa22a35e984922df96346472073521a176d7e5323c9115952fb9128db3dbacf
BLAKE2b-256 checksum
How to use checksums
2d88b65e1302c0ab21fb88e844a520f48897ecb199ee9a3ab0949d3e60436346
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 27, 2026.

Transparency log

Security for water-packer 0.2.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for water_packer-0.2.6.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page