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 Sep 13, 2023
1 parent a1fc992 commit 8a160e9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions dpdata/deepmd/mixed.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ def to_system_data(folder, type_map=None, labels=True):
if type_map is not None:
assert isinstance(type_map, list)
missing_type = [i for i in old_type_map if i not in type_map]
assert not missing_type, f"These types are missing in selected type_map: {missing_type} !"
assert (
not missing_type
), f"These types are missing in selected type_map: {missing_type} !"
index_map = np.array([type_map.index(i) for i in old_type_map])
data["atom_names"] = type_map.copy()
else:
Expand All @@ -75,7 +77,9 @@ def to_system_data(folder, type_map=None, labels=True):
if index_map is None:
all_real_atom_types.append(np.reshape(real_atom_types, [nframes, -1]))
else:
all_real_atom_types.append(np.reshape(index_map[real_atom_types], [nframes, -1]))
all_real_atom_types.append(
np.reshape(index_map[real_atom_types], [nframes, -1])
)
if eners is not None:
eners = np.reshape(eners, [nframes])
if labels:
Expand Down

0 comments on commit 8a160e9

Please sign in to comment.