Skip to main content

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

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

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

water_packer-0.2.5.tar.gz (19.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

water_packer-0.2.5-py3-none-any.whl (24.9 kB view details)

Uploaded Python 3

File details

Details for the file water_packer-0.2.5.tar.gz.

File metadata

  • Download URL: water_packer-0.2.5.tar.gz
  • Upload date:
  • Size: 19.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for water_packer-0.2.5.tar.gz
Algorithm Hash digest
SHA256 afb73544c117fa7814aab455e16ca4e113a7001b32464b584b6998c796099e62
MD5 cf946e5e10abe568437f289c55ff44f1
BLAKE2b-256 3eeb3a58d37fd1b3acb776e480f7c8fff10084dd1194b41475294d8e2bd767c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for water_packer-0.2.5.tar.gz:

Publisher: publish.yml on henriasv/water-packer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file water_packer-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: water_packer-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 24.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for water_packer-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0a69acbf9618cf1ddf06f80023b5ccd7a3f6a886fee4ca2ab3ec9a07ebca32d7
MD5 8cf069cca0585d6301c8987ace2dd349
BLAKE2b-256 92d7dd2528bea873b574f63b59af7e0b401f4cb2bb31fb1ceab7d4440783ef99

See more details on using hashes here.

Provenance

The following attestation bundles were made for water_packer-0.2.5-py3-none-any.whl:

Publisher: publish.yml on henriasv/water-packer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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