From 2b8afb5b5e87f898f9f80a39623b94d88244ee92 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 22:21:03 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- deepmd/__init__.py | 2 +- deepmd/common.py | 12 ++++----- deepmd/dpmodel/__init__.py | 12 ++++----- deepmd/dpmodel/atomic_model/__init__.py | 12 ++++----- deepmd/dpmodel/common.py | 4 +-- deepmd/dpmodel/descriptor/__init__.py | 8 +++--- deepmd/dpmodel/fitting/__init__.py | 6 ++--- deepmd/dpmodel/model/__init__.py | 2 +- deepmd/dpmodel/utils/__init__.py | 26 +++++++++---------- deepmd/env.py | 8 +++--- deepmd/infer/__init__.py | 4 +-- deepmd/jax/descriptor/__init__.py | 8 +++--- deepmd/jax/env.py | 2 +- deepmd/jax/fitting/__init__.py | 2 +- deepmd/jax/model/__init__.py | 4 +-- deepmd/pt/loss/__init__.py | 8 +++--- deepmd/pt/model/atomic_model/__init__.py | 8 +++--- deepmd/pt/model/descriptor/__init__.py | 14 +++++----- deepmd/pt/model/model/__init__.py | 16 ++++++------ deepmd/pt/model/network/init.py | 6 ++--- deepmd/pt/model/task/__init__.py | 6 ++--- deepmd/pt/utils/__init__.py | 2 +- deepmd/pt/utils/env.py | 16 ++++++------ deepmd/pt/utils/plugin.py | 4 +-- deepmd/tf/__init__.py | 10 +++---- deepmd/tf/common.py | 18 ++++++------- deepmd/tf/descriptor/__init__.py | 2 +- deepmd/tf/entrypoints/__init__.py | 12 ++++----- deepmd/tf/entrypoints/main.py | 2 +- deepmd/tf/env.py | 26 +++++++++---------- deepmd/tf/fit/__init__.py | 4 +-- deepmd/tf/infer/__init__.py | 4 +-- deepmd/tf/infer/deep_polar.py | 2 +- deepmd/tf/infer/model_devi.py | 4 +-- deepmd/tf/loss/__init__.py | 2 +- deepmd/tf/model/__init__.py | 8 +++--- deepmd/tf/model/model_stat.py | 2 +- deepmd/tf/nvnmd/entrypoints/__init__.py | 2 +- deepmd/tf/nvnmd/fit/ener.py | 2 +- deepmd/tf/nvnmd/utils/__init__.py | 8 +++--- deepmd/tf/utils/argcheck.py | 6 ++--- deepmd/tf/utils/data_system.py | 2 +- deepmd/tf/utils/errors.py | 2 +- deepmd/tf/utils/path.py | 4 +-- deepmd/tf/utils/plugin.py | 4 +-- deepmd/utils/econf_embd.py | 2 +- .../array_api_strict/descriptor/__init__.py | 4 +-- source/tests/consistent/common.py | 8 +++--- 48 files changed, 165 insertions(+), 167 deletions(-) diff --git a/deepmd/__init__.py b/deepmd/__init__.py index 6f2b65ba63..14d933da11 100644 --- a/deepmd/__init__.py +++ b/deepmd/__init__.py @@ -40,6 +40,6 @@ def DeepPotential(*args, **kwargs): __all__ = [ - "__version__", "DeepPotential", + "__version__", ] diff --git a/deepmd/common.py b/deepmd/common.py index 1e66113306..d109c64570 100644 --- a/deepmd/common.py +++ b/deepmd/common.py @@ -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"] @@ -63,9 +63,9 @@ if TYPE_CHECKING: _DICT_VAL = TypeVar("_DICT_VAL") __all__ += [ + "_ACTIVATION", "_DICT_VAL", "_PRECISION", - "_ACTIVATION", ] diff --git a/deepmd/dpmodel/__init__.py b/deepmd/dpmodel/__init__.py index 111c2d6ced..b87d217c74 100644 --- a/deepmd/dpmodel/__init__.py +++ b/deepmd/dpmodel/__init__.py @@ -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", ] diff --git a/deepmd/dpmodel/atomic_model/__init__.py b/deepmd/dpmodel/atomic_model/__init__.py index 4f4ef32e03..3d90c738ae 100644 --- a/deepmd/dpmodel/atomic_model/__init__.py +++ b/deepmd/dpmodel/atomic_model/__init__.py @@ -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", ] diff --git a/deepmd/dpmodel/common.py b/deepmd/dpmodel/common.py index 8353cc28e3..920364edc0 100644 --- a/deepmd/dpmodel/common.py +++ b/deepmd/dpmodel/common.py @@ -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", ] diff --git a/deepmd/dpmodel/descriptor/__init__.py b/deepmd/dpmodel/descriptor/__init__.py index de22757647..8542168d91 100644 --- a/deepmd/dpmodel/descriptor/__init__.py +++ b/deepmd/dpmodel/descriptor/__init__.py @@ -28,13 +28,13 @@ ) __all__ = [ + "DescrptDPA1", + "DescrptDPA2", + "DescrptHybrid", "DescrptSeA", + "DescrptSeAttenV2", "DescrptSeR", "DescrptSeT", "DescrptSeTTebd", - "DescrptDPA1", - "DescrptSeAttenV2", - "DescrptDPA2", - "DescrptHybrid", "make_base_descriptor", ] diff --git a/deepmd/dpmodel/fitting/__init__.py b/deepmd/dpmodel/fitting/__init__.py index 2a35a68d35..5bdfff2571 100644 --- a/deepmd/dpmodel/fitting/__init__.py +++ b/deepmd/dpmodel/fitting/__init__.py @@ -22,11 +22,11 @@ ) __all__ = [ - "InvarFitting", - "make_base_fitting", + "DOSFittingNet", "DipoleFitting", "EnergyFittingNet", + "InvarFitting", "PolarFitting", - "DOSFittingNet", "PropertyFittingNet", + "make_base_fitting", ] diff --git a/deepmd/dpmodel/model/__init__.py b/deepmd/dpmodel/model/__init__.py index f2a884c497..37ef57b38b 100644 --- a/deepmd/dpmodel/model/__init__.py +++ b/deepmd/dpmodel/model/__init__.py @@ -29,9 +29,9 @@ ) __all__ = [ + "DPModelCommon", "EnergyModel", "PropertyModel", - "DPModelCommon", "SpinModel", "make_model", ] diff --git a/deepmd/dpmodel/utils/__init__.py b/deepmd/dpmodel/utils/__init__.py index 0ae70dc31d..f6834ec838 100644 --- a/deepmd/dpmodel/utils/__init__.py +++ b/deepmd/dpmodel/utils/__init__.py @@ -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", ] diff --git a/deepmd/env.py b/deepmd/env.py index c1dd9d6f25..2c1241a36b 100644 --- a/deepmd/env.py +++ b/deepmd/env.py @@ -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__) diff --git a/deepmd/infer/__init__.py b/deepmd/infer/__init__.py index 8a8afb165a..a0330c4ffb 100644 --- a/deepmd/infer/__init__.py +++ b/deepmd/infer/__init__.py @@ -10,10 +10,10 @@ ) __all__ = [ - "DeepPot", - "calc_model_devi", "DeepEval", + "DeepPot", "DeepPotential", + "calc_model_devi", ] diff --git a/deepmd/jax/descriptor/__init__.py b/deepmd/jax/descriptor/__init__.py index dc5282dd21..de6489e6cf 100644 --- a/deepmd/jax/descriptor/__init__.py +++ b/deepmd/jax/descriptor/__init__.py @@ -25,12 +25,12 @@ ) __all__ = [ + "DescrptDPA1", + "DescrptDPA2", + "DescrptHybrid", "DescrptSeA", + "DescrptSeAttenV2", "DescrptSeR", "DescrptSeT", "DescrptSeTTebd", - "DescrptDPA1", - "DescrptSeAttenV2", - "DescrptDPA2", - "DescrptHybrid", ] diff --git a/deepmd/jax/env.py b/deepmd/jax/env.py index 02e31ae66e..738b2bba18 100644 --- a/deepmd/jax/env.py +++ b/deepmd/jax/env.py @@ -18,7 +18,7 @@ __all__ = [ "jax", + "jax_export", "jnp", "nnx", - "jax_export", ] diff --git a/deepmd/jax/fitting/__init__.py b/deepmd/jax/fitting/__init__.py index 226a6d5b43..77133e2bac 100644 --- a/deepmd/jax/fitting/__init__.py +++ b/deepmd/jax/fitting/__init__.py @@ -7,8 +7,8 @@ ) __all__ = [ - "EnergyFittingNet", "DOSFittingNet", "DipoleFittingNet", + "EnergyFittingNet", "PolarFittingNet", ] diff --git a/deepmd/jax/model/__init__.py b/deepmd/jax/model/__init__.py index fd31999aab..79d5bb2b23 100644 --- a/deepmd/jax/model/__init__.py +++ b/deepmd/jax/model/__init__.py @@ -19,10 +19,10 @@ ) __all__ = [ - "EnergyModel", - "DPZBLLinearEnergyAtomicModel", "DOSModel", + "DPZBLLinearEnergyAtomicModel", "DipoleModel", + "EnergyModel", "PolarModel", "PropertyModel", ] diff --git a/deepmd/pt/loss/__init__.py b/deepmd/pt/loss/__init__.py index 78528bceaa..cae561a8a2 100644 --- a/deepmd/pt/loss/__init__.py +++ b/deepmd/pt/loss/__init__.py @@ -22,11 +22,11 @@ ) __all__ = [ + "DOSLoss", "DenoiseLoss", - "EnergyStdLoss", "EnergySpinLoss", - "TensorLoss", - "TaskLoss", - "DOSLoss", + "EnergyStdLoss", "PropertyLoss", + "TaskLoss", + "TensorLoss", ] diff --git a/deepmd/pt/model/atomic_model/__init__.py b/deepmd/pt/model/atomic_model/__init__.py index 2aa4b1cdb2..4da9bf781b 100644 --- a/deepmd/pt/model/atomic_model/__init__.py +++ b/deepmd/pt/model/atomic_model/__init__.py @@ -47,11 +47,11 @@ "BaseAtomicModel", "DPAtomicModel", "DPDOSAtomicModel", + "DPDipoleAtomicModel", "DPEnergyAtomicModel", - "DPPropertyAtomicModel", - "PairTabAtomicModel", - "LinearEnergyAtomicModel", "DPPolarAtomicModel", - "DPDipoleAtomicModel", + "DPPropertyAtomicModel", "DPZBLLinearEnergyAtomicModel", + "LinearEnergyAtomicModel", + "PairTabAtomicModel", ] diff --git a/deepmd/pt/model/descriptor/__init__.py b/deepmd/pt/model/descriptor/__init__.py index 4ffa937bcb..4a227918fe 100644 --- a/deepmd/pt/model/descriptor/__init__.py +++ b/deepmd/pt/model/descriptor/__init__.py @@ -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", ] diff --git a/deepmd/pt/model/model/__init__.py b/deepmd/pt/model/model/__init__.py index a46909622b..966b6d94a3 100644 --- a/deepmd/pt/model/model/__init__.py +++ b/deepmd/pt/model/model/__init__.py @@ -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", ] diff --git a/deepmd/pt/model/network/init.py b/deepmd/pt/model/network/init.py index fe3c034637..53e2c70892 100644 --- a/deepmd/pt/model/network/init.py +++ b/deepmd/pt/model/network/init.py @@ -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( + param, float ): # True/False are instances of int, hence check above negative_slope = param diff --git a/deepmd/pt/model/task/__init__.py b/deepmd/pt/model/task/__init__.py index 02d852eab7..37ffec2725 100644 --- a/deepmd/pt/model/task/__init__.py +++ b/deepmd/pt/model/task/__init__.py @@ -29,14 +29,14 @@ ) __all__ = [ + "BaseFitting", + "DOSFittingNet", "DenoiseNet", "DipoleFittingNet", "EnergyFittingNet", "EnergyFittingNetDirect", "Fitting", - "BaseFitting", - "TypePredictNet", "PolarFittingNet", - "DOSFittingNet", "PropertyFittingNet", + "TypePredictNet", ] diff --git a/deepmd/pt/utils/__init__.py b/deepmd/pt/utils/__init__.py index 7e1043eda4..f90cf82249 100644 --- a/deepmd/pt/utils/__init__.py +++ b/deepmd/pt/utils/__init__.py @@ -6,6 +6,6 @@ ) __all__ = [ - "PairExcludeMask", "AtomExcludeMask", + "PairExcludeMask", ] diff --git a/deepmd/pt/utils/env.py b/deepmd/pt/utils/env.py index 81dce669ff..6471fd80a8 100644 --- a/deepmd/pt/utils/env.py +++ b/deepmd/pt/utils/env.py @@ -75,18 +75,18 @@ torch.set_num_threads(intra_nthreads) __all__ = [ + "CACHE_PER_SYS", + "DEFAULT_PRECISION", + "DEVICE", + "ENERGY_BIAS_TRAINABLE", "GLOBAL_ENER_FLOAT_PRECISION", "GLOBAL_NP_FLOAT_PRECISION", - "GLOBAL_PT_FLOAT_PRECISION", "GLOBAL_PT_ENER_FLOAT_PRECISION", - "DEFAULT_PRECISION", + "GLOBAL_PT_FLOAT_PRECISION", + "JIT", + "LOCAL_RANK", + "NUM_WORKERS", "PRECISION_DICT", "RESERVED_PRECISON_DICT", "SAMPLER_RECORD", - "NUM_WORKERS", - "DEVICE", - "JIT", - "CACHE_PER_SYS", - "ENERGY_BIAS_TRAINABLE", - "LOCAL_RANK", ] diff --git a/deepmd/pt/utils/plugin.py b/deepmd/pt/utils/plugin.py index aa901c06e8..7a39ae498c 100644 --- a/deepmd/pt/utils/plugin.py +++ b/deepmd/pt/utils/plugin.py @@ -10,7 +10,7 @@ __all__ = [ "Plugin", - "VariantMeta", - "VariantABCMeta", "PluginVariant", + "VariantABCMeta", + "VariantMeta", ] diff --git a/deepmd/tf/__init__.py b/deepmd/tf/__init__.py index 80044b68cc..933729fde2 100644 --- a/deepmd/tf/__init__.py +++ b/deepmd/tf/__init__.py @@ -38,15 +38,15 @@ load_entry_point("deepmd") __all__ = [ + "DeepEval", + "DeepPotential", + "DipoleChargeModifier", "__version__", + "cluster", "descriptor", "fit", "loss", - "utils", - "cluster", "network", - "DeepEval", - "DeepPotential", - "DipoleChargeModifier", "nvnmd", + "utils", ] diff --git a/deepmd/tf/common.py b/deepmd/tf/common.py index df7842545a..ef257c5eae 100644 --- a/deepmd/tf/common.py +++ b/deepmd/tf/common.py @@ -43,22 +43,22 @@ ) __all__ = [ - # from deepmd.common - "select_idx_map", - "make_default_mesh", - "j_loader", - "expand_sys_str", - "get_np_precision", + "ACTIVATION_FN_DICT", # from self "PRECISION_DICT", + "cast_precision", + "clear_session", + "expand_sys_str", "gelu", "gelu_tf", - "ACTIVATION_FN_DICT", "get_activation_func", + "get_np_precision", "get_precision", + "j_loader", + "make_default_mesh", "safe_cast_tensor", - "cast_precision", - "clear_session", + # from deepmd.common + "select_idx_map", ] # define constants diff --git a/deepmd/tf/descriptor/__init__.py b/deepmd/tf/descriptor/__init__.py index 6ef6c50da5..4bdc988682 100644 --- a/deepmd/tf/descriptor/__init__.py +++ b/deepmd/tf/descriptor/__init__.py @@ -42,8 +42,8 @@ "DescrptHybrid", "DescrptLocFrame", "DescrptSeA", - "DescrptSeAEbdV2", "DescrptSeAEbd", + "DescrptSeAEbdV2", "DescrptSeAEf", "DescrptSeAEfLower", "DescrptSeAMask", diff --git a/deepmd/tf/entrypoints/__init__.py b/deepmd/tf/entrypoints/__init__.py index 9c3a8b31e1..bf8c51067e 100644 --- a/deepmd/tf/entrypoints/__init__.py +++ b/deepmd/tf/entrypoints/__init__.py @@ -34,15 +34,15 @@ ) __all__ = [ - "doc_train_input", - "freeze", - "test", - "train_dp", - "transfer", "compress", + "convert", "doc_train_input", + "doc_train_input", + "freeze", "make_model_devi", - "convert", "neighbor_stat", "start_dpgui", + "test", + "train_dp", + "transfer", ] diff --git a/deepmd/tf/entrypoints/main.py b/deepmd/tf/entrypoints/main.py index 799a6280f6..5058c51c17 100644 --- a/deepmd/tf/entrypoints/main.py +++ b/deepmd/tf/entrypoints/main.py @@ -35,7 +35,7 @@ train_nvnmd, ) -__all__ = ["main", "parse_args", "get_ll", "main_parser"] +__all__ = ["get_ll", "main", "main_parser", "parse_args"] def main(args: Optional[Union[list[str], argparse.Namespace]] = None) -> None: diff --git a/deepmd/tf/env.py b/deepmd/tf/env.py index 9a50f1281f..d50d698559 100644 --- a/deepmd/tf/env.py +++ b/deepmd/tf/env.py @@ -103,26 +103,26 @@ def filter(self, record) -> bool: tfv2 = None __all__ = [ + "ATTENTION_LAYER_PATTERN", + "EMBEDDING_NET_PATTERN", + "FITTING_NET_PATTERN", "GLOBAL_CONFIG", - "GLOBAL_TF_FLOAT_PRECISION", - "GLOBAL_NP_FLOAT_PRECISION", "GLOBAL_ENER_FLOAT_PRECISION", - "global_float_prec", - "global_cvt_2_tf_float", - "global_cvt_2_ener_float", + "GLOBAL_NP_FLOAT_PRECISION", + "GLOBAL_TF_FLOAT_PRECISION", "MODEL_VERSION", "SHARED_LIB_DIR", "SHARED_LIB_MODULE", - "default_tf_session_config", - "reset_default_tf_session_config", - "op_module", - "op_grads_module", + "TF_VERSION", "TRANSFER_PATTERN", - "FITTING_NET_PATTERN", - "EMBEDDING_NET_PATTERN", "TYPE_EMBEDDING_PATTERN", - "ATTENTION_LAYER_PATTERN", - "TF_VERSION", + "default_tf_session_config", + "global_cvt_2_ener_float", + "global_cvt_2_tf_float", + "global_float_prec", + "op_grads_module", + "op_module", + "reset_default_tf_session_config", "tf_py_version", ] diff --git a/deepmd/tf/fit/__init__.py b/deepmd/tf/fit/__init__.py index 29067eb987..d9af5a26ba 100644 --- a/deepmd/tf/fit/__init__.py +++ b/deepmd/tf/fit/__init__.py @@ -17,10 +17,10 @@ ) __all__ = [ + "DOSFitting", "DipoleFittingSeA", "EnerFitting", - "DOSFitting", + "Fitting", "GlobalPolarFittingSeA", "PolarFittingSeA", - "Fitting", ] diff --git a/deepmd/tf/infer/__init__.py b/deepmd/tf/infer/__init__.py index 3596ff033e..de8a77976e 100644 --- a/deepmd/tf/infer/__init__.py +++ b/deepmd/tf/infer/__init__.py @@ -35,13 +35,13 @@ ) __all__ = [ - "DeepPotential", + "DeepDOS", "DeepDipole", "DeepEval", "DeepGlobalPolar", "DeepPolar", "DeepPot", - "DeepDOS", + "DeepPotential", "DeepWFC", "DipoleChargeModifier", "EwaldRecp", diff --git a/deepmd/tf/infer/deep_polar.py b/deepmd/tf/infer/deep_polar.py index c3d42fd537..93b840c714 100644 --- a/deepmd/tf/infer/deep_polar.py +++ b/deepmd/tf/infer/deep_polar.py @@ -5,6 +5,6 @@ ) __all__ = [ - "DeepPolar", "DeepGlobalPolar", + "DeepPolar", ] diff --git a/deepmd/tf/infer/model_devi.py b/deepmd/tf/infer/model_devi.py index 4ee979ac67..e112232f45 100644 --- a/deepmd/tf/infer/model_devi.py +++ b/deepmd/tf/infer/model_devi.py @@ -9,10 +9,10 @@ ) __all__ = [ - "make_model_devi", "calc_model_devi", - "write_model_devi_out", "calc_model_devi_e", "calc_model_devi_f", "calc_model_devi_v", + "make_model_devi", + "write_model_devi_out", ] diff --git a/deepmd/tf/loss/__init__.py b/deepmd/tf/loss/__init__.py index 5098d04abf..0f8b4407de 100644 --- a/deepmd/tf/loss/__init__.py +++ b/deepmd/tf/loss/__init__.py @@ -12,9 +12,9 @@ ) __all__ = [ + "DOSLoss", "EnerDipoleLoss", "EnerSpinLoss", "EnerStdLoss", - "DOSLoss", "TensorLoss", ] diff --git a/deepmd/tf/model/__init__.py b/deepmd/tf/model/__init__.py index 85cc74781d..0a2201ba8f 100644 --- a/deepmd/tf/model/__init__.py +++ b/deepmd/tf/model/__init__.py @@ -26,14 +26,14 @@ ) __all__ = [ - "EnerModel", "DOSModel", "DipoleModel", - "GlobalPolarModel", - "PolarModel", - "WFCModel", + "EnerModel", "FrozenModel", + "GlobalPolarModel", "LinearEnergyModel", "PairTabModel", "PairwiseDPRc", + "PolarModel", + "WFCModel", ] diff --git a/deepmd/tf/model/model_stat.py b/deepmd/tf/model/model_stat.py index db70262d50..96c8b4a4af 100644 --- a/deepmd/tf/model/model_stat.py +++ b/deepmd/tf/model/model_stat.py @@ -8,7 +8,7 @@ ) __all__ = [ + "_make_all_stat_ref", # used by tests "make_stat_input", "merge_sys_stat", - "_make_all_stat_ref", # used by tests ] diff --git a/deepmd/tf/nvnmd/entrypoints/__init__.py b/deepmd/tf/nvnmd/entrypoints/__init__.py index b939d81d39..76f96baf2c 100644 --- a/deepmd/tf/nvnmd/entrypoints/__init__.py +++ b/deepmd/tf/nvnmd/entrypoints/__init__.py @@ -9,4 +9,4 @@ Wrap, ) -__all__ = ["save_weight", "MapTable", "Wrap"] +__all__ = ["MapTable", "Wrap", "save_weight"] diff --git a/deepmd/tf/nvnmd/fit/ener.py b/deepmd/tf/nvnmd/fit/ener.py index 20adda395c..a4c15077ec 100644 --- a/deepmd/tf/nvnmd/fit/ener.py +++ b/deepmd/tf/nvnmd/fit/ener.py @@ -10,7 +10,7 @@ __all__ = [ "GLOBAL_TF_FLOAT_PRECISION", - "tf", "nvnmd_cfg", "one_layer_nvnmd", + "tf", ] diff --git a/deepmd/tf/nvnmd/utils/__init__.py b/deepmd/tf/nvnmd/utils/__init__.py index b4cb3d4799..a1d9ba322d 100644 --- a/deepmd/tf/nvnmd/utils/__init__.py +++ b/deepmd/tf/nvnmd/utils/__init__.py @@ -25,14 +25,14 @@ ) __all__ = [ - "nvnmd_args", - "nvnmd_cfg", "Encode", "FioBin", "FioDic", "FioTxt", - "one_layer", - "map_nvnmd", "get_filter_weight", "get_fitnet_weight", + "map_nvnmd", + "nvnmd_args", + "nvnmd_cfg", + "one_layer", ] diff --git a/deepmd/tf/utils/argcheck.py b/deepmd/tf/utils/argcheck.py index caec33c319..162234180a 100644 --- a/deepmd/tf/utils/argcheck.py +++ b/deepmd/tf/utils/argcheck.py @@ -11,10 +11,10 @@ ) __all__ = [ - "list_to_doc", - "normalize", + "gen_args", "gen_doc", "gen_json", - "gen_args", + "list_to_doc", + "normalize", "type_embedding_args", ] diff --git a/deepmd/tf/utils/data_system.py b/deepmd/tf/utils/data_system.py index da0cce28e8..8ca2007414 100644 --- a/deepmd/tf/utils/data_system.py +++ b/deepmd/tf/utils/data_system.py @@ -9,6 +9,6 @@ __all__ = [ "DeepmdDataSystem", - "process_sys_probs", "prob_sys_size_ext", + "process_sys_probs", ] diff --git a/deepmd/tf/utils/errors.py b/deepmd/tf/utils/errors.py index 5f7291c7ce..dcba19d3a3 100644 --- a/deepmd/tf/utils/errors.py +++ b/deepmd/tf/utils/errors.py @@ -13,7 +13,7 @@ class GraphWithoutTensorError(Exception): __all__ = [ - "OutOfMemoryError", "GraphTooLargeError", "GraphWithoutTensorError", + "OutOfMemoryError", ] diff --git a/deepmd/tf/utils/path.py b/deepmd/tf/utils/path.py index 67990543ae..54d4da42bf 100644 --- a/deepmd/tf/utils/path.py +++ b/deepmd/tf/utils/path.py @@ -8,7 +8,7 @@ ) __all__ = [ - "DPPath", - "DPOSPath", "DPH5Path", + "DPOSPath", + "DPPath", ] diff --git a/deepmd/tf/utils/plugin.py b/deepmd/tf/utils/plugin.py index f2f0336691..2ed6d7e72e 100644 --- a/deepmd/tf/utils/plugin.py +++ b/deepmd/tf/utils/plugin.py @@ -10,7 +10,7 @@ __all__ = [ "Plugin", - "VariantMeta", - "VariantABCMeta", "PluginVariant", + "VariantABCMeta", + "VariantMeta", ] diff --git a/deepmd/utils/econf_embd.py b/deepmd/utils/econf_embd.py index ce0da9e8fe..5ff136b373 100644 --- a/deepmd/utils/econf_embd.py +++ b/deepmd/utils/econf_embd.py @@ -7,8 +7,8 @@ __all__ = [ "electronic_configuration_embedding", - "normalized_electronic_configuration_embedding", "make_econf_embedding", + "normalized_electronic_configuration_embedding", "transform_to_spin_rep", ] diff --git a/source/tests/array_api_strict/descriptor/__init__.py b/source/tests/array_api_strict/descriptor/__init__.py index 5667fed858..bd778e364d 100644 --- a/source/tests/array_api_strict/descriptor/__init__.py +++ b/source/tests/array_api_strict/descriptor/__init__.py @@ -13,8 +13,8 @@ ) __all__ = [ - "DescrptSeA", - "DescrptSeR", "DescrptDPA1", "DescrptHybrid", + "DescrptSeA", + "DescrptSeR", ] diff --git a/source/tests/consistent/common.py b/source/tests/consistent/common.py index 358ac8d542..cbd6eed43d 100644 --- a/source/tests/consistent/common.py +++ b/source/tests/consistent/common.py @@ -62,11 +62,11 @@ __all__ = [ - "CommonTest", - "INSTALLED_TF", - "INSTALLED_PT", - "INSTALLED_JAX", "INSTALLED_ARRAY_API_STRICT", + "INSTALLED_JAX", + "INSTALLED_PT", + "INSTALLED_TF", + "CommonTest", ] SKIP_FLAG = object()