-
Notifications
You must be signed in to change notification settings - Fork 638
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
H5MD
Can not read observables/<group>/<observable>/...
#4598
Comments
yes, this is related to point 1) in #4561 basically, At the moment, |
the same thing is happening in #4320 |
@PythonFZ how would you expect MDAnalysis to support groups, i.e., what exactly should be happening? |
I could reproduce with import MDAnalysis as mda
import numpy as np
u = mda.Universe.empty(100, n_residues=100, atom_resindex=np.arange(100), trajectory=True)
u.load_new("licl_100.h5", format="H5MD", convert_units=False) and failed with
If this is an otherwise legal H5MD file then we should be able to at least read the particles information, even if we ignore observables. So this may count as a bug in our H5MD reader and I tentatively assign the defect label. However, I tried reading
and note that @PythonFZ 's H5MD file cannot be loaded by pyh5md, presumably because it is missing the mandatory h5md root level group (see https://www.nongnu.org/h5md/h5md.html#h5md-root-level ). I don't have time to dissect the h5 file further so could you please comment and demonstrate that the test file does indeed fully conform to the spec? |
that's interesting... should our implementation also fail immediately if the root h5md group is missing? |
yes — it's mandatory |
Expected behavior
The H5MD standard defines two main ways to define observables. Either directly as group below the root
observables
or as a group specific observableobservables/group
.Both should be supported.
Actual behavior
In my experience only the observables after root are supported but
observables/group
are not. It leads toKeyError: "Unable to synchronously open object (object 'value' doesn't exist)"
. This seems to be briefly discussed in #4320 but I wanted to give more information here.Code to reproduce the behavior
I've attached a file licl_100.h5.zip because the
cobrotoxin.h5md
test file only containsobservables/lambda
but no group specific observables.Current version of MDAnalysis
python -c "import MDAnalysis as mda; print(mda.__version__)"
) 2.7.0python -V
)? 3.10.9The text was updated successfully, but these errors were encountered: