Skip to content

Commit c5bfec2

Browse files
committed
refactor: remove redundant path assignment in _get_nframes method
1 parent 6cb6435 commit c5bfec2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

deepmd/utils/data.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -583,11 +583,10 @@ def _shuffle_data(self, data: dict[str, Any]) -> dict[str, Any]:
583583
def _get_nframes(self, set_name: Union[DPPath, str]) -> int:
584584
if not isinstance(set_name, DPPath):
585585
set_name = DPPath(set_name)
586+
path = set_name / "coord.npy"
586587
if isinstance(set_name, DPH5Path):
587-
path = set_name / "coord.npy"
588588
nframes = path.root[path._name].shape[0]
589589
else:
590-
path = set_name / "coord.npy"
591590
# Read only the header to get shape
592591
with open(str(path), "rb") as f:
593592
version = np.lib.format.read_magic(f)

0 commit comments

Comments
 (0)