Skip to content

add unwrap support for lammps dump#339

Merged
wanghan-iapcm merged 6 commits intodeepmodeling:develfrom
zezhong-zhang:master
Aug 17, 2022
Merged

add unwrap support for lammps dump#339
wanghan-iapcm merged 6 commits intodeepmodeling:develfrom
zezhong-zhang:master

Conversation

@zezhong-zhang
Copy link
Contributor

@zezhong-zhang zezhong-zhang commented Aug 9, 2022

Issue:

When use "xu yu zu" in lammps dump, user usually would expect to have unwrap coordinates but currently all the data will be wrapped at the cell box with

return (posis % 1) @ cell

This will affect the displacement analysis, i.e. Debye-Waller factor calculation.

Solution:

Make unwrap lammps coordinates flag dependent.

@codecov-commenter
Copy link

codecov-commenter commented Aug 10, 2022

Codecov Report

Merging #339 (4a0c73d) into master (0db9246) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #339      +/-   ##
==========================================
+ Coverage   82.15%   82.18%   +0.02%     
==========================================
  Files          66       66              
  Lines        5784     5793       +9     
==========================================
+ Hits         4752     4761       +9     
  Misses       1032     1032              
Impacted Files Coverage Δ
dpdata/lammps/dump.py 90.32% <100.00%> (+0.49%) ⬆️
dpdata/plugins/lammps.py 100.00% <100.00%> (ø)

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

@zezhong-zhang zezhong-zhang changed the title add unwarp support for lammps dump add unwrap support for lammps dump Aug 10, 2022
sys.path.append(lib_path)
import lmp
import warnings
warnings.simplefilter('once', UserWarning)
Copy link
Member

Choose a reason for hiding this comment

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

You can define a class derivated from UserWarning, i.e.

class SomeWarning(UserWarning):
    pass

and throw warnings with that class

warnings.warn('some warning', category=SomeWarning)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added.

@wanghan-iapcm wanghan-iapcm changed the base branch from master to devel August 17, 2022 01:00
@wanghan-iapcm wanghan-iapcm merged commit da48136 into deepmodeling:devel Aug 17, 2022
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.

4 participants