Skip to content

Commit

Permalink
Merge branch 'devel' into feat/set-force-label-optional
Browse files Browse the repository at this point in the history
  • Loading branch information
anyangml authored Jan 13, 2025
2 parents 2fcbf45 + 2905792 commit 9a58fd4
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ repos:
# Python
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.8.4
rev: v0.8.6
hooks:
- id: ruff
args: ["--fix"]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

## Installation

DP-GEN only supports Python 3.7 and above. You can [setup a conda/pip environment](https://docs.deepmodeling.com/faq/conda.html), and then use one of the following methods to install DP-GEN:
dpdata only supports Python 3.7 and above. You can [setup a conda/pip environment](https://docs.deepmodeling.com/faq/conda.html), and then use one of the following methods to install dpdata:

- Install via pip: `pip install dpdata`
- Install via conda: `conda install -c conda-forge dpdata`
Expand Down
10 changes: 5 additions & 5 deletions dpdata/xyz/quip_gap_xyz.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def handle_single_xyz_frame(lines):
list(filter(bool, field_dict["virial"].split(" ")))
).reshape(3, 3)
]
).astype("float32")
).astype(np.float64)
else:
virials = None

Expand All @@ -175,10 +175,10 @@ def handle_single_xyz_frame(lines):
3, 3
)
]
).astype("float32")
info_dict["coords"] = np.array([coords_array]).astype("float32")
info_dict["energies"] = np.array([field_dict["energy"]]).astype("float32")
info_dict["forces"] = np.array([force_array]).astype("float32")
).astype(np.float64)
info_dict["coords"] = np.array([coords_array]).astype(np.float64)
info_dict["energies"] = np.array([field_dict["energy"]]).astype(np.float64)
info_dict["forces"] = np.array([force_array]).astype(np.float64)
if virials is not None:
info_dict["virials"] = virials
info_dict["orig"] = np.zeros(3)
Expand Down
4 changes: 2 additions & 2 deletions tests/xyz/xyz_unittest.field.xyz
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ energy=0.2397023e+01 virial="159.582203018 1.23282341824e-05 0.18783516


