deepmodeling/dpdata

[BUG] fail merging three dataset from cp2k/aimd using the command of append.

jiaweiGe472 opened this issue · 1 comments

data=dpdata.LabeledSystem("/public1/home/sc61116/cp2k/wanhao/20230323/1CELL/MD",fmt="cp2k/aimd_output")

data3=dpdata.LabeledSystem("/public1/home/sc61116/cp2k/wanhao/20230323/3CELL/MD",fmt="cp2k/aimd_output")
data5=dpdata.LabeledSystem("/public1/home/sc61116/cp2k/wanhao/20230323/5CELL/MD",fmt="cp2k/aimd_output")
data1=np.append(data,data3,data5)
Traceback (most recent call last):
File "", line 1, in
File "<array_function internals>", line 180, in append
File "/public1/home/sc61116/.conda/envs/sc61116/lib/python3.9/site-packages/numpy/lib/function_base.py", line 5386, in append
arr = asanyarray(arr)
File "/public1/home/sc61116/.conda/envs/sc61116/lib/python3.9/site-packages/dpdata/system.py", line 166, in getitem
return self.sub_system(key)
File "/public1/home/sc61116/.conda/envs/sc61116/lib/python3.9/site-packages/dpdata/system.py", line 1193, in sub_system
tmp_sys.data['forces'] = self.data['forces'][f_idx].reshape(-1, self.data['forces'].shape[1], 3)
ValueError: cannot reshape array of size 0 into shape (0,3)
data.append(data3)
Traceback (most recent call last):
File "", line 1, in
File "/public1/home/sc61116/.conda/envs/sc61116/lib/python3.9/site-packages/dpdata/system.py", line 1208, in append
if not System.append(self, system):
File "/public1/home/sc61116/.conda/envs/sc61116/lib/python3.9/site-packages/dpdata/system.py", line 331, in append
assert(system.formula == self.formula)
AssertionError
ls
Traceback (most recent call last):
File "", line 1, in
NameError: name 'ls' is not defined

Try

data1=data
data1 += data3
data1 += data5

?