-
Notifications
You must be signed in to change notification settings - Fork 667
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
Add scale_factor write support for NetCDF writer #3294
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 |
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.
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? |
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.
reviewed first half, looking good so far
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.
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? |
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.
The 65 bit -> 64 bit fix still needs to be added. @IAlibay you can use my suggestion or do it yourself. I won't hold up proceedings. Thanks for addressing my comments.
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_factor
writing support to NCDFWriter.scale_factor
value 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