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

Lammps Dump Parser #3844

Merged
merged 19 commits into from
Oct 26, 2022
Merged

Lammps Dump Parser #3844

merged 19 commits into from
Oct 26, 2022

Conversation

jaclark5
Copy link
Contributor

@jaclark5 jaclark5 commented Sep 21, 2022

Fixes #3843 #3741

Changes made in this Pull Request:

  • Allow box translation upon importing LAMMPS dump file
  • Allows coordinates to be unwrapped with dump file image flags
  • Allows import of velocities and forces from lammps dump file

PR Checklist

  • Tests?
  • Docs?
  • CHANGELOG updated?
  • Issue raised/referenced?

Copy link
Member

@hmacdope hmacdope 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 the contribution @jaclark5! It's looking great so far. See my comments. We will also need some tests with a small imageflag containing testfile. :)

It may also be better to split the imageflag and forces+velocities stuff into separate PRs to avoid this one becoming super crowded but up to you at the end of the day.

package/MDAnalysis/coordinates/LAMMPS.py Outdated Show resolved Hide resolved
package/MDAnalysis/coordinates/LAMMPS.py Outdated Show resolved Hide resolved
package/MDAnalysis/coordinates/LAMMPS.py Outdated Show resolved Hide resolved
package/MDAnalysis/coordinates/LAMMPS.py Outdated Show resolved Hide resolved
package/MDAnalysis/coordinates/LAMMPS.py Outdated Show resolved Hide resolved
package/MDAnalysis/coordinates/LAMMPS.py Outdated Show resolved Hide resolved
package/MDAnalysis/coordinates/LAMMPS.py Outdated Show resolved Hide resolved
package/MDAnalysis/coordinates/LAMMPS.py Outdated Show resolved Hide resolved
Copy link
Member

@hmacdope hmacdope left a comment

Choose a reason for hiding this comment

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

Some more quick comments from a read over.

package/MDAnalysis/coordinates/LAMMPS.py Outdated Show resolved Hide resolved
package/MDAnalysis/coordinates/LAMMPS.py Outdated Show resolved Hide resolved
package/MDAnalysis/coordinates/LAMMPS.py Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Sep 28, 2022

Codecov Report

Base: 94.35% // Head: 94.35% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (db76d0f) compared to base (998a020).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3844   +/-   ##
========================================
  Coverage    94.35%   94.35%           
========================================
  Files          194      194           
  Lines        25031    25062   +31     
  Branches      3374     3390   +16     
========================================
+ Hits         23617    23648   +31     
  Misses        1365     1365           
  Partials        49       49           
Impacted Files Coverage Δ
package/MDAnalysis/coordinates/LAMMPS.py 95.92% <100.00%> (+0.43%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@jaclark5 jaclark5 marked this pull request as ready for review September 29, 2022 12:30
Copy link
Member

@hmacdope hmacdope left a comment

Choose a reason for hiding this comment

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

Few comments :)

package/CHANGELOG Outdated Show resolved Hide resolved
package/MDAnalysis/coordinates/LAMMPS.py Outdated Show resolved Hide resolved
package/MDAnalysis/coordinates/LAMMPS.py Outdated Show resolved Hide resolved
package/MDAnalysis/coordinates/LAMMPS.py Show resolved Hide resolved
coords = coords[:3]
coords += images * ts.dimensions[:3]
else:
raise ValueError("Cannot unwrap coordinates without image flags.")
Copy link
Member

Choose a reason for hiding this comment

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

You will need to add a test that covers this.

@jaclark5 jaclark5 requested a review from hmacdope October 11, 2022 21:15
Copy link
Member

@hmacdope hmacdope left a comment

Choose a reason for hiding this comment

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

Looking good, just a few suggestions.

package/CHANGELOG Outdated Show resolved Hide resolved
package/MDAnalysis/coordinates/LAMMPS.py Outdated Show resolved Hide resolved
package/MDAnalysis/coordinates/LAMMPS.py Outdated Show resolved Hide resolved
package/MDAnalysis/coordinates/LAMMPS.py Outdated Show resolved Hide resolved
package/MDAnalysis/coordinates/LAMMPS.py Outdated Show resolved Hide resolved
@jaclark5 jaclark5 requested a review from hmacdope October 20, 2022 21:18
Copy link
Member

@hmacdope hmacdope left a comment

Choose a reason for hiding this comment

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

Almost there, quick comment and will await some feedback from @PicoCentauri

package/CHANGELOG Outdated Show resolved Hide resolved
package/MDAnalysis/coordinates/LAMMPS.py Show resolved Hide resolved
@orbeckst orbeckst linked an issue Oct 21, 2022 that may be closed by this pull request
Copy link
Member

@hmacdope hmacdope left a comment

Choose a reason for hiding this comment

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

I'm happy with this now. :) Anyone else want to review or shall we go ahead.

Copy link
Member

@IAlibay IAlibay left a comment

Choose a reason for hiding this comment

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

Couple things on my end, mostly pep8

package/MDAnalysis/coordinates/LAMMPS.py Outdated Show resolved Hide resolved
@@ -455,7 +455,7 @@ class DumpReader(base.ReaderBase):
"""Reads the default `LAMMPS dump format`_

Supports coordinates in the LAMMPS "unscaled" (x,y,z), "scaled" (xs,ys,zs),
Copy link
Member

Choose a reason for hiding this comment

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

We really need a Parameters section for this parser, this is too much text for folks to read and understand what's going on.

I'm happy having this be addressed in a follow-up PR, but can an issue be raised please?

testsuite/MDAnalysisTests/coordinates/test_lammps.py Outdated Show resolved Hide resolved
testsuite/MDAnalysisTests/coordinates/test_lammps.py Outdated Show resolved Hide resolved
testsuite/MDAnalysisTests/coordinates/test_lammps.py Outdated Show resolved Hide resolved
testsuite/MDAnalysisTests/coordinates/test_lammps.py Outdated Show resolved Hide resolved
testsuite/MDAnalysisTests/coordinates/test_lammps.py Outdated Show resolved Hide resolved
Copy link
Member

@IAlibay IAlibay left a comment

Choose a reason for hiding this comment

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

lgtm thanks!

@jaclark5
Copy link
Contributor Author

Hmm I thought this was supposed to merge upon approval, do I need to do anything else?

@IAlibay
Copy link
Member

IAlibay commented Oct 26, 2022

Hmm I thought this was supposed to merge upon approval, do I need to do anything else?

I was just waiting on CI, I'll merge now (we don't have merge on approval set up, it's something the coredevs need to discuss at some point I guess)

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.

LAMMPS dump file unwrap trajectory and import velocities and forces
6 participants