Metadata-Version: 2.2
Name: wetting-angle-kit
Version: 1.0.3
Summary: A Python library to parse MD trajectories from LAMMPS and ASE and measure the contact angle through different methods
Author-email: Gabriel Taillandier <gabriel.taillandier@matgenix.com>, Matgenix <info@matgenix.com>
License: BSD 3-Clause License
        
        Copyright (c) 2025, Matgenix
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        
        1. Redistributions of source code must retain the above copyright notice, this
           list of conditions and the following disclaimer.
        
        2. Redistributions in binary form must reproduce the above copyright notice,
           this list of conditions and the following disclaimer in the documentation
           and/or other materials provided with the distribution.
        
        3. Neither the name of the copyright holder nor the names of its
           contributors may be used to endorse or promote products derived from
           this software without specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
        
Project-URL: Homepage, https://github.com/Matgenix/wetting-angle-kit
Project-URL: Source, https://github.com/Matgenix/wetting-angle-kit
Project-URL: Bug Tracker, https://github.com/Matgenix/wetting-angle-kit/issues
Project-URL: Documentation, https://matgenix.github.io/wetting-angle-kit
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Topic :: Scientific/Engineering :: Visualization
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.26.0
Requires-Dist: scipy>=1.13.0
Requires-Dist: matplotlib>=3.9.0
Requires-Dist: plotly>=5.24.1
Requires-Dist: tqdm>=4.66.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: isort>=5.0.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Requires-Dist: ruff>=0.15.0; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"
Provides-Extra: doc
Requires-Dist: sphinx>=7.0.0; extra == "doc"
Requires-Dist: sphinx-rtd-theme>=1.0.0; extra == "doc"
Requires-Dist: sphinxemoji; extra == "doc"
Requires-Dist: sphinx-copybutton; extra == "doc"
Requires-Dist: sphinx-argparse; extra == "doc"
Requires-Dist: sphinx-code-tabs; extra == "doc"
Requires-Dist: sphinx-issues; extra == "doc"
Requires-Dist: nbsphinx>=0.8.0; extra == "doc"
Requires-Dist: sphinxcontrib-mermaid; extra == "doc"
Requires-Dist: myst-parser; extra == "doc"
Provides-Extra: viz
Requires-Dist: ipython>=8.0.0; extra == "viz"
Provides-Extra: ase
Requires-Dist: ase>=3.23.0; extra == "ase"
Provides-Extra: ovito
Requires-Dist: ovito~=3.11.3; extra == "ovito"
Provides-Extra: all
Requires-Dist: ase>=3.23.0; extra == "all"
Requires-Dist: ovito~=3.11.3; extra == "all"
Requires-Dist: ipython>=8.0.0; extra == "all"

# wetting-angle-kit

[![tests](https://img.shields.io/github/actions/workflow/status/Matgenix/wetting-angle-kit/testing.yml?branch=main&label=tests)](https://github.com/Matgenix/wetting-angle-kit/actions/workflows/testing.yml)
[![docs](https://img.shields.io/github/actions/workflow/status/Matgenix/wetting-angle-kit/deploy-docs.yml?branch=main&label=docs)](https://github.com/Matgenix/wetting-angle-kit/actions/workflows/deploy-docs.yml)
[![code coverage](https://codecov.io/gh/Matgenix/wetting-angle-kit/branch/main/graph/badge.svg)](https://codecov.io/gh/Matgenix/wetting-angle-kit)
[![pypi version](https://img.shields.io/pypi/v/wetting-angle-kit?color=blue)](https://pypi.org/project/wetting-angle-kit/)
[![Python versions](https://img.shields.io/pypi/pyversions/wetting-angle-kit)](https://pypi.org/project/wetting-angle-kit/)
[![License: BSD 3-Clause](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](LICENSE)
[![Documentation](https://img.shields.io/badge/docs-matgenix.github.io-blue)](https://matgenix.github.io/wetting-angle-kit)

wetting-angle-kit provides modular tools to parse MD trajectories (LAMMPS dump, XYZ, ASE) and compute droplet contact angles using two complementary approaches:

1. Slicing Method (per-frame circle fit) – robust against transient shape changes.
2. Binning Density Method – averages frames into a density field for a single representative angle.

The documentation is available [here](https://matgenix.github.io/wetting-angle-kit), you can find examples and tutorials.

## Installation

### Prerequisites

Before installing wetting-angle-kit, ensure you have the following prerequisites:

1. **Python 3.10 or higher**: Make sure you have Python 3.10 or higher installed on your system.
2. **Conda**: Ensure you have Conda installed. If not, you can install it from [here](https://docs.conda.io/en/latest/miniconda.html).

Core (only to analyse simple xyz trajectories):

```bash
pip install wetting-angle-kit
```

With OVITO:
```bash
pip install wetting-angle-kit[ovito]
```
With ASE:
```bash
pip install wetting-angle-kit[ase]
```
All optional:
```bash
pip install wetting-angle-kit[all]
```

#### Install OVITO

OVITO must be installed first in the conda environment and using the following Conda command:

```sh
conda install --strict-channel-priority -c https://conda.ovito.org -c conda-forge ovito=3.11.3
```

## Quick Start


```python
from wetting_angle_kit.analysis import (
    BinningTrajectoryAnalyzer,
    SlicingTrajectoryAnalyzer,
)
from wetting_angle_kit.parsers import XYZParser, XYZWaterFinder

trajectory_file = "trajectory.xyz"

# Identify water oxygen atoms by neighbor count. ``particle_type_wall``
# lists the symbols of the substrate atoms so they are excluded.
finder = XYZWaterFinder(trajectory_file, particle_type_wall=["C"])
oxygen_ids = finder.get_water_oxygen_indices(frame_index=0)

parser = XYZParser(trajectory_file)

slicing = SlicingTrajectoryAnalyzer(
    parser,
    atom_indices=oxygen_ids,
    droplet_geometry="spherical",
    delta_gamma=5,
)
results = slicing.analyze(frame_range=range(0, 50))
print(results.mean_angle, results.std_angle)

binning = BinningTrajectoryAnalyzer(
    parser,
    atom_indices=oxygen_ids,
    droplet_geometry="spherical",
)
results_binning = binning.analyze(frame_range=range(0, 200))
print(results_binning.mean_angle, results_binning.std_angle)
```
