Skip to content
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

Updated LAMMPS dump file topology parser #4995

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

jpkrowe
Copy link

@jpkrowe jpkrowe commented Mar 28, 2025

Fixes #3449

Changes made in this Pull Request:

-This PR allows for greater flexibility when using LAMMPS dump files for topology information, and allows mass, charge and element information to be read from the file if provided.

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--4995.org.readthedocs.build/en/4995/

@jpkrowe jpkrowe changed the title Gsoc lammpsdump Updated LAMMPS dump file topology parser Mar 28, 2025
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.

Copy link

codecov bot commented Mar 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.42%. Comparing base (7fb3534) to head (0a64b73).

Additional details and impacted files
@@            Coverage Diff             @@
##           develop    #4995     +/-   ##
==========================================
  Coverage    93.42%   93.42%             
==========================================
  Files          177      189     +12     
  Lines        21865    22960   +1095     
  Branches      3079     3095     +16     
==========================================
+ Hits         20427    21450   +1023     
- Misses         986     1059     +73     
+ Partials       452      451      -1     

☔ 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.

@jpkrowe
Copy link
Author

jpkrowe commented Mar 28, 2025

I am aware I need to add tests for the new information, but I am slightly unsure how many new dump files is suitable to add to the data folder. I have tested the new additions with files on my own machine but don't want to add more files than necessary

@orbeckst
Copy link
Member

If they are small then adding a few is not really an issue. How many do you want to add?

Are you able to make very minimal examples?

@orbeckst
Copy link
Member

@jaclark5 would you be able to have a look, given your expertise with LAMMPS?

@orbeckst
Copy link
Member

@jpkrowe I'd start with adding ~3 small files. If reviewers find that this too much they'll tell you.

It's also possible to create very small files inline (using StringIO) – so if you can make your examples ~20 lines or less then that's also a neat way to keep tests contained.

Writing good tests is an essential skill and we highly appreciate it when someone puts some thought and effort into it!

@jpkrowe
Copy link
Author

jpkrowe commented Mar 30, 2025

Ok thanks I will make a handful of small examples and add tests for them

@jaclark5
Copy link
Contributor

@jpkrowe looks like a great contribution! Tag me when you've added the tests and I can give it a thorough review.

@jpkrowe
Copy link
Author

jpkrowe commented Mar 31, 2025

@jaclark5 I have now added tests for the additions. Thanks for having a look!

@jaclark5 jaclark5 self-assigned this Mar 31, 2025
@jaclark5
Copy link
Contributor

Hey @jpkrowe thanks for the quick turn around. I'll try to get to this in the next few days.

In the meantime, it looks like there are a few conflicts to be resolved.

Copy link
Contributor

@jaclark5 jaclark5 left a comment

Choose a reason for hiding this comment

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

Looks like a great addition that will improve MDAnalysis handling of LAMMPS dump files. Items I would like to see addressed are:

  • There is one instance of a nested loop that occurs over every atom where unneeded iterations can be avoided.
  • Since elements are being checked and supported, I think the masses can be "guessed" at this stage. It looks like guesser.tables has that information.

Other than that I made some suggestions to reduce redundant code.

@jpkrowe
Copy link
Author

jpkrowe commented Apr 2, 2025

@jaclark5 Thanks for the detailed response. I have added the suggested changes and added tests for them

Copy link
Contributor

@jaclark5 jaclark5 left a comment

Choose a reason for hiding this comment

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

Looks great! There's one check that timed out after 50 min. I profiled your tests locally and they are all running in less than 0.005 seconds for me. @orbeckst what is the protocol for this situation? I ran the CI again with the same result.

@orbeckst
Copy link
Member

orbeckst commented Apr 3, 2025

Try restarting it again. However, I’ve seen these macOS runners timing out on a few PRs. @IAlibay @p-j-smith @yuxuanzhuang as some of the CI team, have you got any insights?

Should we merge PRs even if the macOS-13 runners are not passing due to timeouts?

@jaclark5
Copy link
Contributor

jaclark5 commented Apr 3, 2025

I restarted that runner, we will see what happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow LammpsDumpParser Topology reader more flexibility in coordinate column data.
3 participants