Questions about MDAnalysis H5MD implementation vs. H5MD specification #4559
Replies: 5 comments 1 reply
-
@edisj would be great if you could have a look here! |
Beta Was this translation helpful? Give feedback.
-
Hi @ljwoods2 , I can take a look at this over the weekend. Sorry it's been a little while since I've looked at H5MDReader stuff |
Beta Was this translation helpful? Give feedback.
-
Hey @ljwoods2 , thanks for looking into this. After reviewing the H5MD documentation, I think I agree with all three of your points. Admittedly, when I first wrote I'm going to open two new discussions to focus on each of your points individually, namely: this way, we can have a discussion -> issue -> pull request history for each problem separately, which I think is much cleaner on the development side and easier for code reviewers |
Beta Was this translation helpful? Give feedback.
-
I’d initially just focus on documenting the known limitations and possibly fail explicitly if an unsupported file layout is encountered.
… Am 4/7/24 um 14:05 schrieb edisj ***@***.***>:
I'm going to open two new discussions to focus on each of your points individually
|
Beta Was this translation helpful? Give feedback.
-
Thanks for raising the issue!I assume that Lawson is working on streaming but please talk to each other. Am 4/7/24 um 14:23 schrieb edisj ***@***.***>:
is there anything I should do for this in the immediate future, or is @ljwoods2 on the case?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
After discussing with @orbeckst, it seems like there might be some undocumented limitations with the H5MD implementation, but I'm not 100% sure. I would love some feedback from someone more familiar.
First, reader limitations:
The H5MD spec (https://www.nongnu.org/h5md/h5md.html#particles-group) defines step like this:
From my understanding, this means it should be possible to have an h5md file in which velocities and positions are sampled at different rates for example. However, when I try to test this, using this code:
I don't get what I would intuitively expect. It seems like the resulting trajectory should have 5 frames, and the second and fourth frame should contain velocities. However, this code prints velocity data for the first two frames and then fails on the third frame with
I think the H5MD reader was implemented to only allow files where positions, velocities, and forces were all sampled at the same rate and therefore share the same step and time arrays. Maybe this is documented somewhere already that I'm missing, not sure.
The writer has a similar issue where the self._has dictionary which is used in each write call to decide whether positions, velocities, and forces should be written is set during the first write call and never updated. This means that if the trajectory being written does not have position/velocity/force in the first time step, it won't be written at all. Again, only an issue if the trajectory has different sampling rates.
The H5MD spec allows for multiple subgroups of the 'particles' group:
The reader simply pulls out the first key, however, and I'm not sure this is documented anywhere:
Let me know if I'm missing anything or if I should just make a documentation PR!
Beta Was this translation helpful? Give feedback.
All reactions