Add scale_factor write support for NetCDF writer#3294
Add scale_factor write support for NetCDF writer#3294lilyminium merged 18 commits intoMDAnalysis:developfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #3294 +/- ##
========================================
Coverage 93.69% 93.70%
========================================
Files 177 177
Lines 22959 22990 +31
Branches 3234 3247 +13
========================================
+ Hits 21511 21542 +31
Misses 1397 1397
Partials 51 51
Continue to review full report at Codecov.
|
|
Hello @IAlibay! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2021-08-20 20:06:10 UTC |
|
How odd, I can't replicate this locally, https://github.com/MDAnalysis/mdanalysis/pull/3294/checks?check_run_id=2535134574#step:10:548 |
lilyminium
left a comment
There was a problem hiding this comment.
Waiting on new tests to finish running for diagnostic purposes before addressing those :)
Ok can confirm the issue is with netcdf4. Doesn't crash with scipy's netcdf reader, but fails with netcdf4. |
|
Ok complication number 1:
In So as far as I can tell when we fixed reading (because it's scipy only reading), then we were fine (i.e. auto scaling was off so we just applied scaling ourselves). But with writing, if we write with netcdf4 then it's on, if we write without it then it's off... unless we enforce it to be off.... |
Co-authored-by: Lily Wang <31115101+lilyminium@users.noreply.github.com>
|
So one way to make the NetCDF4 and scipy default behaviours the same is just to enable @tylerjereddy [person most likely to know this] do you happen to have any insights here on a) performance overheads of using numpy masked arrays, b) potential issues in using masked arrays (i.e. can it lead to the unintentional hiding of corrupted netcdf files). |
|
@MDAnalysis/coredevs this is the last thing we definitely promised in 2.0, can we try to get this reviewed/merged as a priority so we can finally release 2.0? |
orbeckst
left a comment
There was a problem hiding this comment.
reviewed first half, looking good so far
orbeckst
left a comment
There was a problem hiding this comment.
This looks sensible to me. Kudos for writing these tests!
I have some minor comments regarding docs — I am missing some knowledge about netcdf details. Assuming that I am somewhat representing an average user here, the question is if the available options should carry warning signs that mere mortals should leave them at defaults. Links to other docs would also be helpful.
As I mentioned in a comment, we should remove a whole bunch of stuff from the API docs for Writers, namely the start, stop, step and dt kwargs/attributes should not be required. That's another issue, though.
Co-authored-by: Oliver Beckstein <orbeckst@gmail.com>
|
That should have address the review comments @orbeckst - let me know what you think @lilyminium do you want to re-review and/or are you ok with your review being dismissed? |
Co-authored-by: Oliver Beckstein <orbeckst@gmail.com>
|
Sorry -- LGTM |
Fixes #2327 completes #3185
I doubt this will make it into the beta release (unless someone feels like reviewing it tonight), but it should make it into the final release as it was a promised changed in 1.1.1.
Changes made in this Pull Request:
scale_factorwriting support to NCDFWriter.scale_factorvalue for velocity writing to 20.455 in order to match the AMBER defaultFrom ambertools' AmberNetdf.F90
For context, here is the AMBER NetCDF convention: http://ambermd.org/netcdf/nctraj.xhtml
PR Checklist