Skip to content

Commit

Permalink
fix: use deepcopy when dumping mixed types
Browse files Browse the repository at this point in the history
  • Loading branch information
iProzd committed Jun 6, 2024
1 parent 4bb4069 commit f14fda7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dpdata/deepmd/mixed.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import glob
import os
import shutil
import copy

import numpy as np

Expand Down Expand Up @@ -159,6 +160,8 @@ def dump(folder, data, set_size=2000, comp_prec=np.float32, remove_sets=True):
# if not converted to mixed
if "real_atom_types" not in data:
from dpdata import LabeledSystem, System
# not change the original content
data = copy.deepcopy(data)

if "energies" in data:
temp_sys = LabeledSystem(data=data)
Expand Down

0 comments on commit f14fda7

Please sign in to comment.