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 Nov 15, 2024
1 parent 47114ec commit 48d8d6c
Showing 1 changed file with 18 additions and 43 deletions.
61 changes: 18 additions & 43 deletions source/tests/consistent/model/test_dos.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,8 @@

import numpy as np

from deepmd.dpmodel.common import (
to_numpy_array,
)
from deepmd.dpmodel.model.dos_model import DOSModel as DOSModelDP
from deepmd.dpmodel.model.model import get_model as get_model_dp
from deepmd.dpmodel.utils.nlist import (
build_neighbor_list,
extend_coord_with_ghosts,
)
from deepmd.dpmodel.utils.region import (
normalize_coord,
)
from deepmd.env import (
GLOBAL_NP_FLOAT_PRECISION,
)
Expand All @@ -36,8 +26,6 @@
if INSTALLED_PT:
from deepmd.pt.model.model import get_model as get_model_pt
from deepmd.pt.model.model.dos_model import DOSModel as DOSModelPT
from deepmd.pt.utils.utils import to_numpy_array as torch_to_numpy
from deepmd.pt.utils.utils import to_torch_tensor as numpy_to_torch
else:
DOSModelPT = None
if INSTALLED_TF:
Expand All @@ -64,39 +52,27 @@ class TestDOS(CommonTest, ModelTest, unittest.TestCase):
def data(self) -> dict:
pair_exclude_types, atom_exclude_types = self.param

Check notice

Code scanning / CodeQL

Unused local variable Note test

Variable pair_exclude_types is not used.

Check notice

Code scanning / CodeQL

Unused local variable Note test

Variable atom_exclude_types is not used.
return {
"type_map": [
"H"
],
"type_map": ["H"],
"descriptor": {
"type": "se_e2_a",
"sel": [
90
],
"rcut_smth": 1.8,
"rcut": 6.0,
"neuron": [
25,
50,
100
],
"resnet_dt": False,
"axis_neuron": 8,
"precision": "float64",
"seed": 1
"type": "se_e2_a",
"sel": [90],
"rcut_smth": 1.8,
"rcut": 6.0,
"neuron": [25, 50, 100],
"resnet_dt": False,
"axis_neuron": 8,
"precision": "float64",
"seed": 1,
},
"fitting_net": {
"type": "dos",
"numb_dos": 250,
"neuron": [
120,
120,
120
],
"resnet_dt": True,
"numb_fparam": 0,
"precision": "float64",
"seed": 1
}
"type": "dos",
"numb_dos": 250,
"neuron": [120, 120, 120],
"resnet_dt": True,
"numb_fparam": 0,
"precision": "float64",
"seed": 1,
},
}

tf_class = DOSModelTF
Expand Down Expand Up @@ -242,4 +218,3 @@ def extract_ret(self, ret: Any, backend) -> tuple[np.ndarray, ...]:
ret[4].ravel(),
)
raise ValueError(f"Unknown backend: {backend}")

0 comments on commit 48d8d6c

Please sign in to comment.