Skip to content

fix: standardize the deepmd/npy/mixed format#425

Merged
wanghan-iapcm merged 5 commits intodeepmodeling:develfrom
iProzd:fix_return
Feb 25, 2023
Merged

fix: standardize the deepmd/npy/mixed format#425
wanghan-iapcm merged 5 commits intodeepmodeling:develfrom
iProzd:fix_return

Conversation

@iProzd
Copy link
Collaborator

@iProzd iProzd commented Feb 24, 2023

This PR has concated two commits together:

  1. Update the dpdata.MultiSystems() when from_deepmd_npy_mixed method is called;

dpdata.MultiSystems().from_deepmd_npy_mixed only returned the results before but did not change itself, which is fixed in this commit, to be consistent with other from methods.
(another bug is also fixed: not using .copy() in data["atom_names"] may cause error when manually changing type_map for this system. UTs are added in the next commit.)

  1. Allow multiple sets in mixed-type format;

Now for maximum 50000 frames in one sys and 2000 frames in one set.
The reason I did not use 5000 frames per set, is that I think maximum set frames will be much more often used in mixed-type format than other format, and 2000 will be enough for large batch and more friendly for memory.

Add UTs for type_map changing and mixed_type dir check.

…_npy_mixed

dpdata.MultiSystems().from_deepmd_npy_mixed only returned the results but did not change itself, which is fixed in this PR, to be consistent with other from methods.
(another bug is also fixed: not using .copy() in data["atom_names"] may cause error when manually changing type_map for this system.)
@wanghan-iapcm wanghan-iapcm changed the title Fix no change in self after calling dpdata.MultiSystems().from_deepmd… fix: update dpdata.MultiSystems() when the method from_deepmd_npy_mixed is called Feb 24, 2023
Copy link
Contributor

@wanghan-iapcm wanghan-iapcm left a comment

Choose a reason for hiding this comment

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

Please add the UTs that can detect the two fixed bugs.

iProzd and others added 2 commits February 25, 2023 01:20
1. Allow multiple sets in mixed-type format.
(Now for maximum 50000 frames in one sys and 2000 frames in one set.)
(I did not use 5000 frames per set because I think maximum set number will be much more often used in mixed-type format than other format, and 2000 will be enough for large batch and more friendly for memory)
2. Add UTs for type_map changing and mixed_type dir check.
@iProzd iProzd changed the title fix: update dpdata.MultiSystems() when the method from_deepmd_npy_mixed is called fix: standardize the deepmd/npy/mixed format Feb 24, 2023
@codecov-commenter
Copy link

codecov-commenter commented Feb 24, 2023

Codecov Report

Base: 82.35% // Head: 82.51% // Increases project coverage by +0.15% 🎉

Coverage data is based on head (2916495) compared to base (aec7747).
Patch coverage: 91.95% of modified lines in pull request are covered.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##            devel     #425      +/-   ##
==========================================
+ Coverage   82.35%   82.51%   +0.15%     
==========================================
  Files          68       68              
  Lines        6182     6198      +16     
==========================================
+ Hits         5091     5114      +23     
+ Misses       1091     1084       -7     
Impacted Files Coverage Δ
dpdata/system.py 85.42% <75.00%> (+0.02%) ⬆️
dpdata/deepmd/mixed.py 85.40% <92.00%> (+5.28%) ⬆️
dpdata/format.py 88.33% <100.00%> (ø)
dpdata/plugins/deepmd.py 67.47% <100.00%> (+0.26%) ⬆️

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.

@iProzd iProzd requested a review from wanghan-iapcm February 24, 2023 17:33
iProzd and others added 2 commits February 25, 2023 22:02
…tom_numbs'

Merge frames with the same natoms into one single system with name 'atom_numbs'
Support auto walk in directory for mixed_type when dpdata.multisystem().from_deepmd_npy_mixed is called.
@iProzd iProzd requested a review from wanghan-iapcm February 25, 2023 14:05
@wanghan-iapcm wanghan-iapcm enabled auto-merge (squash) February 25, 2023 14:27
@wanghan-iapcm wanghan-iapcm merged commit 06c21b6 into deepmodeling:devel Feb 25, 2023
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.

3 participants