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 25, 2024
1 parent 52c8695 commit 2b8afb5
Show file tree
Hide file tree
Showing 48 changed files with 165 additions and 167 deletions.
2 changes: 1 addition & 1 deletion deepmd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ def DeepPotential(*args, **kwargs):


__all__ = [
"__version__",
"DeepPotential",
"__version__",
]
12 changes: 6 additions & 6 deletions deepmd/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
)

__all__ = [
"select_idx_map",
"make_default_mesh",
"j_loader",
"VALID_ACTIVATION",
"VALID_PRECISION",
"expand_sys_str",
"get_np_precision",
"VALID_PRECISION",
"VALID_ACTIVATION",
"j_loader",
"make_default_mesh",
"select_idx_map",
]

_PRECISION = Literal["default", "float16", "float32", "float64"]
Expand All @@ -63,9 +63,9 @@
if TYPE_CHECKING:
_DICT_VAL = TypeVar("_DICT_VAL")
__all__ += [
"_ACTIVATION",
"_DICT_VAL",
"_PRECISION",
"_ACTIVATION",
]


Expand Down
12 changes: 6 additions & 6 deletions deepmd/dpmodel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@
)

__all__ = [
"DPModelCommon",
"PRECISION_DICT",
"DEFAULT_PRECISION",
"NativeOP",
"ModelOutputDef",
"PRECISION_DICT",
"DPModelCommon",
"FittingOutputDef",
"ModelOutputDef",
"NativeOP",
"OutputVariableDef",
"model_check_output",
"fitting_check_output",
"get_reduce_name",
"get_deriv_name",
"get_hessian_name",
"get_reduce_name",
"model_check_output",
]


Expand Down
12 changes: 6 additions & 6 deletions deepmd/dpmodel/atomic_model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@
)

__all__ = [
"make_base_atomic_model",
"BaseAtomicModel",
"DPAtomicModel",
"DPEnergyAtomicModel",
"PairTabAtomicModel",
"LinearEnergyAtomicModel",
"DPZBLLinearEnergyAtomicModel",
"DPDOSAtomicModel",
"DPPolarAtomicModel",
"DPDipoleAtomicModel",
"DPEnergyAtomicModel",
"DPPolarAtomicModel",
"DPZBLLinearEnergyAtomicModel",
"LinearEnergyAtomicModel",
"PairTabAtomicModel",
"make_base_atomic_model",
]
4 changes: 2 additions & 2 deletions deepmd/dpmodel/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,10 @@ def safe_cast_array(


__all__ = [
"GLOBAL_NP_FLOAT_PRECISION",
"DEFAULT_PRECISION",
"GLOBAL_ENER_FLOAT_PRECISION",
"GLOBAL_NP_FLOAT_PRECISION",
"PRECISION_DICT",
"RESERVED_PRECISON_DICT",
"DEFAULT_PRECISION",
"NativeOP",
]
8 changes: 4 additions & 4 deletions deepmd/dpmodel/descriptor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
)

__all__ = [
"DescrptDPA1",
"DescrptDPA2",
"DescrptHybrid",
"DescrptSeA",
"DescrptSeAttenV2",
"DescrptSeR",
"DescrptSeT",
"DescrptSeTTebd",
"DescrptDPA1",
"DescrptSeAttenV2",
"DescrptDPA2",
"DescrptHybrid",
"make_base_descriptor",
]
6 changes: 3 additions & 3 deletions deepmd/dpmodel/fitting/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
)

__all__ = [
"InvarFitting",
"make_base_fitting",
"DOSFittingNet",
"DipoleFitting",
"EnergyFittingNet",
"InvarFitting",
"PolarFitting",
"DOSFittingNet",
"PropertyFittingNet",
"make_base_fitting",
]
2 changes: 1 addition & 1 deletion deepmd/dpmodel/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
)

__all__ = [
"DPModelCommon",
"EnergyModel",
"PropertyModel",
"DPModelCommon",
"SpinModel",
"make_model",
]
26 changes: 13 additions & 13 deletions deepmd/dpmodel/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,27 @@
)

__all__ = [
"EnvMat",
"make_multilayer_network",
"make_embedding_network",
"make_fitting_network",
"AtomExcludeMask",
"EmbeddingNet",
"EnvMat",
"FittingNet",
"NativeLayer",
"NativeNet",
"NetworkCollection",
"load_dp_model",
"save_dp_model",
"traverse_model_dict",
"build_neighbor_list",
"nlist_distinguish_types",
"get_multiple_nlist_key",
"PairExcludeMask",
"build_multiple_neighbor_list",
"build_neighbor_list",
"extend_coord_with_ghosts",
"normalize_coord",
"get_multiple_nlist_key",
"inter2phys",
"load_dp_model",
"make_embedding_network",
"make_fitting_network",
"make_multilayer_network",
"nlist_distinguish_types",
"normalize_coord",
"phys2inter",
"save_dp_model",
"to_face_distance",
"AtomExcludeMask",
"PairExcludeMask",
"traverse_model_dict",
]
8 changes: 4 additions & 4 deletions deepmd/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
import deepmd.lib

__all__ = [
"GLOBAL_NP_FLOAT_PRECISION",
"GLOBAL_ENER_FLOAT_PRECISION",
"global_float_prec",
"GLOBAL_CONFIG",
"SHARED_LIB_MODULE",
"GLOBAL_ENER_FLOAT_PRECISION",
"GLOBAL_NP_FLOAT_PRECISION",
"SHARED_LIB_DIR",
"SHARED_LIB_MODULE",
"global_float_prec",
]

