Skip to content

Commit 3052a78

Browse files
committed
refactor: update type hint for _get_nframes method to use Union
1 parent f337168 commit 3052a78

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

deepmd/utils/data.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from typing import (
1515
Any,
1616
Optional,
17+
Union,
1718
)
1819

1920
import numpy as np
@@ -583,7 +584,7 @@ def _shuffle_data(self, data: dict[str, Any]) -> dict[str, Any]:
583584
ret[kk] = data[kk]
584585
return ret, idx
585586

586-
def _get_nframes(self, set_name: DPPath | str) -> int:
587+
def _get_nframes(self, set_name: Union[DPPath, str]) -> int:
587588
if not isinstance(set_name, DPPath):
588589
set_name = DPPath(set_name)
589590
if isinstance(set_name, DPH5Path):

0 commit comments

Comments
 (0)