-
Notifications
You must be signed in to change notification settings - Fork 696
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
Drop TRZ reading forces, and change DL_Poly units #2393
Comments
@richardjgowers wrote these readers IIRC. I have no experience with them, but if they specify their formats then we better adhere to them! We might have to issue a warning with these readers for at least one release cycle, saying that they now convert! |
So I hacked in writing ibisco force to the output, so I'm not sure that there's anyone else creating these files... And I can't remember what units these are in. Not sure about the dl poly units, if they are specified we should probably convert? Tbh a better solution would be to keep track of units (maybe even in something like an xarray array) and do conversion properly (peek into astropy and see how they handle it?) |
How can we find out? Are there any docs? Or if this is an MDA extension, then we need to document it here and whatever we say is the rule. Or we drop it.
Yes! — Are there docs for the file formats available somewhere? EDIT: sorry, DL_Poly docs were linked in the post... Most file formats that we encounter come with defined units, so the units are part of the file format definition (the semantics). We should always be able to convert to our unit system and convert back without having to track units. (I imagine that astropy spans much larger length and time scales so it makes sense to be flexible with units.) |
Yeah we can drop TRZ and nobody will likely notice. The DLP stuff looks confusing, section 1.3.7 says those are the internal units, which could well be different to the input/output units... |
Do you mean dropping support for forces in TRZ (because only your own custom code was writing forces)? The IBisCO docs for the II. coordinate file format only mention positions and velocities
so by dropping force support we would simply be implementing the published format. I would be ok with this approach and dropping non-standard features. |
DL_Poly looks complicated. Cited from the manual
It looks as if one can set units pretty freely in the input file (in particular the CONTROL and FIELD (force field) files). However, it does not look as if the output files automatically carry the input file units. From the docs it looks as if the output files have well-defined, fixed units: Here are some things I found
I think we should start by assuming that files are always in the documented DL_POLY units and add a note to the reader/writer stating this explicitly. |
So should DLPoly.ConfigReader and DLPoly.HistoryReader change to convert units when reading in forces? They don't seem to do that at present. |
Yes, I think they should. |
GSOC Contributor InquiryHello! I'm a prospective GSOC contributor hoping to work on this issue. I made the aforementioned edits to add unit conversions for force in the DL_Poly file with
I am relatively new to open source, so any feedback is appreciated! |
@lexi-x can you put up your PR (and mention this issue number in it so that it gets linked)? Looking at code — even incomplete one — is a lot easier than talking about it in the abstract. Once the tests run in GitHub actions, you'll also get a coverage report that shows which parts of your code changes need to be tested. I also should say that this is a fairly old issue and things have been changing. For instance, we are going to drop TRZ support #4311 so we are probably not going to be very concerned with TRZ. For DL_Poly we'll have to look. If you can work with DL_Poly yourself then that would be really useful, I think, because it's not a program that I have any personal experience with. |
@orbeckst Thank you for your response! I just created a draft pull request with what I have so far, I kept the TRZ edits in the pull request just in case but noted for the future that TRZ is not a priority. Meanwhile, I will keep exploring what I can do with DL_Poly. Please let me know any suggestions you have based on the pull request, thank you! |
MDAnalysis is supposed to have force units of kJ/mol.A.
DL_Poly
The DLPoly format seems to work in 10 J/mol.A :
(manual: ftp://ftp.dl.ac.uk/ccp5/DL_POLY/DL_POLY_4.0/DOCUMENTS/USRMAN4.pdf)
Section 1.3.7:
But the ConfigReader and HistoryReader don't appear to convert units.
mdanalysis/package/MDAnalysis/coordinates/DLPoly.py
Lines 114 to 115 in 3e8ea8e
We probably need to change this to
and write according tests.
TRZ (IBIsCO, YASP)
Similarly, IBIsCO trajectories have force units of kJ/mol.nm , but TRZParser doesn't seem to convert units. Edit: From discussion below, force-reading should be dropped. So we should remove considerations of force in the TRZReader, including below:
mdanalysis/package/MDAnalysis/coordinates/TRZ.py
Line 179 in 3e8ea8e
mdanalysis/package/MDAnalysis/coordinates/TRZ.py
Lines 267 to 270 in 3e8ea8e
mdanalysis/package/MDAnalysis/coordinates/TRZ.py
Lines 213 to 223 in 3e8ea8e
The text was updated successfully, but these errors were encountered: