Metadata-Version: 2.4
Name: lammps-md-tools
Version: 0.1.0
Summary: Small, dependency-light command-line tools for working with LAMMPS data/trajectory files.
Project-URL: Homepage, https://github.com/hcustc/lammps-md-tools
Project-URL: Repository, https://github.com/hcustc/lammps-md-tools
Author-email: hcustc <huangchen@mail.ustc.edu.cn>
License: MIT License
        
        Copyright (c) 2026 <YOUR NAME>
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: lammps,md,molecular-dynamics
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.9
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == 'dev'
Description-Content-Type: text/markdown

# lammps-md-tools

Small, dependency-light command-line tools for working with **LAMMPS** data/trajectory files.

This project is intentionally tiny:
- minimal dependencies
- deterministic behavior (good for automation/agents)
- clear input/output contracts

## Install / run

### Run without installing (recommended)

Using `uvx` (from Astral's uv):

```bash
uvx --from lammps-md-tools lammps-fix-box --help
```

### Install into an environment

```bash
python -m pip install -U lammps-md-tools
```

## Commands

### `lammps-fix-box`

Rewrite the **box bounds** in a LAMMPS data file to match a cubic box length `L`.

Typical use case: tools that convert `XYZ -> LAMMPS data` may leave default bounds (e.g. `0..100 Å`) that do not match the actual packing box.

```bash
# rewrite bounds to 0..L and wrap atoms into the box
lammps-fix-box --in input.data --out output.boxfix.data --L 60.69 --wrap

# use a different origin (origin..origin+L)
lammps-fix-box --in input.data --out output.data --L 60.69 --origin -30.345
```

**What it does**
- Rewrites header lines like `xlo xhi`, `ylo yhi`, `zlo zhi` to `origin..origin+L`.
- If a `xy xz yz` tilt line is present, it is rewritten to `0 0 0 xy xz yz`.
- If `--wrap` is passed, wraps `x y z` coordinates into `[lo, hi)`.

**Assumptions / limitations**
- Assumes a common LAMMPS data layout with an `Atoms` section containing at least:
  `atom-ID atom-type x y z [extra...]`
- It does not try to interpret/repair bonds, angles, velocities, etc.

## Development

Build (wheel + sdist):

```bash
python -m pip install -U build
python -m build
```

## License

MIT (see `LICENSE`).
