Skip to content

Commit

Permalink
update the version compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Chengqian-Zhang committed Dec 16, 2024
1 parent 5d3c50b commit 1094032
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion deepmd/dpmodel/fitting/property_fitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def __init__(
@classmethod
def deserialize(cls, data: dict) -> "PropertyFittingNet":
data = data.copy()
check_version_compatibility(data.pop("@version"), 3, 1)
check_version_compatibility(data.pop("@version"), 4, 1)
data.pop("dim_out")
data.pop("var_name")
data.pop("tot_ener_zero")
Expand All @@ -145,5 +145,6 @@ def serialize(self) -> dict:
"property_name": self.property_name,
"property_dim": self.property_dim,
}
dd["@version"] = 4

return dd
3 changes: 2 additions & 1 deletion deepmd/pt/model/task/property.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def output_def(self) -> FittingOutputDef:
@classmethod
def deserialize(cls, data: dict) -> "PropertyFittingNet":
data = data.copy()
check_version_compatibility(data.pop("@version", 1), 3, 1)
check_version_compatibility(data.pop("@version", 1), 4, 1)
data.pop("dim_out")
data.pop("var_name")
obj = super().deserialize(data)
Expand All @@ -163,6 +163,7 @@ def serialize(self) -> dict:
"property_name": self.property_name,
"property_dim": self.property_dim,
}
dd["@version"] = 4

return dd

Expand Down

0 comments on commit 1094032

Please sign in to comment.