MCPcopy Create free account
hub / github.com/Thinklab-SJTU/Bench2Drive / main

Function main

tools/split_xml.py:8–18  ·  view source on GitHub ↗
(base_route, task_num, algo, planner_type)

Source from the content-addressed store, hash-verified

6 return (lst[i * k + min(i, m):(i + 1) * k + min(i + 1, m)] for i in range(n))
7
8def main(base_route, task_num, algo, planner_type):
9 tree = ET.parse(f'{base_route}.xml')
10 root = tree.getroot()
11 case = root.findall('route')
12 results = split_list_into_n_parts(case, task_num)
13 for index, re in enumerate(results):
14 new_root = ET.Element("routes")
15 for x in re:
16 new_root.append(x)
17 new_tree = ET.ElementTree(new_root)
18 new_tree.write(f'{base_route}_{index}_{algo}_{planner_type}.xml', encoding='utf-8', xml_declaration=True)
19
20if __name__ == '__main__':
21 import argparse

Callers 1

split_xml.pyFile · 0.70

Calls 2

split_list_into_n_partsFunction · 0.85
writeMethod · 0.45

Tested by

no test coverage detected