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 Mar 5, 2024
1 parent af1349c commit ba643b9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion deepmd/pt/model/atomic_model/linear_atomic_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,10 @@ def remap_atype(
), "The input `atype` cannot be handled by the type_map."
type_2_idx = {atp: idx for idx, atp in enumerate(ori_map)}

Check warning on line 246 in deepmd/pt/model/atomic_model/linear_atomic_model.py

View check run for this annotation

Codecov / codecov/patch

deepmd/pt/model/atomic_model/linear_atomic_model.py#L246

Added line #L246 was not covered by tests
# this maps the atype in the new map to the original map
mapping = torch.tensor([type_2_idx[new_map[idx]] for idx in range(len(new_map))], device=atype.device)
mapping = torch.tensor(

Check warning on line 248 in deepmd/pt/model/atomic_model/linear_atomic_model.py

View check run for this annotation

Codecov / codecov/patch

deepmd/pt/model/atomic_model/linear_atomic_model.py#L248

Added line #L248 was not covered by tests
[type_2_idx[new_map[idx]] for idx in range(len(new_map))],
device=atype.device,
)
updated_atype = mapping[atype.long()]
return updated_atype

Check warning on line 253 in deepmd/pt/model/atomic_model/linear_atomic_model.py

View check run for this annotation

Codecov / codecov/patch

deepmd/pt/model/atomic_model/linear_atomic_model.py#L252-L253

Added lines #L252 - L253 were not covered by tests

Expand Down

0 comments on commit ba643b9

Please sign in to comment.