{"id":46996085,"url":"https://github.com/pyiron/lammpsparser","last_synced_at":"2026-03-11T15:17:24.504Z","repository":{"id":97845938,"uuid":"607456614","full_name":"pyiron/lammpsparser","owner":"pyiron","description":"Parser for LAMMPS input and output files. ","archived":false,"fork":false,"pushed_at":"2026-03-02T20:08:27.000Z","size":1776,"stargazers_count":3,"open_issues_count":5,"forks_count":5,"subscribers_count":7,"default_branch":"main","last_synced_at":"2026-03-02T23:36:55.821Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pyiron.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-02-28T02:11:46.000Z","updated_at":"2026-03-02T20:08:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"add77b6c-ea22-4c26-8943-355a8124825d","html_url":"https://github.com/pyiron/lammpsparser","commit_stats":null,"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"purl":"pkg:github/pyiron/lammpsparser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyiron%2Flammpsparser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyiron%2Flammpsparser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyiron%2Flammpsparser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyiron%2Flammpsparser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pyiron","download_url":"https://codeload.github.com/pyiron/lammpsparser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyiron%2Flammpsparser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30385497,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T14:10:17.325Z","status":"ssl_error","status_checked_at":"2026-03-11T14:09:37.934Z","response_time":84,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-03-11T15:17:23.659Z","updated_at":"2026-03-11T15:17:24.496Z","avatar_url":"https://github.com/pyiron.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lammpsparser\n\n[![Pipeline](https://github.com/pyiron/lammpsparser/actions/workflows/pipeline.yml/badge.svg)](https://github.com/pyiron/lammpsparser/actions/workflows/pipeline.yml)\n[![codecov](https://codecov.io/gh/pyiron/lammpsparser/graph/badge.svg?token=OeZVIJ9vyW)](https://codecov.io/gh/pyiron/lammpsparser)\n[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/pyiron/lammpsparser/main?urlpath=%2Fdoc%2Ftree%2Fnotebooks%2Fexample.ipynb)\n\nThe `lammpsparser` packages provides primarily two functions. A `write_lammps_structure()` function to write an `ase.atoms.Atoms`\nstructure to an LAMMPS data file and a `parse_lammps_output_files()` function to parse the `log.lammps`, `dump.out` and\n`dump.h5` files from the LAMMPS `thermo` and `dump` commands. \n\n## Installation \nThe `lammpsparser` package is distributed via both [pypi](https://pypi.org/project/lammpsparser/):\n```\npip install lammpsparser\n```\nand [conda-forge](https://anaconda.org/conda-forge/lammpsparser):\n```\nconda install -c conda-forge lammpsparser\n```\n\n## Write LAMMPS structure \nThe `write_lammps_structure()` function is designed to write an `ase.atoms.Atoms` structure to an LAMMPS data file:\n```python\nfrom lammpsparser import write_lammps_structure\n\nwrite_lammps_structure(\n    structure,\n    potential_elements,\n    units=\"metal\",\n    file_name=\"lammps.data\",\n    working_directory=None,\n)\n```\nThe `structure` parameter refers to the `ase.atoms.Atoms` structure and the `potential_elements` refers to the list of \nelements implemented in the specific interatomic potential. For example the [NiAlH_jea.eam.alloy](https://github.com/lammps/lammps/blob/develop/potentials/NiAlH_jea.eam.alloy)\npotential implements the elements `Ni`, `Al` and `H`, so when writing a structure for a simulation with this potential \nthe `potential_elements=[\"Ni\", \"Al\", \"H\"]`. It is important to maintain the order of the elements as LAMMPS internally \nreferences the elements based on their index, starting from one. The `units` parameter refers to the LAMMPS internal \n[units](https://docs.lammps.org/units.html) to convert the `ase.atoms.Atoms` object which is defined in Angstrom to the \nlength scale of the LAMMPS simulation. Finally, `file_name` parameter and the current working directory `working_directory` \nparameter are designed to select the location where the LAMMPS structure should be written. With the default parameters \nthe LAMMPS structure is written in the `lammps.data` file in the current directory. \n\n## Parse LAMMPS output\nIn addition to writing the LAMMPS input structure `lammpsparser` also provide the `parse_lammps_output_files()` function\nto parse the LAMMPS output files, namely the `log.lammps`, `dump.out` and `dump.h5` files:\n```python\nfrom lammpsparser import parse_lammps_output_files\n\nparse_lammps_output_files(\n    working_directory,\n    structure,\n    potential_elements,\n    units=\"metal\",\n    dump_h5_file_name=\"dump.h5\",\n    dump_out_file_name=\"dump.out\",\n    log_lammps_file_name=\"log.lammps\",\n)\n```\nIn analogy to the `write_lammps_structure()` function the `working_directory` parameter refers to the directory which \ncontains the output files. The `structure` parameter reefers to the `ase.atoms.Atoms` object which should be used as \ntemplate to parse the structure from the dump files. This structure is again required as LAMMPS internally references \nelements only by an index, so the template structure is required to map the elements from the interatomic potential back\nto the elements of the `ase.atoms.Atoms` object. In the same way the `potential_elements` refers to the list of \nelements implemented in the specific interatomic potential. The `units` parameter refers to the LAMMPS internal \n[units](https://docs.lammps.org/units.html) to convert the `ase.atoms.Atoms` object which is defined in Angstrom to the \nlength scale of the LAMMPS simulation. Finally, the parameters `dump_h5_file_name`, `dump_out_file_name` and `log_lammps_file_name`\nrefer to the output file names. \n\nFor the `dump.out` file the following LAMMPS `dump` command should be added to the LAMMPS input file:\n```\ndump 1 all custom 100 dump.out id type xsu ysu zsu fx fy fz vx vy vz\ndump_modify 1 sort id format line \"%d %d %20.15g %20.15g %20.15g %20.15g %20.15g %20.15g %20.15g %20.15g %20.15g\"\n```\n\nFor the `log.lammps` file the following LAMMPS `thermo` command should be added to the LAMMPS input file:\n```\nthermo_style custom step temp pe etotal pxx pxy pxz pyy pyz pzz vol\nthermo_modify format float %20.15g\nthermo 100\n```\n\n## Usage \nCurrently, the `lammpsparser` parser is primarily used in the [pyiron_atomistics](https://github.com/pyiron/pyiron_atomistics) \npackage and its successor the [atomistics](https://github.com/pyiron/atomistics) package to provide a simple LAMMPS \nparser. It only depends on `ase`, `numpy`, `pandas` and `scipy` and has an optional dependency on `h5py` to parse the \nLAMMPS [h5md](https://docs.lammps.org/dump_h5md.html) format. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyiron%2Flammpsparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpyiron%2Flammpsparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyiron%2Flammpsparser/lists"}