Skip to content

Commit 4935e7b

Browse files
Merge branch 'devel' into add_paddle_backend_core_and_water_se_e2_a
2 parents f176309 + cb3e39e commit 4935e7b

35 files changed

+69
-116
lines changed

deepmd/dpmodel/atomic_model/dp_atomic_model.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# SPDX-License-Identifier: LGPL-3.0-or-later
2-
import copy
32
from typing import (
43
Optional,
54
)
@@ -208,7 +207,7 @@ def serialize(self) -> dict:
208207

209208
@classmethod
210209
def deserialize(cls, data) -> "DPAtomicModel":
211-
data = copy.deepcopy(data)
210+
data = data.copy()
212211
check_version_compatibility(data.pop("@version", 1), 2, 2)
213212
data.pop("@class")
214213
data.pop("type")

deepmd/dpmodel/atomic_model/linear_atomic_model.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# SPDX-License-Identifier: LGPL-3.0-or-later
2-
import copy
32
from typing import (
43
Optional,
54
Union,
@@ -305,7 +304,7 @@ def serialize(self) -> dict:
305304

306305
@classmethod
307306
def deserialize(cls, data: dict) -> "LinearEnergyAtomicModel":
308-
data = copy.deepcopy(data)
307+
data = data.copy()
309308
check_version_compatibility(data.pop("@version", 2), 2, 2)
310309
data.pop("@class", None)
311310
data.pop("type", None)
@@ -418,7 +417,7 @@ def serialize(self) -> dict:
418417

419418
@classmethod
420419
def deserialize(cls, data) -> "DPZBLLinearEnergyAtomicModel":
421-
data = copy.deepcopy(data)
420+
data = data.copy()
422421
check_version_compatibility(data.pop("@version", 1), 2, 2)
423422
models = [
424423
BaseAtomicModel.get_class_by_type(model["type"]).deserialize(model)

deepmd/dpmodel/atomic_model/pairtab_atomic_model.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# SPDX-License-Identifier: LGPL-3.0-or-later
2-
import copy
32
from typing import (
43
Optional,
54
Union,
@@ -174,7 +173,7 @@ def serialize(self) -> dict:
174173

175174
@classmethod
176175
def deserialize(cls, data) -> "PairTabAtomicModel":
177-
data = copy.deepcopy(data)
176+
data = data.copy()
178177
check_version_compatibility(data.pop("@version", 1), 2, 2)
179178
data.pop("@class")
180179
data.pop("type")

deepmd/dpmodel/descriptor/se_e2_a.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# SPDX-License-Identifier: LGPL-3.0-or-later
2-
import copy
32
import itertools
43
from typing import (
54
Any,
@@ -460,7 +459,7 @@ def serialize(self) -> dict:
460459
@classmethod
461460
def deserialize(cls, data: dict) -> "DescrptSeA":
462461
"""Deserialize from dict."""
463-
data = copy.deepcopy(data)
462+
data = data.copy()
464463
check_version_compatibility(data.pop("@version", 1), 2, 1)
465464
data.pop("@class", None)
466465
data.pop("type", None)

deepmd/dpmodel/descriptor/se_r.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# SPDX-License-Identifier: LGPL-3.0-or-later
2-
import copy
32
from typing import (
43
Any,
54
Optional,
@@ -388,7 +387,7 @@ def serialize(self) -> dict:
388387
@classmethod
389388
def deserialize(cls, data: dict) -> "DescrptSeR":
390389
"""Deserialize from dict."""
391-
data = copy.deepcopy(data)
390+
data = data.copy()
392391
check_version_compatibility(data.pop("@version", 1), 2, 1)
393392
data.pop("@class", None)
394393
data.pop("type", None)

deepmd/dpmodel/descriptor/se_t.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# SPDX-License-Identifier: LGPL-3.0-or-later
2-
import copy
32
import itertools
43
from typing import (
54
Optional,
@@ -388,7 +387,7 @@ def serialize(self) -> dict:
388387
@classmethod
389388
def deserialize(cls, data: dict) -> "DescrptSeT":
390389
"""Deserialize from dict."""
391-
data = copy.deepcopy(data)
390+
data = data.copy()
392391
check_version_compatibility(data.pop("@version", 1), 2, 1)
393392
data.pop("@class", None)
394393
data.pop("type", None)

deepmd/dpmodel/fitting/dipole_fitting.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# SPDX-License-Identifier: LGPL-3.0-or-later
2-
import copy
32
from typing import (
43
Any,
54
Optional,
@@ -156,7 +155,7 @@ def serialize(self) -> dict:
156155

157156
@classmethod
158157
def deserialize(cls, data: dict) -> "GeneralFitting":
159-
data = copy.deepcopy(data)
158+
data = data.copy()
160159
check_version_compatibility(data.pop("@version", 1), 2, 1)
161160
var_name = data.pop("var_name", None)
162161
assert var_name == "dipole"

deepmd/dpmodel/fitting/dos_fitting.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# SPDX-License-Identifier: LGPL-3.0-or-later
2-
import copy
32
from typing import (
43
TYPE_CHECKING,
54
Optional,
@@ -73,7 +72,7 @@ def __init__(
7372

7473
@classmethod
7574
def deserialize(cls, data: dict) -> "GeneralFitting":
76-
data = copy.deepcopy(data)
75+
data = data.copy()
7776
check_version_compatibility(data.pop("@version", 1), 2, 1)
7877
data["numb_dos"] = data.pop("dim_out")
7978
data.pop("tot_ener_zero", None)

deepmd/dpmodel/fitting/ener_fitting.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# SPDX-License-Identifier: LGPL-3.0-or-later
2-
import copy
32
from typing import (
43
TYPE_CHECKING,
54
Any,
@@ -73,7 +72,7 @@ def __init__(
7372

7473
@classmethod
7574
def deserialize(cls, data: dict) -> "GeneralFitting":
76-
data = copy.deepcopy(data)
75+
data = data.copy()
7776
check_version_compatibility(data.pop("@version", 1), 2, 1)
7877
data.pop("var_name")
7978
data.pop("dim_out")

deepmd/dpmodel/fitting/general_fitting.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# SPDX-License-Identifier: LGPL-3.0-or-later
2-
import copy
32
from abc import (
43
abstractmethod,
54
)
@@ -320,7 +319,7 @@ def serialize(self) -> dict:
320319

321320
@classmethod
322321
def deserialize(cls, data: dict) -> "GeneralFitting":
323-
data = copy.deepcopy(data)
322+
data = data.copy()
324323
data.pop("@class")
325324
data.pop("type")
326325
variables = data.pop("@variables")

0 commit comments

Comments
 (0)