fix(abacus): fix bug in read LATTICE_CONSTANT in md#450
fix(abacus): fix bug in read LATTICE_CONSTANT in md#450wanghan-iapcm merged 6 commits intodeepmodeling:develfrom
Conversation
for more information, see https://pre-commit.ci
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## devel #450 +/- ##
==========================================
+ Coverage 82.49% 82.55% +0.05%
==========================================
Files 68 68
Lines 6193 6196 +3
==========================================
+ Hits 5109 5115 +6
+ Misses 1084 1081 -3
... and 1 file with indirect coverage changes 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 in Codecov by Sentry. |
|
@njzjz fix the bug in reading lattice constant and coordinate, and add unittest for new version. |
for more information, see https://pre-commit.ci
dpdata/abacus/md.py
Outdated
| """abacus version >=3.1.4: | ||
| MDSTEP: 0 | ||
| LATTICE_CONSTANT: 12.411200939060 Angstrom | ||
| LATTICE_VECTORS | ||
| 1.000000000000 0.000000000000 0.000000000000 | ||
| 0.000000000000 1.000000000000 0.000000000000 | ||
| 0.000000000000 0.000000000000 1.000000000000 | ||
| VIRIAL (kbar) | ||
| 36.689617311101 0.000000000003 -0.000000000000 | ||
| 0.000000000003 36.689617311089 -0.000000000001 | ||
| -0.000000000000 -0.000000000001 36.689617311135 | ||
| INDEX LABEL POSITION (Angstrom) FORCE (eV/Angstrom) VELOCITY (Angstrom/fs) | ||
| 0 Sn 0.000000000000 0.000000000000 0.000000000000 -0.000000000000 -0.000000000001 -0.000000000001 0.001244557166 -0.000346684288 0.000768457739 | ||
| 1 Sn 0.000000000000 3.102800034079 3.102800034079 -0.000186795145 -0.000453823768 -0.000453823768 0.000550996187 -0.000886442775 0.001579501983. | ||
|
|
||
| abacus version < 3.1.4: | ||
| MDSTEP: 0 | ||
| LATTICE_CONSTANT: 23.453780000000 | ||
| LATTICE_VECTORS | ||
| 1.000000000000 0.000000000000 0.000000000000 | ||
| 0.000000000000 1.000000000000 0.000000000000 | ||
| 0.000000000000 0.000000000000 1.000000000000 | ||
| VIRIAL (KBAR) | ||
| 36.689617311101 0.000000000003 -0.000000000000 | ||
| 0.000000000003 36.689617311089 -0.000000000001 | ||
| -0.000000000000 -0.000000000001 36.689617311135 | ||
| INDEX LABEL POSITIONS FORCE (eV/Angstrom) | ||
| 0 Sn 0.000000000000 0.000000000000 0.000000000000 -0.000000000000 -0.000000000001 -0.000000000001 | ||
| 1 Sn 0.000000000000 0.250000000000 0.250000000000 -0.000186795145 -0.000453823768 -0.000453823768 | ||
| """ |
There was a problem hiding this comment.
We follow numpydoc to use docstring as documentation. Please do not leave raw data in the docstring.
There was a problem hiding this comment.
Ok, it is removed.
Signed-off-by: pxlxingliang <91927439+pxlxingliang@users.noreply.github.com>
|
@pxlxingliang Is this patch compatible with the version older than 3.1.4? |
|
Yes,it is compatible
|
|
@njzjz @wanghan-iapcm,please help check this PR. If there is no problem, please help merge it as soon as possible. This bug has a significant effect on the using of dpdata+ABACUS. Besides, I hope a new version to be relased after this PR is merged. |
In ABACUS version >= v3.1.4, the format of file "MD_dump" is different. The lattice constant line is added by the unit "Angstrom" at the end, and the position is the real cartesian coordinate.
MD_dump is changed from
to