Skip to content

Commit a769fd6

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

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

deepmd/entrypoints/test.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,14 +1138,13 @@ def test_polar(
11381138
)
11391139
# for TF compatibility, need to add type_sel to coord, so that the atom order is aligned with the label
11401140
data.add(
1141-
"coord",
1142-
3,
1143-
atomic=True,
1141+
"coord",
1142+
3,
1143+
atomic=True,
11441144
must=True,
11451145
type_sel=dp.get_sel_type(),
11461146
)
11471147

1148-
11491148
test_data = data.get_test()
11501149
polar, numb_test, atype = run_test(dp, test_data, numb_test, data)
11511150

@@ -1288,9 +1287,9 @@ def test_dipole(
12881287
)
12891288
# for TF compatibility, need to add type_sel to coord, so that the atom order is aligned with the label
12901289
data.add(
1291-
"coord",
1292-
3,
1293-
atomic=True,
1290+
"coord",
1291+
3,
1292+
atomic=True,
12941293
must=True,
12951294
type_sel=dp.get_sel_type(),
12961295
)

deepmd/utils/data.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,9 @@ def _load_data(
637637
data = path.load_numpy().astype(dtype)
638638
try: # YWolfeee: deal with data shape error
639639
if atomic:
640-
if type_sel is not None and natoms_sel != natoms: # handle PT all atom case
640+
if (
641+
type_sel is not None and natoms_sel != natoms
642+
): # handle PT all atom case
641643
# check the data shape is nsel or natoms
642644
if data.size == nframes * natoms_sel * ndof_:
643645
if output_natoms_for_type_sel:

0 commit comments

Comments
 (0)