Skip to content

Commit ac3dbbc

Browse files
committed
bug fix
1 parent 96230a3 commit ac3dbbc

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

deepmd/utils/data.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,12 @@ def __init__(
139139
# set modifier
140140
self.modifier = modifier
141141
# calculate prefix sum for get_item method
142-
frames_list = [self._get_nframes(item) for item in self.dirs]
142+
frames_list = [
143+
self._load_set(item)["coord"].shape[0]
144+
if isinstance(item, DPH5Path)
145+
else self._get_nframes(item)
146+
for item in self.dirs
147+
]
143148
self.nframes = np.sum(frames_list)
144149
# The prefix sum stores the range of indices contained in each directory, which is needed by get_item method
145150
self.prefix_sum = np.cumsum(frames_list).tolist()

0 commit comments

Comments
 (0)