Fixes velocity units and adds support for scale_factors in NCDFReader#2326
Fixes velocity units and adds support for scale_factors in NCDFReader#2326orbeckst merged 14 commits intoMDAnalysis:developfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #2326 +/- ##
===========================================
+ Coverage 89.82% 89.88% +0.06%
===========================================
Files 173 173
Lines 21711 21767 +56
Branches 2846 2857 +11
===========================================
+ Hits 19502 19566 +64
+ Misses 1615 1609 -6
+ Partials 594 592 -2
Continue to review full report at Codecov.
|
|
@IAlibay thanks fore the detailed analysis:
Which convention do you refer to? AMBER or NetCDF? Can you link to what you're referring to? In principle we should implement whatever the specs for the file format state. IIRC the AMBER NetCDF specs are actually pretty thorough (unlike the mess that "DCD" is). What do they say? EDIT: see comments in review (read both until 1.0, auto-correct, issue deprecation warning for auto-correct degrees)
Sounds sensible to me, especially once we properly support Such changes need to be properly advertised
|
orbeckst
left a comment
There was a problem hiding this comment.
Nice work, I appreciate your attention to the detail of the format and the thoughts that you put into testing.
In addition to your broader questions (see #2326 (comment)) please consider the comments inline. Thanks!
|
Thanks for reviewing @orbeckst So with regards to changing the NCDFWriter behaviour, I was thinking it might make sense to address this in a separate PR, if you think it's appropriate? My rationale was mainly that it addresses a different feature change to what was mentioned in issue #2323.
Just for reference, my "degrees" -> "degree" coment was based on http://ambermd.org/netcdf/nctraj.xhtml Section 6.2:
So with regards to the writer, do we want to implement a single writing format, i.e. no scale_factors for everything but The latter case definitely offers more user freedom, albeit at the cost of a lot more complexity. Although, honestly can't think of a normal use case for it. In my experience AMBER style NetCDF files generally just adhere to whatever format the MD engines write in (note: I think those generated by Yank might be different, but I'm not sure). |
|
We can address the Writer in a separate PR – can you open an issue and add a comment to the code with a TODO to reference the issue? Just in case @richardjgowers creates 0.20.0 before the other PR is done...
That seems the best approach, especially if velocities gets the scale_factor. If scale_factor are supported for all dimensions then let's support them if we can. |
|
@orbeckst Looks like Travis is failing in the MacOS py3.6 build. I think I have it narrowed down to the recent release of pytest 5.1.0. Looks like the explicit kwargs handling was changed: pytest-dev/pytest@683b263 The other builds aren't pip-installing pytest, so they are still using the older 5.0.1 version of pytest. I'll raise an issue on this. Fixed in #2330 |
|
All looking good to me, let's wait for green CI. Feel free to ping me when you think it's ready for a squash-merge. |
|
@orbeckst Travis is failing on the py2.7 MacOS build for I'm not sure if this is common? I could try to re-start Travis by closing/re-opening the PR if you think it might help? |
|
This does not look like something related to this PR and in principle I'd be happy to merge. However, I just restarted Job #1176.10 and I expect it come back as passing, in which case we can all be happy and merge. |
|
Thanks @IAlibay ! |
Fixes #2323
Changes made in this Pull Request:
scale_factorin all AMBER NetCDF convention variablesscale_factorvalues, set in NCDFReader__init__and multiplied through in_read_frame._NCDFGeneratorclass oftest_netcdf.pyQuestions/Issues:
degreesunits forcell_anglesinstead of the NetCDF conventiondegree(singular). I have kept support for the plural version, however, should we be thinking about changing the writer to using the singular version so that we properly adhere to the convention?scale_factorvalues. However, as far as I can tell all AMBER MD engines instead write out velocities with ascale_factorof 20.455 and the actual values in Angstrom/AKMA time units. Whilst this shouldn't be a problem for readers that properly implement the AMBER NetCDF convention, I have a suspicion that isn't actually the case for a lot of other tools/libraries. Would it be worth being more prudent by altering writing so that it matches the AMBER MD engines?PR Checklist