Skip to content

Commit 24fec27

Browse files
committed
good
1 parent 1181e23 commit 24fec27

File tree

5 files changed

+13
-2
lines changed

5 files changed

+13
-2
lines changed

generate_data.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,27 @@
33
from pathlib import Path
44
from src.data_parse import DataParser
55

6+
def remove_duplicates_preserve_order(seq):
7+
seen = set()
8+
result = []
9+
for item in seq:
10+
name = Path(item).name
11+
if name not in seen:
12+
seen.add(name)
13+
result.append(name)
14+
return result
15+
616
if __name__ == '__main__':
717
parser = argparse.ArgumentParser()
818
parser.add_argument('runtime_templates', type=str, nargs='+', help='list of log directories (e.g., log1 log2 log3)')
919
parser.add_argument('--subgraphs-only', action='store_true', help='had previously parsed the debug file, only generate subgraphs')
1020
args = parser.parse_args()
1121

22+
deduped_names = remove_duplicates_preserve_order(args.runtime_templates)
23+
1224
root_dir = os.path.join(os.getcwd(), 'logs')
13-
full_paths = [os.path.join(root_dir, Path(rt).name) for rt in args.runtime_templates]
25+
full_paths = [os.path.join(root_dir, name) for name in deduped_names]
1426

15-
# verify all paths exist
1627
missing = [p for p in full_paths if not os.path.exists(p)]
1728
if missing:
1829
print("❌ The following log directories do not exist:")
1.53 KB
Binary file not shown.
0 Bytes
Binary file not shown.
342 Bytes
Binary file not shown.
141 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)