Skip to content

Commit

Permalink
avoid using import *
Browse files Browse the repository at this point in the history
Signed-off-by: Jinzhe Zeng <[email protected]>
  • Loading branch information
njzjz committed Jan 12, 2024
1 parent be9e680 commit 61b8230
Show file tree
Hide file tree
Showing 11 changed files with 105 additions and 11 deletions.
6 changes: 5 additions & 1 deletion deepmd/loggers/loggers.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
"""Alias of deepmd_utils.loggers.loggers for backward compatibility."""
from deepmd_utils.loggers.loggers import * # noqa: F403
from deepmd_utils.loggers.loggers import (
set_log_handles,
)

__all__ = ["set_log_handles"]
8 changes: 7 additions & 1 deletion deepmd/nvnmd/utils/argcheck.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
"""Alias for backward compatibility."""
from deepmd_utils.utils.argcheck_nvnmd import * # noqa: F403
from deepmd_utils.utils.argcheck_nvnmd import (
nvnmd_args,
)

__all__ = [
"nvnmd_args",
]
16 changes: 15 additions & 1 deletion deepmd/utils/argcheck.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
"""Alias for backward compatibility."""
from deepmd_utils.utils.argcheck import * # noqa: F403
from deepmd_utils.utils.argcheck import (
gen_args,
gen_doc,
gen_json,
normalize,
type_embedding_args,
)

__all__ = [
"normalize",
"gen_doc",
"gen_json",
"gen_args",
"type_embedding_args",
]
14 changes: 13 additions & 1 deletion deepmd/utils/compat.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
"""Alias for backward compatibility."""
from deepmd_utils.utils.compat import * # noqa: F403
from deepmd_utils.utils.compat import (
convert_input_v0_v1,
convert_input_v1_v2,
deprecate_numb_test,
update_deepmd_input,
)

__all__ = [
"convert_input_v0_v1",
"convert_input_v1_v2",
"deprecate_numb_test",
"update_deepmd_input",
]
8 changes: 7 additions & 1 deletion deepmd/utils/data.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
"""Alias for backward compatibility."""
from deepmd_utils.utils.data import * # noqa: F403
from deepmd_utils.utils.data import (
DeepmdData,
)

__all__ = [
"DeepmdData",
]
8 changes: 7 additions & 1 deletion deepmd/utils/data_system.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
"""Alias for backward compatibility."""
from deepmd_utils.utils.data_system import * # noqa: F403
from deepmd_utils.utils.data_system import (
DeepmdDataSystem,
)

__all__ = [
"DeepmdDataSystem",
]
8 changes: 7 additions & 1 deletion deepmd/utils/pair_tab.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
"""Alias for backward compatibility."""
from deepmd_utils.utils.pair_tab import * # noqa: F403
from deepmd_utils.utils.pair_tab import (
PairTab,
)

__all__ = [
"PairTab",
]
12 changes: 11 additions & 1 deletion deepmd/utils/path.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
"""Alias for backward compatibility."""
from deepmd_utils.utils.path import * # noqa: F403
from deepmd_utils.utils.path import (
DPH5Path,
DPOSPath,
DPPath,
)

__all__ = [
"DPPath",
"DPOSPath",
"DPH5Path",
]
14 changes: 13 additions & 1 deletion deepmd/utils/plugin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
"""Alias for backward compatibility."""
from deepmd_utils.utils.plugin import * # noqa: F403
from deepmd_utils.utils.plugin import (
Plugin,
PluginVariant,
VariantABCMeta,
VariantMeta,
)

__all__ = [
"Plugin",
"VariantMeta",
"VariantABCMeta",
"PluginVariant",
]
14 changes: 13 additions & 1 deletion deepmd/utils/random.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
"""Alias for backward compatibility."""
from deepmd_utils.utils.random import * # noqa: F403
from deepmd_utils.utils.random import (
choice,
random,
seed,
shuffle,
)

__all__ = [
"choice",
"random",
"seed",
"shuffle",
]
8 changes: 7 additions & 1 deletion deepmd/utils/weight_avg.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
"""Alias for backward compatibility."""
from deepmd_utils.utils.weight_avg import * # noqa: F403
from deepmd_utils.utils.weight_avg import (
weighted_average,
)

__all__ = [
"weighted_average",
]

0 comments on commit 61b8230

Please sign in to comment.