Skip to content

Added dt support for xtc and trr trajectories.#4908

Merged
orbeckst merged 27 commits intoMDAnalysis:developfrom
pbuslaev:develop
Apr 15, 2025
Merged

Added dt support for xtc and trr trajectories.#4908
orbeckst merged 27 commits intoMDAnalysis:developfrom
pbuslaev:develop

Conversation

@pbuslaev
Copy link
Contributor

@pbuslaev pbuslaev commented Feb 10, 2025

Fixes #4905

Changes made in this Pull Request:

  • I added basic dt support for XTC and XDR Reader/Writer

PR Checklist

  • Issue raised/referenced?
  • Tests updated/added?
  • Documentation updated/added?
  • package/CHANGELOG file updated?
  • Is your name in 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--4908.org.readthedocs.build/en/4908/

Copy link

@github-actions github-actions bot left a 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
Copy link

codecov bot commented Feb 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.61%. Comparing base (4cca1d8) to head (af821f7).
Report is 18 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #4908   +/-   ##
========================================
  Coverage    93.61%   93.61%           
========================================
  Files          177      177           
  Lines        21894    21907   +13     
  Branches      3095     3100    +5     
========================================
+ Hits         20495    20508   +13     
  Misses         946      946           
  Partials       453      453           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@orbeckst orbeckst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this is looking pretty solid. Please see comments below. Could you please address them?

@orbeckst orbeckst changed the title draft: Added dt support for xtc and trr trajectories. Added dt support for xtc and trr trajectories. Mar 13, 2025
@orbeckst
Copy link
Member

@pbuslaev please resolve conflicts. Ping when you've addressed comments and then I'll have a look again. Please don't resolve comments — I'll do that when I review again. Thanks.

@pbuslaev
Copy link
Contributor Author

pbuslaev commented Apr 1, 2025

@orbeckst I think all should be addressed now.

Copy link
Member

@orbeckst orbeckst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your changes overall look good and I only have minor comments.

However, all the tests fail. Please check where your code broke them.

@pbuslaev
Copy link
Contributor Author

pbuslaev commented Apr 3, 2025

Hi @orbeckst

As I mentioned before

Ok, I now remember why, I had to add this. Without dt option, tests were breaking.

For instance this test starts failing, because dt is set for the writer. So there are two choices, as I see it:

Leave this option and document it
Modify failing tests
(?) maybe there is some more complex logics that can be implemented
@orbeckst I can take either approach, but I think it is up to you to decide what is better.

So here I am waiting for your input

- removed XTC test in the DCD tests for setting dt in the writer
- ensure that dt is actually only changed when writing
@orbeckst
Copy link
Member

I changed the test. These tests are old code and it makes little sense that we are testing XTC together with DCD.

Furthermore, the test did not even test the XTCWriter properly: we had set dt on reading, presumably because that was the only way to make it pass for the XTCWriter, but then setting dt on writing did not do anything else. Only with your addition is the XTCWriter now able to use dt, and you test this functionality elsewhere.

Do not explicitly set dt for the Writer. (In the past, this did not
do anything for TRR but with this new change it forces the
recalculation of times and that introduces inaccuracies at rtol=1e-6. The test does not really check dt so no need to set it.
@orbeckst
Copy link
Member

Let's see if these changes to the tests make the tests more robust. I note that we seem to have been assuming in the past that setting dt for XTC and TRR worked, even though it did not.

@orbeckst
Copy link
Member

@pbuslaev I think the tests are now passing. Could you please address the small doc issues and then it looks ready for merging.

@orbeckst orbeckst enabled auto-merge (squash) April 11, 2025 05:12
@orbeckst
Copy link
Member

(I enabled auto-merge, i.e., the PR will get merged as soon as tests pass and the PR is approved.)

auto-merge was automatically disabled April 15, 2025 12:56

Head branch was pushed to by a user without write access

@pbuslaev
Copy link
Contributor Author

@orbeckst I think I have addressed all the comments. The tests are passing and docs are rendered correctly.

Copy link
Member

@orbeckst orbeckst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing all my comments.

Once the CI passes again, we can merge.

Thank you for your first contribution @pbuslaev !

@pbuslaev
Copy link
Contributor Author

Thank you for your help and review @orbeckst

@orbeckst orbeckst merged commit 089f49e into MDAnalysis:develop Apr 15, 2025
23 of 24 checks passed
@orbeckst
Copy link
Member

Hooray, your first PR is merged 🎉 ! Thank you for all your work. I hope we see more contributions from you in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add time step parameter to XTC Writers and Readers

3 participants

Comments