-
Notifications
You must be signed in to change notification settings - Fork 713
Update NCDF Reader to read .ncrst Restart Files #5031
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?
Conversation
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.
Hello there first time contributor! Welcome to the MDAnalysis community! We ask that all contributors abide by our Code of Conduct and that first time contributors introduce themselves on GitHub Discussions so we can get to know you. You can learn more about participating here. Please also add yourself to package/AUTHORS
as part of this PR.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #5031 +/- ##
========================================
Coverage 93.62% 93.62%
========================================
Files 177 177
Lines 21995 22004 +9
Branches 3112 3115 +3
========================================
+ Hits 20593 20602 +9
Misses 947 947
Partials 455 455 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Thanks for adding my name. I didn't notice that I hadn't added it! |
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.
Thanks! It all looks good to me.
One thing to note (and perhaps worth documenting) is that coordinates are currently always stored as float32.
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.
Sorry I'm going to block this for further discussion. Restart files really should be treated as SingleFrameReaders and I'm not sure this is the right way to do this (given it breaks the user experience with non NC restart files).
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.
Sorry I'm going to block this for further discussion. Restart files really should be treated as SingleFrameReaders and I'm not sure this is the right way to do this (given it breaks the user experience with non NC restart files).
That's a good point, sorry I missed that!
To avoid code duplication with NCDFReader, I assume a possible solution would be creating a mixin class to store the shared logic of nc
files and have a separate NCRSTReader
that inherits both the mixin class and SingleFrameReader
.
Would that approach align with what you had in mind?
I had a stalled PR a couple years back that attempted to deal with this: https://github.com/MDAnalysis/mdanalysis/pull/3942/files |
Thanks for reviewing this @IAlibay & @yuxuanzhuang! I'll try and incorporate the functionality using
@IAlibay Was there a specific thing you're referring to with the "given it breaks the user experience with non NC restart files" comment? The current logic should be the same for using non-nc restart files (given the difference in file extensions) so I wanted to make sure I understand what you're referring to. |
What I mean here is that we have a specific single frame reader for rst7 files, which is different from the non-netcdf trj file reader. I.e. the user experience is such that we expect a different reader for the restart and trajectory file types. |
Turning this PR into a draft for now, because there is a wide-affecting bug with the |
Fixes #5030
Changes made in this Pull Request:
.ncrst
restart filesncrst
file is readed correctly. The test file I used is created from a .nc file already present in MDAnalysisTestPR Checklist
package/CHANGELOG
file updated?package/AUTHORS
? (If it is not, add it!)Developers Certificate of Origin
I certify that I can submit this code contribution as described in the Developer Certificate of Origin, under the MDAnalysis LICENSE.
📚 Documentation preview 📚: https://mdanalysis--5031.org.readthedocs.build/en/5031/