-
Notifications
You must be signed in to change notification settings - Fork 832
BUG: use base units for TPR x/v parsing #5374
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -127,8 +127,10 @@ def _read_first_frame(self): | |
| self.ts._pos = np.asarray( | ||
| tpr_utils.ndo_rvec(data, th.natoms), dtype=np.float32 | ||
| ) | ||
| self.convert_pos_from_native(self.ts._pos) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you need to wrap it around
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I noticed that. However, its use does need motivating with a regression test that fails without it, which wasn't immediately obvious to me since we don't write TPR files.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, but farther down it has: if self.convert_units:
# Convert back to nm from Angstroms,
# Not inplace because AtomGroup is not a copy
positions = self.convert_pos_to_native(positions, inplace=False)so while the default behavior makes sense, the docs are garbled--basically wrong, right? Should it even be "allowed" to write with A units for GRO?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm so sorry, I've been staring at this for a while and I just can't seem to think this one through. What do you recommend doing here? I am under the impression that the self.convert_units bits are part of the base reader class API - is this correct?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think my point was just that For this PR, I believe you have a point that I should conform to the option of reading in either A or nm units, and add a test for that for |
||
| if th.bV: | ||
| self.ts.velocities = np.asarray( | ||
| tpr_utils.ndo_rvec(data, th.natoms), dtype=np.float32 | ||
| ) | ||
| self.convert_velocities_from_native(self.ts.velocities) | ||
| self.ts.has_velocities = True | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we know if dimensions setting also needs fixing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the latest version of this feature branch,
produces:
That looks like more like a feature request than the same category of bug, so scope might be argued. I'd probably suggest a separate issue for that one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds good - I was mostly just looking at other single file readers and checking what they were doing. If we don't have to, that works.