-
Notifications
You must be signed in to change notification settings - Fork 520
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
Fix PT DeepPot
and replace ASE calculator
#3186
Conversation
- Set `deepmd.pt.utils.ase_calc.DPCalculator` as an alias of `deepmd.calculator.DP` - Replace `deepmd_pt` with `deepmd.pt` in `deep_pot.py` - Set pbc in `pt/test_calculator.py` as it requests stress Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
@@ -56,7 +56,7 @@ | |||
|
|||
return super().__new__(DeepPotTF) | |||
elif backend == DPBackend.PyTorch: | |||
from deepmd_pt.infer.deep_eval import DeepPot as DeepPotPT | |||
from deepmd.pt.infer.deep_eval import DeepPot as DeepPotPT |
Check notice
Code scanning / CodeQL
Cyclic import Note
deepmd.pt.infer.deep_eval
I think it's meaningless to calculate stress for a non-periodic system, right? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## devel #3186 +/- ##
==========================================
+ Coverage 74.29% 74.32% +0.02%
==========================================
Files 343 343
Lines 31638 31608 -30
Branches 1592 1592
==========================================
- Hits 23506 23492 -14
+ Misses 7207 7191 -16
Partials 925 925 ☔ View full report in Codecov by Sentry. |
no it does not make sense |
@@ -56,7 +56,7 @@ def __new__(cls, model_file: str, *args, **kwargs): | |||
|
|||
return super().__new__(DeepPotTF) | |||
elif backend == DPBackend.PyTorch: | |||
from deepmd_pt.infer.deep_eval import DeepPot as DeepPotPT | |||
from deepmd.pt.infer.deep_eval import DeepPot as DeepPotPT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may want to check with the pt backend in the UTs of python inference
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add the UT as commented.
deepmd.pt.utils.ase_calc
with deepmd.calculator
DeepPot
and replace ASE calculator
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
deepmd.pt.utils.ase_calc.DPCalculator
as an alias ofdeepmd.calculator.DP
;deepmd_pt
withdeepmd.pt
indeep_pot.py
; fix (atomic) virial output shape ofDeepPot
; add tests for them;pbc
inpt/test_calculator.py
as it requests stress.