Skip to content

Commit 2871fec

Browse files
Chore(pt):rm old pt implementation (#4223)
Fix #3913. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes - **New Features** - Introduced `exclude_types` parameter in `DipoleFittingNet` and `PolarFittingNet` constructors for improved flexibility. - Added `SimpleLinear` class to enhance network functionality. - **Bug Fixes** - Removed `old_impl` parameter across various classes, streamlining interfaces and ensuring consistent behavior. - **Documentation** - Updated test cases to reflect the removal of `old_impl`, focusing on new implementations. - **Chores** - Deleted obsolete files and classes to simplify the codebase and improve maintainability. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent af86b57 commit 2871fec

29 files changed

+206
-3495
lines changed

deepmd/dpmodel/fitting/dipole_fitting.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ def __init__(
105105
r_differentiable: bool = True,
106106
c_differentiable: bool = True,
107107
type_map: Optional[list[str]] = None,
108-
old_impl=False,
109108
seed: Optional[Union[int, list[int]]] = None,
110109
):
111110
if tot_ener_zero:
@@ -141,7 +140,6 @@ def __init__(
141140
type_map=type_map,
142141
seed=seed,
143142
)
144-
self.old_impl = False
145143

146144
def _net_out_dim(self):
147145
"""Set the FittingNet output dim."""
@@ -151,7 +149,6 @@ def serialize(self) -> dict:
151149
data = super().serialize()
152150
data["type"] = "dipole"
153151
data["embedding_width"] = self.embedding_width
154-
data["old_impl"] = self.old_impl
155152
data["r_differentiable"] = self.r_differentiable
156153
data["c_differentiable"] = self.c_differentiable
157154
return data

deepmd/dpmodel/fitting/polarizability_fitting.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ def __init__(
107107
spin: Any = None,
108108
mixed_types: bool = False,
109109
exclude_types: list[int] = [],
110-
old_impl: bool = False,
111110
fit_diag: bool = True,
112111
scale: Optional[list[float]] = None,
113112
shift_diag: bool = True,
@@ -165,7 +164,6 @@ def __init__(
165164
type_map=type_map,
166165
seed=seed,
167166
)
168-
self.old_impl = False
169167

170168
def _net_out_dim(self):
171169
"""Set the FittingNet output dim."""
@@ -192,7 +190,6 @@ def serialize(self) -> dict:
192190
data["type"] = "polar"
193191
data["@version"] = 3
194192
data["embedding_width"] = self.embedding_width
195-
data["old_impl"] = self.old_impl
196193
data["fit_diag"] = self.fit_diag
197194
data["shift_diag"] = self.shift_diag
198195
data["@variables"]["scale"] = self.scale

deepmd/pt/model/backbone/__init__.py

Lines changed: 0 additions & 12 deletions
This file was deleted.

deepmd/pt/model/backbone/backbone.py

Lines changed: 0 additions & 12 deletions
This file was deleted.

deepmd/pt/model/backbone/evoformer2b.py

Lines changed: 0 additions & 103 deletions
This file was deleted.

deepmd/pt/model/descriptor/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
from .env_mat import (
1717
prod_env_mat,
1818
)
19-
from .gaussian_lcc import (
20-
DescrptGaussianLcc,
21-
)
2219
from .hybrid import (
2320
DescrptHybrid,
2421
)
@@ -59,6 +56,5 @@
5956
"DescrptDPA2",
6057
"DescrptHybrid",
6158
"prod_env_mat",
62-
"DescrptGaussianLcc",
6359
"DescrptBlockRepformers",
6460
]

deepmd/pt/model/descriptor/dpa1.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@ def __init__(
245245
# not implemented
246246
spin=None,
247247
type: Optional[str] = None,
248-
old_impl: bool = False,
249248
):
250249
super().__init__()
251250
# Ensure compatibility with the deprecated stripped_type_embedding option.
@@ -290,7 +289,6 @@ def __init__(
290289
trainable_ln=trainable_ln,
291290
ln_eps=ln_eps,
292291
seed=child_seed(seed, 1),
293-
old_impl=old_impl,
294292
)
295293
self.use_econf_tebd = use_econf_tebd
296294
self.use_tebd_bias = use_tebd_bias

deepmd/pt/model/descriptor/dpa2.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ def __init__(
9292
use_econf_tebd: bool = False,
9393
use_tebd_bias: bool = False,
9494
type_map: Optional[list[str]] = None,
95-
old_impl: bool = False,
9695
):
9796
r"""The DPA-2 descriptor. see https://arxiv.org/abs/2312.15492.
9897
@@ -235,7 +234,6 @@ def init_subclass_params(sub_data, sub_class):
235234
g1_out_conv=self.repformer_args.g1_out_conv,
236235
g1_out_mlp=self.repformer_args.g1_out_mlp,
237236
seed=child_seed(seed, 1),
238-
old_impl=old_impl,
239237
)
240238
self.rcsl_list = [
241239
(self.repformers.get_rcut(), self.repformers.get_nsel()),

0 commit comments

Comments
 (0)