lammps-logfile

PyPI Version Python Versions License

High-performance LAMMPS log parsing for the Python ecosystem.

lammps-logfile is a robust Python library designed to simplify the extraction and analysis of thermodynamic data from LAMMPS simulations. It transforms complex log files into clean, analysis-ready Pandas DataFrames in a single line of code.

Key Features

Pandas Native

Direct conversion to DataFrames for instant plotting and analysis.

Robust Parsing

Handles interrupted simulations and changing headers gracefully.

High Performance

Optimized C-engine parsing for multi-gigabyte log files.

30-Second Quickstart

Get started immediately:

import lammps_logfile
import matplotlib.pyplot as plt

# Load data with a single line
data = lammps_logfile.read_log("log.lammps")

# Access thermodynamic properties directly as a DataFrame
plt.plot(data["Step"], data["Temp"])
plt.xlabel("Step")
plt.ylabel("Temperature (K)")
plt.show()
Plot generated by lammps-logfile

Command Line Interface

lammps-logfile also comes with a CLI for quick plotting:

lammps_logplotter log.lammps -x Step -y Temp