r2gg 2.2.4__tar.gz → 2.2.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. {r2gg-2.2.4 → r2gg-2.2.6}/PKG-INFO +1 -1
  2. {r2gg-2.2.4 → r2gg-2.2.6}/r2gg/__about__.py +1 -1
  3. {r2gg-2.2.4 → r2gg-2.2.6}/r2gg/_main.py +8 -4
  4. {r2gg-2.2.4 → r2gg-2.2.6}/r2gg/_subprocess_execution.py +11 -1
  5. {r2gg-2.2.4 → r2gg-2.2.6}/r2gg.egg-info/PKG-INFO +1 -1
  6. {r2gg-2.2.4 → r2gg-2.2.6}/LICENSE +0 -0
  7. {r2gg-2.2.4 → r2gg-2.2.6}/README.md +0 -0
  8. {r2gg-2.2.4 → r2gg-2.2.6}/r2gg/__init__.py +0 -0
  9. {r2gg-2.2.4 → r2gg-2.2.6}/r2gg/_configure.py +0 -0
  10. {r2gg-2.2.4 → r2gg-2.2.6}/r2gg/_file_copier.py +0 -0
  11. {r2gg-2.2.4 → r2gg-2.2.6}/r2gg/_lua_builder.py +0 -0
  12. {r2gg-2.2.4 → r2gg-2.2.6}/r2gg/_osm_building.py +0 -0
  13. {r2gg-2.2.4 → r2gg-2.2.6}/r2gg/_osm_to_pbf.py +0 -0
  14. {r2gg-2.2.4 → r2gg-2.2.6}/r2gg/_output_costs_from_costs_config.py +0 -0
  15. {r2gg-2.2.4 → r2gg-2.2.6}/r2gg/_path_converter.py +0 -0
  16. {r2gg-2.2.4 → r2gg-2.2.6}/r2gg/_pivot_to_osm.py +0 -0
  17. {r2gg-2.2.4 → r2gg-2.2.6}/r2gg/_pivot_to_pgr.py +0 -0
  18. {r2gg-2.2.4 → r2gg-2.2.6}/r2gg/_read_config.py +0 -0
  19. {r2gg-2.2.4 → r2gg-2.2.6}/r2gg/_sql_building.py +0 -0
  20. {r2gg-2.2.4 → r2gg-2.2.6}/r2gg/_valhalla_lua_builder.py +0 -0
  21. {r2gg-2.2.4 → r2gg-2.2.6}/r2gg/cli.py +0 -0
  22. {r2gg-2.2.4 → r2gg-2.2.6}/r2gg.egg-info/SOURCES.txt +0 -0
  23. {r2gg-2.2.4 → r2gg-2.2.6}/r2gg.egg-info/dependency_links.txt +0 -0
  24. {r2gg-2.2.4 → r2gg-2.2.6}/r2gg.egg-info/entry_points.txt +0 -0
  25. {r2gg-2.2.4 → r2gg-2.2.6}/r2gg.egg-info/requires.txt +0 -0
  26. {r2gg-2.2.4 → r2gg-2.2.6}/r2gg.egg-info/top_level.txt +0 -0
  27. {r2gg-2.2.4 → r2gg-2.2.6}/setup.cfg +0 -0
  28. {r2gg-2.2.4 → r2gg-2.2.6}/setup.py +0 -0
  29. {r2gg-2.2.4 → r2gg-2.2.6}/tests/test_cli.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: r2gg
3
- Version: 2.2.4
3
+ Version: 2.2.6
4
4
  Summary: Route Graph Generator (r2gg) est un script Python qui permet la génération de graphes pour des moteurs de calcul d'itinéraire
5
5
  Home-page: https://github.com/IGNF/route-graph-generator/
6
6
  Author: IGNF
@@ -34,7 +34,7 @@ __uri_repository__ = "https://github.com/IGNF/route-graph-generator/"
34
34
  __uri_tracker__ = f"{__uri_repository__}issues/"
35
35
  __uri__ = __uri_repository__
36
36
 
37
- __version__ = "2.2.4"
37
+ __version__ = "2.2.6"
38
38
  __version_info__ = tuple(
39
39
  [
40
40
  int(num) if num.isdigit() else num
@@ -407,16 +407,20 @@ def valhalla_convert(config, resource, logger, build_lua_from_cost_config = True
407
407
  start_command = time.time()
408
408
  valhalla_build_config_args = ["valhalla_build_config",
409
409
  "--mjolnir-tile-dir", source["storage"]["dir"],
410
- "--mjolnir-tile-extract", source["storage"]["tar"]]
410
+ "--mjolnir-tile-extract", source["storage"]["tar"],
411
+ # Modification des limites par défaut du service : 10h pour isochrone et 1000km pour iso distance
412
+ # contre 2h et 200km par défaut
413
+ "--service-limits-isochrone-max-time-contour", "600",
414
+ "--service-limits-isochrone-max-distance-contour", "1000",
415
+ # Ajout de l'autorisation à exclure les ponts/tunnels/péages
416
+ "--service-limits-allow-hard-exclusions", "True"]
411
417
  subprocess_execution(valhalla_build_config_args, logger, outfile = source["storage"]["config"])
412
418
  # Nécessaire le temps que le fichier s'écrive...
413
419
  time.sleep(1)
414
- # Ajout du graph custom dans la config valhalla
420
+ # Ajout du graph custom dans la config valhalla (impossible via les paramètres du build_config)
415
421
  with open(source["storage"]["config"], "r") as valhalla_config:
416
422
  config_dict = json.load(valhalla_config)
417
423
  config_dict["mjolnir"]["graph_lua_name"] = source["costs"][0]["compute"]["storage"]["file"]
418
- # Ajout de l'autorisation à exclure les ponts/tunnels/péages
419
- config_dict["service_limits"]["allow_hard_exclusions"] = True
420
424
 
421
425
  with open(source["storage"]["config"], "w") as valhalla_config:
422
426
  valhalla_config.write(json.dumps(config_dict))
@@ -14,7 +14,8 @@ def subprocess_execution(args, logger, outfile = None):
14
14
  """
15
15
  try:
16
16
  str_args = [str(arg) for arg in args]
17
- logger.info('Subprocess: \"' + " ".join(str_args) + '\"')
17
+ subprocess_arg = " ".join(str_args)
18
+ logger.info('Subprocess: \"' + subprocess_arg + '\"')
18
19
  if outfile is not None:
19
20
  with open(outfile, "w") as out:
20
21
  process = subprocess.Popen(
@@ -32,6 +33,15 @@ def subprocess_execution(args, logger, outfile = None):
32
33
  process_output, _ = process.communicate()
33
34
  logger.info(process_output.decode("utf-8"))
34
35
 
36
+ # Wait for process stop
37
+ while process.returncode is None:
38
+ process.wait()
39
+
40
+ if process.returncode != 0:
41
+ error_msg = f"Invalid returncode {process.returncode} for subprocess '{subprocess_arg}'"
42
+ logger.error(error_msg)
43
+ raise RuntimeError(error_msg)
44
+
35
45
 
36
46
  except (OSError, subprocess.CalledProcessError) as exception:
37
47
  logger.info('Exception occured: ' + str(exception))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: r2gg
3
- Version: 2.2.4
3
+ Version: 2.2.6
4
4
  Summary: Route Graph Generator (r2gg) est un script Python qui permet la génération de graphes pour des moteurs de calcul d'itinéraire
5
5
  Home-page: https://github.com/IGNF/route-graph-generator/
6
6
  Author: IGNF
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes