Skip to content

Commit 95acf47

Browse files
committed
feat:when input system is a list, it will recurrsivly find subsystems
1 parent b970b81 commit 95acf47

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

deepmd/utils/data_system.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,7 @@ def process_systems(
790790
"""Process the user-input systems.
791791
792792
If it is a single directory, search for all the systems in the directory.
793+
If it is a list, each item can be either a system path or a directory to search.
793794
Check if the systems are valid.
794795
795796
Parameters
@@ -810,7 +811,15 @@ def process_systems(
810811
else:
811812
systems = rglob_sys_str(systems, patterns)
812813
elif isinstance(systems, list):
813-
systems = systems.copy()
814+
result_systems = []
815+
for system in systems:
816+
if isinstance(system, str):
817+
# Try to expand as directory
818+
expanded = expand_sys_str(system)
819+
result_systems.extend(expanded)
820+
else:
821+
result_systems.append(system)
822+
systems = result_systems
814823
return systems
815824

816825

0 commit comments

Comments
 (0)