10
virial=" -3.68535041825 1.63204257089e-06 -4.28008468355 1.63204257089e-06 18.1630123797 0.0 -4.28008468355 0.0 3.03073243091 " Lattice=" 9.217080809 0.0 0.0 4.86e-07 6.431267224 0.0 4.201562981 4.1e-08 2.205334915 " Properties='species:S:1:pos:R:3:Z:I:1:force:R:3 ' energy='-58.342497 '
virial=" -3.68535041825 1.63204257089e-06 -4.28008468355 1.63204257089e-06 18.1630123797 0.0 -4.28008468355 0.0 3.03073243091 " Lattice=" 9.217080809 0.0 0.0 4.86e-07 6.431267224 0.0 4.201562981 4.1e-08 2.205334915 " Properties='species:S:1:pos:R:3:Z:I:1:force:R:3 ' energy='-5.834249877929687500e+01 '
B 12.38023000000 3.21563000000 2.13103000000 5 -9.35551000000 -0.00000000000 -0.22364600000
C 12.96783000000 4.32879000000 2.14172000000 6 7.05653600000 11.19171000000 1.80087100000
C 12.96783000000 2.10247000000 2.14172000000 6 7.05653500000 -11.19171000000 1.80087100000
Expand All @@ -28,7 +28,7 @@ C 2.71900000000 1.71197000000 0.17210000000 6 -3.43041200000 0.056
C 2.71900000000 4.71930000000 0.17210000000 6 -3.43041200000 -0.05665700000 -0.44035700000
C 9.69981000000 3.21563000000 0.55395000000 6 -2.18778000000 -0.00000000000 -1.00760300000
10
energy=-56.397425 virial="-5.61261501333 -6.34809444383e-07 6.34809444383e-07 -6.34809444383e-07 -5.61261501333 6.34809444383e-07 6.34809444383e-07 6.34809444383e-07 4.91130356636" Lattice="5.512073672 0.0 0.0 4.16e-07 5.512073672 0.0 2.53e-07 2.53e-07 3.347159197" Properties=species:S:1:pos:R:3:Z:I:1:force:R:3
energy=-5.639742660522460938e+01 virial="-5.61261501333 -6.34809444383e-07 6.34809444383e-07 -6.34809444383e-07 -5.61261501333 6.34809444383e-07 6.34809444383e-07 6.34809444383e-07 4.91130356636" Lattice="5.512073672 0.0 0.0 4.16e-07 5.512073672 0.0 2.53e-07 2.53e-07 3.347159197" Properties=species:S:1:pos:R:3:Z:I:1:force:R:3
B 4.08581000000 4.57623000000 2.94238000000 5 0.03989300000 -1.87257900000 0.97202400000
C 1.42627000000 0.93584000000 2.94238000000 5 -0.03989300000 1.87257900000 0.97202400000
C 0.93584000000 4.08581000000 2.94238000000 5 1.87257900000 0.03989300000 0.97202400000
Expand Down
4 changes: 2 additions & 2 deletions tests/xyz/xyz_unittest.sort.xyz
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ B 3.19567000000 7.85111000000 1.52250000000 5 -7.25565700000 8.829
C 2.27564000000 0.00000000000 1.03309000000 6 -0.00000000000 -0.00000000000 0.00000000000
B 2.27564000000 4.41538000000 1.03309000000 5 -0.00000000000 -0.00000000000 0.00000000000
10
energy=-58.342497 virial="-3.68535041825 1.63204257089e-06 -4.28008468355 1.63204257089e-06 18.1630123797 0.0 -4.28008468355 0.0 3.03073243091" Lattice="9.217080809 0.0 0.0 4.86e-07 6.431267224 0.0 4.201562981 4.1e-08 2.205334915" Properties=species:S:1:pos:R:3:Z:I:1:force:R:3
energy=-5.834249877929687500e+01 virial="-3.68535041825 1.63204257089e-06 -4.28008468355 1.63204257089e-06 18.1630123797 0.0 -4.28008468355 0.0 3.03073243091" Lattice="9.217080809 0.0 0.0 4.86e-07 6.431267224 0.0 4.201562981 4.1e-08 2.205334915" Properties=species:S:1:pos:R:3:Z:I:1:force:R:3
C 12.96783000000 4.32879000000 2.14172000000 6 7.05653600000 11.19171000000 1.80087100000
C 12.96783000000 2.10247000000 2.14172000000 6 7.05653500000 -11.19171000000 1.80087100000
C 7.95424000000 1.03482000000 2.10290000000 6 1.71010500000 -3.80357800000 -0.12402100000
Expand All @@ -25,7 +25,7 @@ C 2.71900000000 1.71197000000 0.17210000000 6 -3.43041200000 0.056
C 2.71900000000 4.71930000000 0.17210000000 6 -3.43041200000 -0.05665700000 -0.44035700000
C 9.69981000000 3.21563000000 0.55395000000 6 -2.18778000000 -0.00000000000 -1.00760300000
10
energy=-56.397425 virial="-5.61261501333 -6.34809444383e-07 6.34809444383e-07 -6.34809444383e-07 -5.61261501333 6.34809444383e-07 6.34809444383e-07 6.34809444383e-07 4.91130356636" Lattice="5.512073672 0.0 0.0 4.16e-07 5.512073672 0.0 2.53e-07 2.53e-07 3.347159197" Properties=species:S:1:pos:R:3:Z:I:1:force:R:3
energy=-5.639742660522460938e+01 virial="-5.61261501333 -6.34809444383e-07 6.34809444383e-07 -6.34809444383e-07 -5.61261501333 6.34809444383e-07 6.34809444383e-07 6.34809444383e-07 4.91130356636" Lattice="5.512073672 0.0 0.0 4.16e-07 5.512073672 0.0 2.53e-07 2.53e-07 3.347159197" Properties=species:S:1:pos:R:3:Z:I:1:force:R:3
B 4.08581000000 4.57623000000 2.94238000000 5 0.03989300000 -1.87257900000 0.97202400000
C 1.42627000000 0.93584000000 2.94238000000 5 -0.03989300000 1.87257900000 0.97202400000
C 0.93584000000 4.08581000000 2.94238000000 5 1.87257900000 0.03989300000 0.97202400000
Expand Down
4 changes: 2 additions & 2 deletions tests/xyz/xyz_unittest.xyz
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ C 2.27564000000 1.56002000000 1.03309000000 6 -0.00000000000 -4.519
C 2.27564000000 7.27074000000 1.03309000000 6 0.00000000000 4.51935800000 0.00000000000
C 2.27564000000 0.00000000000 1.03309000000 6 -0.00000000000 -0.00000000000 0.00000000000
10
energy=-58.342497 virial="-3.68535041825 1.63204257089e-06 -4.28008468355 1.63204257089e-06 18.1630123797 0.0 -4.28008468355 0.0 3.03073243091" Lattice="9.217080809 0.0 0.0 4.86e-07 6.431267224 0.0 4.201562981 4.1e-08 2.205334915" Properties=species:S:1:pos:R:3:Z:I:1:force:R:3
energy=-5.834249877929687500e+01 virial="-3.68535041825 1.63204257089e-06 -4.28008468355 1.63204257089e-06 18.1630123797 0.0 -4.28008468355 0.0 3.03073243091" Lattice="9.217080809 0.0 0.0 4.86e-07 6.431267224 0.0 4.201562981 4.1e-08 2.205334915" Properties=species:S:1:pos:R:3:Z:I:1:force:R:3
B 12.38023000000 3.21563000000 2.13103000000 5 -9.35551000000 -0.00000000000 -0.22364600000
C 12.96783000000 4.32879000000 2.14172000000 6 7.05653600000 11.19171000000 1.80087100000
C 12.96783000000 2.10247000000 2.14172000000 6 7.05653500000 -11.19171000000 1.80087100000
Expand All @@ -25,7 +25,7 @@ C 2.71900000000 1.71197000000 0.17210000000 6 -3.43041200000 0.056
C 2.71900000000 4.71930000000 0.17210000000 6 -3.43041200000 -0.05665700000 -0.44035700000
C 9.69981000000 3.21563000000 0.55395000000 6 -2.18778000000 -0.00000000000 -1.00760300000
10
energy=-56.397425 virial="-5.61261501333 -6.34809444383e-07 6.34809444383e-07 -6.34809444383e-07 -5.61261501333 6.34809444383e-07 6.34809444383e-07 6.34809444383e-07 4.91130356636" Lattice="5.512073672 0.0 0.0 4.16e-07 5.512073672 0.0 2.53e-07 2.53e-07 3.347159197" Properties=species:S:1:pos:R:3:Z:I:1:force:R:3
energy=-5.639742660522460938e+01 virial="-5.61261501333 -6.34809444383e-07 6.34809444383e-07 -6.34809444383e-07 -5.61261501333 6.34809444383e-07 6.34809444383e-07 6.34809444383e-07 4.91130356636" Lattice="5.512073672 0.0 0.0 4.16e-07 5.512073672 0.0 2.53e-07 2.53e-07 3.347159197" Properties=species:S:1:pos:R:3:Z:I:1:force:R:3
B 4.08581000000 4.57623000000 2.94238000000 5 0.03989300000 -1.87257900000 0.97202400000
C 1.42627000000 0.93584000000 2.94238000000 5 -0.03989300000 1.87257900000 0.97202400000
C 0.93584000000 4.08581000000 2.94238000000 5 1.87257900000 0.03989300000 0.97202400000
Expand Down

0 comments on commit 9a58fd4

Please sign in to comment.