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

allow loading either nsel or natoms atomic tensor data #3394

Merged
merged 5 commits into from
Mar 3, 2024

Conversation

njzjz
Copy link
Member

@njzjz njzjz commented Mar 2, 2024

A new parameter, output_natoms_for_type_sel, is added for the data requirement. (default=false)
If sel_types is given, output_natoms_for_type_sel is true, and the data dimension is nsel, it will be converted to natoms.
If sel_types is given, output_natoms_for_type_sel is false, and the data dimension is natoms, it will be converted to nsel.
In other situations, it keeps the original shape.
The user can give data in either nsel or natoms, if sel_types and output_natoms_for_type_sel are set.

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
A new parameter "output_natoms_for_type_sel" is added. (default=false)
If sel_types is given, output_natoms_for_type_sel is true, and the data dimesion is nsel, it will be converted to natoms.
If sel_types is given, output_natoms_for_type_sel is false, and the data dimesion is natoms, it will be converted to nsel.
In other situations, it keeps the original shape.

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
ndof = ndof_ * natoms
else:
ndof = ndof_
natoms_sel = 0
idx_map_sel = None

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable idx_map_sel is not used.
Copy link

codecov bot commented Mar 2, 2024

Codecov Report

Attention: Patch coverage is 93.33333% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 76.61%. Comparing base (59d3b12) to head (8636dc1).
Report is 1 commits behind head on devel.

Files Patch % Lines
deepmd/utils/data.py 93.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            devel    #3394      +/-   ##
==========================================
+ Coverage   76.59%   76.61%   +0.01%     
==========================================
  Files         420      420              
  Lines       35754    35780      +26     
  Branches     1620     1616       -4     
==========================================
+ Hits        27387    27412      +25     
- Misses       7499     7500       +1     
  Partials      868      868              

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

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
@wanghan-iapcm wanghan-iapcm added this pull request to the merge queue Mar 3, 2024
@njzjz njzjz removed this pull request from the merge queue due to a manual request Mar 3, 2024
@njzjz njzjz added this pull request to the merge queue Mar 3, 2024
@njzjz njzjz removed this pull request from the merge queue due to a manual request Mar 3, 2024
@njzjz njzjz merged commit 9c508b7 into deepmodeling:devel Mar 3, 2024
48 checks passed
@njzjz njzjz deleted the convert-nsel branch March 3, 2024 09:19
@njzjz njzjz mentioned this pull request Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants