Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed May 21, 2024
1 parent 32d2fe9 commit 0e27ad1
Showing 1 changed file with 35 additions and 22 deletions.
57 changes: 35 additions & 22 deletions tests/test_abacus_deltaspin.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
import numpy as np
from context import dpdata


class TestABACUSDeltaSpin(unittest.TestCase):
"""Make a test for the DeltaSpin module in ABACUS"""

def setUp(self):

self.system_1 = dpdata.LabeledSystem(
("./abacus.scf.deltaspin"), fmt="abacus/scf"
)
Expand All @@ -22,7 +22,7 @@ def setUp(self):
"coords": np.array(
[
[
[0. , 0. , 0. ],
[0.0, 0.0, 0.0],
[1.4349999, 1.4349999, 1.4349999],
]
]
Expand All @@ -31,58 +31,71 @@ def setUp(self):
"forces": np.array(
[
[
[0., 0., 0.,],
[0., 0., 0.,],
[
0.0,
0.0,
0.0,
],
[
0.0,
0.0,
0.0,
],
]
]
),
"spin": np.array
(
"spin": np.array(
[
[
[0., 0., 2.19999997],
[0., 0., 2.20000001],
[0.0, 0.0, 2.19999997],
[0.0, 0.0, 2.20000001],
]
]
),
"cells": np.array
(
"cells": np.array(
[
[
[2.86999979, 0. ,0. ],
[0., 2.86999979, 0. ],
[0., 0. , 2.86999979],
[2.86999979, 0.0, 0.0],
[0.0, 2.86999979, 0.0],
[0.0, 0.0, 2.86999979],
]
]
),
"virial": np.array(
[
[
[-3.95996034e-01, -3.25934940e-09, -4.71565445e-09],
[-3.25934940e-09, -3.95996551e-01, 1.92993618e-09],
[-4.71565445e-09, 1.92993618e-09, -3.95998805e-01],
[-3.25934940e-09, -3.95996551e-01, 1.92993618e-09],
[-4.71565445e-09, 1.92993618e-09, -3.95998805e-01],
]
]
),
"mag_forces": np.array(
[
[
[ 0.00000000e+00, -1.12095051e-09, 1.80736102e-09],
[ 1.00000000e+00, 3.54604018e-09, -2.33608701e-10],
[0.00000000e00, -1.12095051e-09, 1.80736102e-09],
[1.00000000e00, 3.54604018e-09, -2.33608701e-10],
]
]
),
"coors_deltaspin": np.array(
[
[
[ 0. , 0. , 0. , 0. , 0. , -0.44295301 ],
[ 1.4349999, 1.4349999, 1.4349999, 1.4349999, 1.4349999, 0.99204688 ],
[0.0, 0.0, 0.0, 0.0, 0.0, -0.44295301],
[
1.4349999,
1.4349999,
1.4349999,
1.4349999,
1.4349999,
0.99204688,
],
]
]
)
),
}
)


if __name__ == "__main__":
unittest.main()
unittest.main()

0 comments on commit 0e27ad1

Please sign in to comment.