log = logging.getLogger(__name__)
Expand Down
4 changes: 2 additions & 2 deletions deepmd/infer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
)

__all__ = [
"DeepPot",
"calc_model_devi",
"DeepEval",
"DeepPot",
"DeepPotential",
"calc_model_devi",
]


Expand Down
8 changes: 4 additions & 4 deletions deepmd/jax/descriptor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
)

__all__ = [
"DescrptDPA1",
"DescrptDPA2",
"DescrptHybrid",
"DescrptSeA",
"DescrptSeAttenV2",
"DescrptSeR",
"DescrptSeT",
"DescrptSeTTebd",
"DescrptDPA1",
"DescrptSeAttenV2",
"DescrptDPA2",
"DescrptHybrid",
]
2 changes: 1 addition & 1 deletion deepmd/jax/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

__all__ = [
"jax",
"jax_export",
"jnp",
"nnx",
"jax_export",
]
2 changes: 1 addition & 1 deletion deepmd/jax/fitting/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
)

__all__ = [
"EnergyFittingNet",
"DOSFittingNet",
"DipoleFittingNet",
"EnergyFittingNet",
"PolarFittingNet",
]
4 changes: 2 additions & 2 deletions deepmd/jax/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
)

__all__ = [
"EnergyModel",
"DPZBLLinearEnergyAtomicModel",
"DOSModel",
"DPZBLLinearEnergyAtomicModel",
"DipoleModel",
"EnergyModel",
"PolarModel",
"PropertyModel",
]
8 changes: 4 additions & 4 deletions deepmd/pt/loss/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
)

__all__ = [
"DOSLoss",
"DenoiseLoss",
"EnergyStdLoss",
"EnergySpinLoss",
"TensorLoss",
"TaskLoss",
"DOSLoss",
"EnergyStdLoss",
"PropertyLoss",
"TaskLoss",
"TensorLoss",
]
8 changes: 4 additions & 4 deletions deepmd/pt/model/atomic_model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@
"BaseAtomicModel",
"DPAtomicModel",
"DPDOSAtomicModel",
"DPDipoleAtomicModel",
"DPEnergyAtomicModel",
"DPPropertyAtomicModel",
"PairTabAtomicModel",
"LinearEnergyAtomicModel",
"DPPolarAtomicModel",
"DPDipoleAtomicModel",
"DPPropertyAtomicModel",
"DPZBLLinearEnergyAtomicModel",
"LinearEnergyAtomicModel",
"PairTabAtomicModel",
]
14 changes: 7 additions & 7 deletions deepmd/pt/model/descriptor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,18 @@
__all__ = [
"BaseDescriptor",
"DescriptorBlock",
"make_default_type_embedding",
"DescrptBlockRepformers",
"DescrptBlockSeA",
"DescrptBlockSeAtten",
"DescrptSeAttenV2",
"DescrptSeTTebd",
"DescrptBlockSeTTebd",
"DescrptSeA",
"DescrptSeR",
"DescrptSeT",
"DescrptDPA1",
"DescrptDPA2",
"DescrptHybrid",
"DescrptSeA",
"DescrptSeAttenV2",
"DescrptSeR",
"DescrptSeT",
"DescrptSeTTebd",
"make_default_type_embedding",
"prod_env_mat",
"DescrptBlockRepformers",
]
16 changes: 8 additions & 8 deletions deepmd/pt/model/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,17 +295,17 @@ def get_model(model_params):

__all__ = [
"BaseModel",
"get_model",
"DOSModel",
"DPModelCommon",
"EnergyModel",
"DPZBLModel",
"DipoleModel",
"PolarModel",
"DOSModel",
"EnergyModel",
"FrozenModel",
"SpinModel",
"LinearEnergyModel",
"PolarModel",
"SpinEnergyModel",
"DPZBLModel",
"make_model",
"SpinModel",
"get_model",
"make_hessian_model",
"LinearEnergyModel",
"make_model",
]
6 changes: 2 additions & 4 deletions deepmd/pt/model/network/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,8 @@ def calculate_gain(nonlinearity, param=None):
elif nonlinearity == "leaky_relu":
if param is None:
negative_slope = 0.01
elif (
not isinstance(param, bool)
and isinstance(param, int)
or isinstance(param, float)
elif (not isinstance(param, bool) and isinstance(param, int)) or isinstance(

Check warning on line 133 in deepmd/pt/model/network/init.py

View check run for this annotation

Codecov / codecov/patch

deepmd/pt/model/network/init.py#L133

Added line #L133 was not covered by tests
param, float
):
# True/False are instances of int, hence check above
negative_slope = param
Expand Down
6 changes: 3 additions & 3 deletions deepmd/pt/model/task/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
)

__all__ = [
"BaseFitting",
"DOSFittingNet",
"DenoiseNet",
"DipoleFittingNet",
"EnergyFittingNet",
"EnergyFittingNetDirect",
"Fitting",
"BaseFitting",
"TypePredictNet",
"PolarFittingNet",
"DOSFittingNet",
"PropertyFittingNet",
"TypePredictNet",
]
2 changes: 1 addition & 1 deletion deepmd/pt/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
)

__all__ = [
"PairExcludeMask",
"AtomExcludeMask",
"PairExcludeMask",
]
Loading

0 comments on commit 2b8afb5

Please sign in to comment.