Fix PT DeepPot and replace ASE calculator#3186
Fix PT DeepPot and replace ASE calculator#3186wanghan-iapcm merged 3 commits intodeepmodeling:develfrom
DeepPot and replace ASE calculator#3186Conversation
- 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>
| 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
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 |
| 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.
We may want to check with the pt backend in the UTs of python inference
wanghan-iapcm
left a comment
There was a problem hiding this comment.
please add the UT as commented.
deepmd.pt.utils.ase_calc with deepmd.calculatorDeepPot 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.DPCalculatoras an alias ofdeepmd.calculator.DP;deepmd_ptwithdeepmd.ptindeep_pot.py; fix (atomic) virial output shape ofDeepPot; add tests for them;pbcinpt/test_calculator.pyas it requests stress.