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 Jan 28, 2024
1 parent 84767f3 commit 8fee8fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions deepmd/pt/model/model/pair_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,7 @@ def _check_table_upper_boundary(self):
upper, increment * (rcut_idx + 1), rcut_idx - upper_idx + 1
)
pad_linear[:-1, 1:] = np.array(

Check warning on line 224 in deepmd/pt/model/model/pair_tab.py

View check run for this annotation

Codecov / codecov/patch

deepmd/pt/model/model/pair_tab.py#L224

Added line #L224 was not covered by tests
[
np.linspace(start, 0, rcut_idx - upper_idx)
for start in upper_val
]
[np.linspace(start, 0, rcut_idx - upper_idx) for start in upper_val]
).T
raw_data = np.concatenate((raw_data[:-1, :], pad_linear), axis=0)

Check warning on line 227 in deepmd/pt/model/model/pair_tab.py

View check run for this annotation

Codecov / codecov/patch

deepmd/pt/model/model/pair_tab.py#L227

Added line #L227 was not covered by tests

Expand Down
4 changes: 2 additions & 2 deletions source/tests/pt/test_pairtab.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def test_without_mask(self):
)
expected_result = torch.tensor([[1.2000, 1.3542], [1.2000, 0.4000]])

torch.testing.assert_allclose(result['energy'], expected_result)
torch.testing.assert_allclose(result["energy"], expected_result)

def test_with_mask(self):
self.nlist = torch.tensor([[[1, -1], [0, 2]], [[1, 2], [0, 3]]])
Expand All @@ -66,7 +66,7 @@ def test_with_mask(self):
)
expected_result = torch.tensor([[0.8000, 1.3542], [1.2000, 0.4000]])

torch.testing.assert_allclose(result['energy'], expected_result)
torch.testing.assert_allclose(result["energy"], expected_result)

def test_jit(self):
model = torch.jit.script(self.model)

Check notice

Code scanning / CodeQL

Unused local variable Note test

Variable model is not used.
Expand Down

0 comments on commit 8fee8fa

Please sign in to comment.