Skip to content

Commit 1c758bd

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 0a1bb76 commit 1c758bd

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

tests/test_lammps_spin.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import numpy as np
88
from context import dpdata
9+
910
from dpdata.lammps.dump import get_spin
1011

1112
TRAJ_NO_ID = """ITEM: TIMESTEP
@@ -127,7 +128,7 @@ def test_read_dump_spin(self):
127128

128129
if os.path.isdir("lammps/dump"):
129130
shutil.rmtree("lammps/dump")
130-
131+
131132
def test_read_dump_partial_spin(self):
132133
# test if dpdata can read the spins when the spin data is not complete
133134
with self.assertWarns(UserWarning) as cm:
@@ -138,12 +139,15 @@ def test_read_dump_partial_spin(self):
138139
input_file="lammps/in.lmp",
139140
)
140141
self.assertTrue("spins" not in tmp_system.data)
141-
142+
142143
self.assertIn("Warning: spin info is not found in frame", str(cm.warning))
143-
144+
144145
def test_get_spin_failed(self):
145146
with self.assertWarns(UserWarning) as cm:
146-
spin = get_spin(TRAJ_NO_ID.split("\n"),["c_spin[1]", "c_spin[2]", "c_spin[3]", "c_spin[4]"])
147+
spin = get_spin(
148+
TRAJ_NO_ID.split("\n"),
149+
["c_spin[1]", "c_spin[2]", "c_spin[3]", "c_spin[4]"],
150+
)
147151
self.assertTrue(spin is None)
148-
149-
self.assertIn("Error processing spin data:", str(cm.warning))
152+
153+
self.assertIn("Error processing spin data:", str(cm.warning))

0 commit comments

Comments
 (0)