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 18, 2024
1 parent 5a11ff8 commit 9071e73
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions deepmd/dpmodel/model/model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
import copy

from deepmd.dpmodel.atomic_model.dp_atomic_model import (
DPAtomicModel,
)
Expand All @@ -17,23 +19,30 @@
from deepmd.dpmodel.model.base_model import (
BaseModel,
)
from deepmd.dpmodel.model.dipole_model import (
DipoleModel,
)
from deepmd.dpmodel.model.dos_model import (
DOSModel,
)
from deepmd.dpmodel.model.dp_zbl_model import (
DPZBLModel,
)
from deepmd.dpmodel.model.ener_model import (
EnergyModel,
)
from deepmd.dpmodel.model.polar_model import (
PolarModel,
)
from deepmd.dpmodel.model.property_model import (
PropertyModel,
)
from deepmd.dpmodel.model.spin_model import (
SpinModel,
)
from deepmd.utils.spin import (
Spin,
)
import copy
from deepmd.dpmodel.model.dos_model import DOSModel
from deepmd.dpmodel.model.property_model import PropertyModel
from deepmd.dpmodel.model.dipole_model import DipoleModel
from deepmd.dpmodel.model.polar_model import PolarModel


def _get_standard_model_components(data, ntypes):
Expand All @@ -57,7 +66,8 @@ def _get_standard_model_components(data, ntypes):
fitting_net["return_energy"] = True

Check warning on line 66 in deepmd/dpmodel/model/model.py

View check run for this annotation

Codecov / codecov/patch

deepmd/dpmodel/model/model.py#L64-L66

Added lines #L64 - L66 were not covered by tests
fitting = BaseFitting(**fitting_net)
return descriptor, fitting, fitting_net["type"]



def get_standard_model(data: dict) -> EnergyModel:
"""Get a EnergyModel from a dictionary.
Expand All @@ -72,12 +82,9 @@ def get_standard_model(data: dict) -> EnergyModel:
)
data = copy.deepcopy(data)
ntypes = len(data["type_map"])
descriptor, fitting, fitting_net_type = _get_standard_model_components(
data, ntypes
)
descriptor, fitting, fitting_net_type = _get_standard_model_components(data, ntypes)
atom_exclude_types = data.get("atom_exclude_types", [])
pair_exclude_types = data.get("pair_exclude_types", [])


if fitting_net_type == "dipole":
modelcls = DipoleModel

Check warning on line 90 in deepmd/dpmodel/model/model.py

View check run for this annotation

Codecov / codecov/patch

deepmd/dpmodel/model/model.py#L90

Added line #L90 was not covered by tests
Expand Down

0 comments on commit 9071e73

Please sign in to comment.