MCPcopy Create free account
hub / github.com/comaps/comaps / run_routes_builder_tool

Function run_routes_builder_tool

tools/python/routing/run_comparison.py:11–47  ·  view source on GitHub ↗
(*, omim, config_ini, versions)

Source from the content-addressed store, hash-verified

9
10
11def run_routes_builder_tool(*, omim, config_ini, versions):
12 is_benchmark = config_ini.read_value_by_path(path=['TOOL', 'Benchmark'])
13 args = {
14 'resources_path': omim.data_path,
15 'routes_file': config_ini.read_value_by_path(path=['PATHS', 'RoutesFile']),
16 'threads': 1 if is_benchmark else utils.cpu_count(),
17 'timeout': config_ini.read_value_by_path(path=['TOOL', 'Timeout']),
18 'launches_number': config_ini.read_value_by_path(path=['TOOL', 'LaunchesNumber']) if is_benchmark else 1,
19 'vehicle_type': utils.get_vehicle_type(config_ini=config_ini)
20 }
21
22 data_from_routes_builder_tool = dict()
23
24 for version in versions:
25 name = version['name']
26 branch = version['branch']
27 hash = version['hash']
28
29 branch_hash = utils.get_branch_hash_name(branch=branch, hash=hash)
30 LOG.info(f'Get: {name} {branch_hash}')
31
32 omim.checkout(branch=branch, hash=hash)
33 omim.build(aim='routes_builder_tool', binary_cache_suffix='cpu' if is_benchmark else '')
34
35 args['dump_path'] = omim.get_or_create_unique_dir_path(
36 prefix_path=config_ini.read_value_by_path(path=['PATHS', 'ResultsSaveDir']))
37
38 args['data_path'] = version['mwm_path']
39
40 data_from_routes_builder_tool[branch_hash] = args.copy()
41
42 utils.log_with_stars('CPP Logs')
43 omim.run(binary='routes_builder_tool', binary_cache_suffix='cpu' if is_benchmark else '', args=args)
44
45 LOG.info(os.linesep, os.linesep)
46
47 return data_from_routes_builder_tool
48
49
50def run_routing_quality_tool(*, omim, config_ini, old_versions, new_versions, data_from_routes_builder_tool):

Callers 1

mainFunction · 0.85

Calls 5

read_value_by_pathMethod · 0.80
checkoutMethod · 0.80
buildMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected