Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read default LAMMPS H5MD file out of the box due to lack of units tag #4722

Open
hmacdope opened this issue Oct 1, 2024 · 2 comments
Labels

Comments

@hmacdope
Copy link
Member

hmacdope commented Oct 1, 2024

Expected behavior

We are not necessarily doing anything wrong, but just notifying people that we cannot read H5MD files produced by LAMMPS out of the box. LAMMPS does not use the units tag in the H5MD spec, meaning you must specify convert_units=False

Code to reproduce the behaviour

Have the following in LAMMPS input file

write_data system.data
dump h5md1 all h5md 100 dump.h5md position velocity force
import MDAnalysis as mda
u = mda.Universe("system.data", "dump.h5md", atom_style='id type x y z', convert_units=True)

whereas the below will work,

import MDAnalysis as mda
u = mda.Universe("system.data", "dump.h5md", atom_style='id type x y z', convert_units=False)

The resulting system will have units of whatever LAMMPS unit style you chose.

Current version of MDAnalysis

2.8.0dev0

@orbeckst orbeckst added Component-Readers format-LAMMPS Format-H5MD hdf5-based H5MD trajectory format labels Oct 21, 2024
@orbeckst
Copy link
Member

Good to know, perhaps we should just mention it in the docs for any LAMMPS users. We could also make the error message be clearer.

Reading through the H5MD Units spec

The datasets of any H5MD element that have a physical dimension may carry an attribute unit to indicate the physical unit of the respective data.

it is a may so LAMMPS is adhering to the standard.

@orbeckst
Copy link
Member

I am labeling this failure as a defect because LAMMPS adheres to the H5MD standard and we should be able to read standard-compliant H5MD files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants