Skip to main content

A fast and memory-efficient LAMMPS dump file reader with great developer experience

Project description

LAMMPS Dump Reader

A fast and memory-efficient LAMMPS dump file reader with great developer experience.

Project Charter

Goal: The goal of this project is to develop an open-source Python package that can read LAMMPS dump files into Python for further analysis.

Objectives:

  1. The package will be unopinionated. All dump and dump_modify configurations will be easy to read, and all output data will be treated on equal footing.
  2. The package will be easy to install using pip.
  3. The package will have a good developer experience, including type-hinting and documentation.
  4. The package will be fast and memory-efficient (only one frame will be loaded into memory at a time).

Envisioned usage

There will be two overarching ways to use this package. The most forgiving way would be to use

import dump_reader

# Bring whole dump file into memory
data = dump_reader.read_whole_dump("dump.lammpstrj")

This will bring the entire dump file into memory, so that it can be accessed at any point.

Because dump files may be large, you may not want to bring the whole file into memory at once. In this case, you can use

import dump_reader

timesteps = []
positions = []

# Bring each snapshot in individually
for snapshot in dump_reader.read_dump("dump.lammpstrj"):
    timesteps.append(snapshot["TIMESTEP"])
    positions.append([])

    for atom in snapshot["ATOMS"]:
        if atom["element"] == "Li":
            positions[-1].append([atom["xu"], atom["yu"], atom["zu"]])

You would extract the information needed at the start of the script. read_dump would return an generator object, so that each snapshot is read in only as needed.

Milestones

  1. Implement read_whole_dump.
  2. Implement read_dump using what was learned.
  3. Potentially rewrite read_whole_dump, if performance improvements are expected.
  4. Potentially rewrite the whole package with Rust bindings.

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

undumper-0.0.1.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

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

undumper-0.0.1-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file undumper-0.0.1.tar.gz.

File metadata

  • Download URL: undumper-0.0.1.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-35-generic

File hashes

Hashes for undumper-0.0.1.tar.gz
Algorithm Hash digest
SHA256 5ef3777efb5c0f097ad371b086927f34a2c8f5dcde98e19edbde363ade47112e
MD5 bd3ab000bbf45adef4e423605b0e6638
BLAKE2b-256 a488121bc25a31507ad5c067729c77e16ca28299243087054f81887360e09f4f

See more details on using hashes here.

File details

Details for the file undumper-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: undumper-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-35-generic

File hashes

Hashes for undumper-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a5b3cb50feb2c098d6dc977bdfa2f011df558e0beeb89598adace936653d87cb
MD5 24d1408816d117d1788a277df9d52b97
BLAKE2b-256 1e7b0790d2f9ed8a77af7df81f4abb8cb1c3745e1b2a44c6608b6e9fb7d23698

See more details on using hashes here.

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