r5py 1.0.1__tar.gz → 1.0.2__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.

Potentially problematic release.


This version of r5py might be problematic. Click here for more details.

Files changed (119) hide show
  1. r5py-1.0.2/MANIFEST.in +3 -0
  2. {r5py-1.0.1/src/r5py.egg-info → r5py-1.0.2}/PKG-INFO +1 -1
  3. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/__init__.py +1 -1
  4. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/r5/__init__.py +0 -2
  5. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/r5/regional_task.py +0 -31
  6. {r5py-1.0.1 → r5py-1.0.2/src/r5py.egg-info}/PKG-INFO +1 -1
  7. {r5py-1.0.1 → r5py-1.0.2}/src/r5py.egg-info/SOURCES.txt +40 -3
  8. r5py-1.0.2/tests/__init__.py +3 -0
  9. r5py-1.0.2/tests/conftest.py +13 -0
  10. r5py-1.0.2/tests/conftest_d/__init__.py +148 -0
  11. r5py-1.0.2/tests/conftest_d/data_directory.py +8 -0
  12. r5py-1.0.2/tests/conftest_d/destinations.py +83 -0
  13. r5py-1.0.2/tests/conftest_d/file_digest.py +48 -0
  14. r5py-1.0.2/tests/conftest_d/garbage_collection.py +14 -0
  15. r5py-1.0.2/tests/conftest_d/origins.py +72 -0
  16. r5py-1.0.2/tests/conftest_d/r5_jar.py +57 -0
  17. r5py-1.0.2/tests/conftest_d/routing_parameters.py +33 -0
  18. r5py-1.0.2/tests/conftest_d/routing_results.py +141 -0
  19. r5py-1.0.2/tests/conftest_d/sample_data.py +25 -0
  20. r5py-1.0.2/tests/conftest_d/transport_network.py +98 -0
  21. r5py-1.0.2/tests/conftest_d/upstream_r5.py +19 -0
  22. r5py-1.0.2/tests/data/test_detailed_itineraries_bicycle.gpkg.zip +0 -0
  23. r5py-1.0.2/tests/data/test_detailed_itineraries_car.gpkg.zip +0 -0
  24. r5py-1.0.2/tests/data/test_detailed_itineraries_transit.gpkg.zip +0 -0
  25. r5py-1.0.2/tests/data/test_detailed_itineraries_walk.gpkg.zip +0 -0
  26. r5py-1.0.2/tests/data/test_invalid_points_duplicate_ids.geojson +10 -0
  27. r5py-1.0.2/tests/data/test_invalid_points_no_id_column.geojson +11 -0
  28. r5py-1.0.2/tests/data/test_isochrones_bicycle.gpkg.zip +0 -0
  29. r5py-1.0.2/tests/data/test_isochrones_car.gpkg.zip +0 -0
  30. r5py-1.0.2/tests/data/test_isochrones_from_multiple_origins.gpkg.zip +0 -0
  31. r5py-1.0.2/tests/data/test_isochrones_transit.gpkg.zip +0 -0
  32. r5py-1.0.2/tests/data/test_isochrones_walk.gpkg.zip +0 -0
  33. r5py-1.0.2/tests/data/test_multiple_origins.geojson +10 -0
  34. r5py-1.0.2/tests/data/test_snapped_population_grid_centroids.geojson +98 -0
  35. r5py-1.0.2/tests/data/test_travel_times_bicycle.csv +362 -0
  36. r5py-1.0.2/tests/data/test_travel_times_car.csv +362 -0
  37. r5py-1.0.2/tests/data/test_travel_times_transit.csv +362 -0
  38. r5py-1.0.2/tests/data/test_travel_times_walk.csv +362 -0
  39. r5py-1.0.2/tests/data/test_valid_points_data.geojson +11 -0
  40. r5py-1.0.2/tests/data/test_valid_single_point_data.geojson +7 -0
  41. r5py-1.0.2/tests/data/test_walking_details_not_snapped.csv +362 -0
  42. r5py-1.0.2/tests/data/test_walking_details_snapped.csv +362 -0
  43. r5py-1.0.2/tests/data/test_walking_times_not_snapped.csv +8465 -0
  44. r5py-1.0.2/tests/data/test_walking_times_snapped.csv +8465 -0
  45. r5py-1.0.2/tests/temporary_directory.py +32 -0
  46. {r5py-1.0.1 → r5py-1.0.2}/tests/test_regional_task.py +17 -11
  47. r5py-1.0.1/src/r5py/r5/breakdown_stat.py +0 -26
  48. r5py-1.0.1/tests/test_breakdownstats.py +0 -30
  49. {r5py-1.0.1 → r5py-1.0.2}/LICENSE +0 -0
  50. {r5py-1.0.1 → r5py-1.0.2}/README.md +0 -0
  51. {r5py-1.0.1 → r5py-1.0.2}/pyproject.toml +0 -0
  52. {r5py-1.0.1 → r5py-1.0.2}/setup.cfg +0 -0
  53. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/__main__.py +0 -0
  54. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/r5/access_leg.py +0 -0
  55. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/r5/base_travel_time_matrix.py +0 -0
  56. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/r5/detailed_itineraries.py +0 -0
  57. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/r5/direct_leg.py +0 -0
  58. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/r5/egress_leg.py +0 -0
  59. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/r5/isochrones.py +0 -0
  60. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/r5/scenario.py +0 -0
  61. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/r5/street_layer.py +0 -0
  62. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/r5/street_segment.py +0 -0
  63. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/r5/transfer_leg.py +0 -0
  64. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/r5/transit_layer.py +0 -0
  65. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/r5/transit_leg.py +0 -0
  66. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/r5/transport_mode.py +0 -0
  67. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/r5/transport_network.py +0 -0
  68. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/r5/travel_time_matrix.py +0 -0
  69. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/r5/trip.py +0 -0
  70. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/r5/trip_leg.py +0 -0
  71. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/r5/trip_planner.py +0 -0
  72. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/util/__init__.py +0 -0
  73. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/util/camel_to_snake_case.py +0 -0
  74. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/util/classpath.py +0 -0
  75. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/util/config.py +0 -0
  76. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/util/contains_gtfs_data.py +0 -0
  77. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/util/data_validation.py +0 -0
  78. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/util/environment.py +0 -0
  79. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/util/exceptions.py +0 -0
  80. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/util/file_digest.py +0 -0
  81. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/util/good_enough_equidistant_crs.py +0 -0
  82. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/util/jvm.py +0 -0
  83. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/util/memory_footprint.py +0 -0
  84. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/util/parse_int_date.py +0 -0
  85. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/util/sample_data_set.py +0 -0
  86. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/util/snake_to_camel_case.py +0 -0
  87. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/util/spatially_clustered_geodataframe.py +0 -0
  88. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/util/validating_requests_session.py +0 -0
  89. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/util/warnings.py +0 -0
  90. {r5py-1.0.1 → r5py-1.0.2}/src/r5py/util/working_copy.py +0 -0
  91. {r5py-1.0.1 → r5py-1.0.2}/src/r5py.egg-info/dependency_links.txt +0 -0
  92. {r5py-1.0.1 → r5py-1.0.2}/src/r5py.egg-info/requires.txt +0 -0
  93. {r5py-1.0.1 → r5py-1.0.2}/src/r5py.egg-info/top_level.txt +0 -0
  94. {r5py-1.0.1 → r5py-1.0.2}/tests/test_camel_to_snake_case.py +0 -0
  95. {r5py-1.0.1 → r5py-1.0.2}/tests/test_classpath.py +0 -0
  96. {r5py-1.0.1 → r5py-1.0.2}/tests/test_config.py +0 -0
  97. {r5py-1.0.1 → r5py-1.0.2}/tests/test_contains_gtfs_data.py +0 -0
  98. {r5py-1.0.1 → r5py-1.0.2}/tests/test_data_validation.py +0 -0
  99. {r5py-1.0.1 → r5py-1.0.2}/tests/test_detailed_itineraries.py +0 -0
  100. {r5py-1.0.1 → r5py-1.0.2}/tests/test_deterministic_behaviour.py +0 -0
  101. {r5py-1.0.1 → r5py-1.0.2}/tests/test_file_digest.py +0 -0
  102. {r5py-1.0.1 → r5py-1.0.2}/tests/test_good_enough_equidistant_crs.py +0 -0
  103. {r5py-1.0.1 → r5py-1.0.2}/tests/test_isochrones.py +0 -0
  104. {r5py-1.0.1 → r5py-1.0.2}/tests/test_java_casting.py +0 -0
  105. {r5py-1.0.1 → r5py-1.0.2}/tests/test_memory_footprint.py +0 -0
  106. {r5py-1.0.1 → r5py-1.0.2}/tests/test_parse_int_date.py +0 -0
  107. {r5py-1.0.1 → r5py-1.0.2}/tests/test_sample_data_set.py +0 -0
  108. {r5py-1.0.1 → r5py-1.0.2}/tests/test_snake_to_camel_case.py +0 -0
  109. {r5py-1.0.1 → r5py-1.0.2}/tests/test_street_layer.py +0 -0
  110. {r5py-1.0.1 → r5py-1.0.2}/tests/test_transit_layer.py +0 -0
  111. {r5py-1.0.1 → r5py-1.0.2}/tests/test_transport_mode.py +0 -0
  112. {r5py-1.0.1 → r5py-1.0.2}/tests/test_transport_network.py +0 -0
  113. {r5py-1.0.1 → r5py-1.0.2}/tests/test_travel_time_matrix.py +0 -0
  114. {r5py-1.0.1 → r5py-1.0.2}/tests/test_trip.py +0 -0
  115. {r5py-1.0.1 → r5py-1.0.2}/tests/test_trip_leg.py +0 -0
  116. {r5py-1.0.1 → r5py-1.0.2}/tests/test_trip_planner.py +0 -0
  117. {r5py-1.0.1 → r5py-1.0.2}/tests/test_validating_request_session.py +0 -0
  118. {r5py-1.0.1 → r5py-1.0.2}/tests/test_verbose_warnings.py +0 -0
  119. {r5py-1.0.1 → r5py-1.0.2}/tests/test_working_directory.py +0 -0
r5py-1.0.2/MANIFEST.in ADDED
@@ -0,0 +1,3 @@
1
+ recursive-include tests *.py
2
+ recursive-include tests/data *
3
+ global-exclude *.pyc
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: r5py
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: Python wrapper for the R5 routing analysis engine
5
5
  Author: Christoph Fink, Willem Klumpenhouwer, Marcus Sairava, Rafael Pereira, Henrikki Tenkanen
6
6
  License: GPL-3.0-or-later or MIT
@@ -2,7 +2,7 @@
2
2
 
3
3
  """Python wrapper for the R5 routing analysis engine."""
4
4
 
5
- __version__ = "1.0.1"
5
+ __version__ = "1.0.2"
6
6
 
7
7
 
8
8
  from .r5 import (
@@ -3,7 +3,6 @@
3
3
  """R5 classes."""
4
4
 
5
5
  from .access_leg import AccessLeg
6
- from .breakdown_stat import BreakdownStat
7
6
  from .detailed_itineraries import DetailedItineraries, DetailedItinerariesComputer
8
7
  from .direct_leg import DirectLeg
9
8
  from .egress_leg import EgressLeg
@@ -21,7 +20,6 @@ from .trip_planner import TripPlanner
21
20
 
22
21
  __all__ = [
23
22
  "AccessLeg",
24
- "BreakdownStat",
25
23
  "DetailedItineraries",
26
24
  "DetailedItinerariesComputer",
27
25
  "DirectLeg",
@@ -45,7 +45,6 @@ class RegionalTask:
45
45
  speed_cycling=12.0,
46
46
  max_public_transport_rides=8,
47
47
  max_bicycle_traffic_stress=3,
48
- breakdown=False,
49
48
  ):
50
49
  """
51
50
  Create a RegionalTask, a computing request for R5.
@@ -110,8 +109,6 @@ class RegionalTask:
110
109
  max_bicycle_traffic_stress : int
111
110
  Maximum stress level for cyclist routing, ranges from 1-4 see
112
111
  https://docs.conveyal.com/learn-more/traffic-stress Default: 3
113
- breakdown : bool
114
- Compute a more detailed breakdown of the routes. Default: False
115
112
  """
116
113
  self._regional_task = com.conveyal.r5.analyst.cluster.RegionalTask()
117
114
  self.scenario = Scenario()
@@ -149,8 +146,6 @@ class RegionalTask:
149
146
 
150
147
  # always record travel times
151
148
  self._regional_task.recordTimes = True
152
- # also report paths, if `breakdown`
153
- self.breakdown = breakdown
154
149
 
155
150
  # a few settings we don’t expose (yet?)
156
151
  self._regional_task.makeTauiSite = False
@@ -185,32 +180,6 @@ class RegionalTask:
185
180
  access_modes, com.conveyal.r5.api.util.LegMode
186
181
  )
187
182
 
188
- @property
189
- def breakdown(self):
190
- """Compute a more detailed breakdown of the routes."""
191
- return self._breakdown
192
-
193
- @breakdown.setter
194
- def breakdown(self, breakdown):
195
- self._breakdown = breakdown
196
- self._regional_task.includePathResults = breakdown
197
-
198
- # R5 has a maximum number of destinations for which it returns detailed
199
- # information, and it’s set to 5000 by default.
200
- # The value is a static property of com.conveyal.r5.analyst.cluster.PathResult;
201
- # static properites of Java classes can be modified in a singleton kind of way
202
- try:
203
- num_destinations = len(self.destinations)
204
- except AttributeError:
205
- num_destinations = 0
206
- if (
207
- num_destinations
208
- > com.conveyal.r5.analyst.cluster.PathResult.MAX_PATH_DESTINATIONS
209
- ):
210
- com.conveyal.r5.analyst.cluster.PathResult.MAX_PATH_DESTINATIONS = (
211
- num_destinations + 1
212
- )
213
-
214
183
  @property
215
184
  def departure(self):
216
185
  """Find public transport connections leaving within ``departure_time_window`` after ``departure`` (datetime.datetime)."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: r5py
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: Python wrapper for the R5 routing analysis engine
5
5
  Author: Christoph Fink, Willem Klumpenhouwer, Marcus Sairava, Rafael Pereira, Henrikki Tenkanen
6
6
  License: GPL-3.0-or-later or MIT
@@ -1,4 +1,5 @@
1
1
  LICENSE
2
+ MANIFEST.in
2
3
  README.md
3
4
  pyproject.toml
4
5
  src/r5py/__init__.py
@@ -11,7 +12,6 @@ src/r5py.egg-info/top_level.txt
11
12
  src/r5py/r5/__init__.py
12
13
  src/r5py/r5/access_leg.py
13
14
  src/r5py/r5/base_travel_time_matrix.py
14
- src/r5py/r5/breakdown_stat.py
15
15
  src/r5py/r5/detailed_itineraries.py
16
16
  src/r5py/r5/direct_leg.py
17
17
  src/r5py/r5/egress_leg.py
@@ -48,7 +48,9 @@ src/r5py/util/spatially_clustered_geodataframe.py
48
48
  src/r5py/util/validating_requests_session.py
49
49
  src/r5py/util/warnings.py
50
50
  src/r5py/util/working_copy.py
51
- tests/test_breakdownstats.py
51
+ tests/__init__.py
52
+ tests/conftest.py
53
+ tests/temporary_directory.py
52
54
  tests/test_camel_to_snake_case.py
53
55
  tests/test_classpath.py
54
56
  tests/test_config.py
@@ -75,4 +77,39 @@ tests/test_trip_leg.py
75
77
  tests/test_trip_planner.py
76
78
  tests/test_validating_request_session.py
77
79
  tests/test_verbose_warnings.py
78
- tests/test_working_directory.py
80
+ tests/test_working_directory.py
81
+ tests/conftest_d/__init__.py
82
+ tests/conftest_d/data_directory.py
83
+ tests/conftest_d/destinations.py
84
+ tests/conftest_d/file_digest.py
85
+ tests/conftest_d/garbage_collection.py
86
+ tests/conftest_d/origins.py
87
+ tests/conftest_d/r5_jar.py
88
+ tests/conftest_d/routing_parameters.py
89
+ tests/conftest_d/routing_results.py
90
+ tests/conftest_d/sample_data.py
91
+ tests/conftest_d/transport_network.py
92
+ tests/conftest_d/upstream_r5.py
93
+ tests/data/test_detailed_itineraries_bicycle.gpkg.zip
94
+ tests/data/test_detailed_itineraries_car.gpkg.zip
95
+ tests/data/test_detailed_itineraries_transit.gpkg.zip
96
+ tests/data/test_detailed_itineraries_walk.gpkg.zip
97
+ tests/data/test_invalid_points_duplicate_ids.geojson
98
+ tests/data/test_invalid_points_no_id_column.geojson
99
+ tests/data/test_isochrones_bicycle.gpkg.zip
100
+ tests/data/test_isochrones_car.gpkg.zip
101
+ tests/data/test_isochrones_from_multiple_origins.gpkg.zip
102
+ tests/data/test_isochrones_transit.gpkg.zip
103
+ tests/data/test_isochrones_walk.gpkg.zip
104
+ tests/data/test_multiple_origins.geojson
105
+ tests/data/test_snapped_population_grid_centroids.geojson
106
+ tests/data/test_travel_times_bicycle.csv
107
+ tests/data/test_travel_times_car.csv
108
+ tests/data/test_travel_times_transit.csv
109
+ tests/data/test_travel_times_walk.csv
110
+ tests/data/test_valid_points_data.geojson
111
+ tests/data/test_valid_single_point_data.geojson
112
+ tests/data/test_walking_details_not_snapped.csv
113
+ tests/data/test_walking_details_snapped.csv
114
+ tests/data/test_walking_times_not_snapped.csv
115
+ tests/data/test_walking_times_snapped.csv
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env python3
2
+
3
+ """Test the r5py package."""
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env python3
2
+
3
+ """Configuration and fixtures for testing r5py."""
4
+
5
+ # This is a init file common to all tests. It is automatically sourced
6
+ # by pytest et al.
7
+
8
+ # This file imports all files in the conftest.d directory
9
+
10
+ # Define common constants (e.g., paths to test data) and fixtures (e.g.,
11
+ # transport network) there and import the fixtures into conftest_d/__init__.py.
12
+
13
+ from .conftest_d import * # noqa: F401,F403
@@ -0,0 +1,148 @@
1
+ #!/usr/bin/env python3
2
+
3
+
4
+ """Fixtures to be used in r5py tests."""
5
+
6
+
7
+ from .destinations import (
8
+ population_grid,
9
+ population_grid_points,
10
+ population_grid_points_first_three,
11
+ population_grid_points_second_three,
12
+ population_grid_points_four,
13
+ snapped_population_grid_points,
14
+ unreachable_stops,
15
+ unsnappable_points,
16
+ )
17
+
18
+ from .file_digest import (
19
+ file_digest_test_file_as_pathlib_path,
20
+ file_digest_test_file_as_str,
21
+ file_digest_sha256,
22
+ file_digest_blake2b,
23
+ file_digest_blake2s,
24
+ )
25
+
26
+ from .garbage_collection import java_garbage_collection
27
+
28
+ from .origins import (
29
+ multiple_origins,
30
+ origin_point,
31
+ origins_invalid_duplicate_ids,
32
+ origins_invalid_no_id,
33
+ origins_valid_ids,
34
+ )
35
+
36
+ from .r5_jar import (
37
+ r5_jar_cached,
38
+ r5_jar_cached_invalid,
39
+ r5_jar_sha256,
40
+ r5_jar_sha256_github_error_message_when_posting,
41
+ r5_jar_sha256_invalid,
42
+ r5_jar_url,
43
+ )
44
+
45
+ from .routing_parameters import (
46
+ departure_datetime,
47
+ regional_task,
48
+ )
49
+
50
+ from .routing_results import (
51
+ detailed_itineraries_bicycle,
52
+ detailed_itineraries_car,
53
+ detailed_itineraries_transit,
54
+ detailed_itineraries_walk,
55
+ isochrones_from_multiple_origins,
56
+ isochrones_bicycle,
57
+ isochrones_car,
58
+ isochrones_transit,
59
+ isochrones_walk,
60
+ travel_times_bicycle,
61
+ travel_times_car,
62
+ travel_times_transit,
63
+ travel_times_walk,
64
+ walking_details_not_snapped,
65
+ walking_details_snapped,
66
+ walking_times_not_snapped,
67
+ walking_times_snapped,
68
+ )
69
+
70
+ from .sample_data import (
71
+ sample_data_set_sha256,
72
+ sample_data_set_url,
73
+ )
74
+
75
+ from .transport_network import (
76
+ gtfs_file_path,
77
+ gtfs_timezone_helsinki,
78
+ not_a_gtfs_file,
79
+ osm_pbf_file_path,
80
+ transport_network,
81
+ transport_network_files_tuple,
82
+ transport_network_from_test_directory,
83
+ transport_network_from_test_files,
84
+ transport_network_from_test_files_without_gtfs,
85
+ )
86
+
87
+ from .upstream_r5 import (
88
+ can_compute_detailed_route_geometries,
89
+ )
90
+
91
+ __all__ = [
92
+ "can_compute_detailed_route_geometries",
93
+ "departure_datetime",
94
+ "detailed_itineraries_bicycle",
95
+ "detailed_itineraries_car",
96
+ "detailed_itineraries_transit",
97
+ "detailed_itineraries_walk",
98
+ "file_digest_test_file_as_pathlib_path",
99
+ "file_digest_test_file_as_str",
100
+ "file_digest_sha256",
101
+ "file_digest_blake2b",
102
+ "file_digest_blake2s",
103
+ "java_garbage_collection",
104
+ "gtfs_file_path",
105
+ "gtfs_timezone_helsinki",
106
+ "isochrones_from_multiple_origins",
107
+ "isochrones_bicycle",
108
+ "isochrones_car",
109
+ "isochrones_transit",
110
+ "isochrones_walk",
111
+ "multiple_origins",
112
+ "not_a_gtfs_file",
113
+ "origin_point",
114
+ "origins_invalid_duplicate_ids",
115
+ "origins_invalid_no_id",
116
+ "origins_valid_ids",
117
+ "osm_pbf_file_path",
118
+ "population_grid",
119
+ "population_grid_points",
120
+ "population_grid_points_first_three",
121
+ "population_grid_points_four",
122
+ "population_grid_points_second_three",
123
+ "regional_task",
124
+ "r5_jar_cached",
125
+ "r5_jar_cached_invalid",
126
+ "r5_jar_sha256",
127
+ "r5_jar_sha256_github_error_message_when_posting",
128
+ "r5_jar_sha256_invalid",
129
+ "r5_jar_url",
130
+ "sample_data_set_sha256",
131
+ "sample_data_set_url",
132
+ "snapped_population_grid_points",
133
+ "transport_network",
134
+ "transport_network_files_tuple",
135
+ "transport_network_from_test_directory",
136
+ "transport_network_from_test_files",
137
+ "transport_network_from_test_files_without_gtfs",
138
+ "travel_times_bicycle",
139
+ "travel_times_car",
140
+ "travel_times_transit",
141
+ "travel_times_walk",
142
+ "unreachable_stops",
143
+ "unsnappable_points",
144
+ "walking_details_not_snapped",
145
+ "walking_details_snapped",
146
+ "walking_times_not_snapped",
147
+ "walking_times_snapped",
148
+ ]
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env python3
2
+
3
+
4
+ """Path to test data sets."""
5
+ import pathlib
6
+
7
+
8
+ DATA_DIRECTORY = pathlib.Path(__file__).resolve().parent.parent / "data"
@@ -0,0 +1,83 @@
1
+ #!/usr/bin/env python3
2
+
3
+
4
+ """Fixtures related to the destinations used in routing."""
5
+
6
+
7
+ import geopandas
8
+ import pytest
9
+ import shapely
10
+
11
+ from .data_directory import DATA_DIRECTORY
12
+
13
+
14
+ SNAPPED_POPULATION_GRID_POINTS = (
15
+ DATA_DIRECTORY / "test_snapped_population_grid_centroids.geojson"
16
+ )
17
+
18
+
19
+ @pytest.fixture(scope="session")
20
+ def population_grid():
21
+ """Load the grid point data set."""
22
+ import r5py.sampledata.helsinki
23
+
24
+ yield geopandas.read_file(r5py.sampledata.helsinki.population_grid)
25
+
26
+
27
+ @pytest.fixture(scope="session")
28
+ def population_grid_points(population_grid):
29
+ """Return the grid point data set in EPSG:4326."""
30
+ population_grid_points = population_grid.copy()
31
+ population_grid_points.geometry = population_grid_points.geometry.to_crs(
32
+ "EPSG:3067"
33
+ ).centroid.to_crs("EPSG:4326")
34
+ yield population_grid_points
35
+
36
+
37
+ @pytest.fixture(scope="session")
38
+ def population_grid_points_first_three(population_grid_points):
39
+ """Return the first set of three grid points."""
40
+ yield population_grid_points[0:3]
41
+
42
+
43
+ @pytest.fixture(scope="session")
44
+ def population_grid_points_second_three(population_grid_points):
45
+ """Return the second set of three grid points."""
46
+ yield population_grid_points[4:7]
47
+
48
+
49
+ @pytest.fixture(scope="session")
50
+ def population_grid_points_four(population_grid_points):
51
+ """Return four grid points."""
52
+ yield population_grid_points[10:14]
53
+
54
+
55
+ @pytest.fixture(scope="session")
56
+ def snapped_population_grid_points():
57
+ """Return a `geopandas.GeoDataFrame` that contains grid points snapped to the street network."""
58
+ yield geopandas.read_file(SNAPPED_POPULATION_GRID_POINTS)
59
+
60
+
61
+ @pytest.fixture
62
+ def unreachable_stops():
63
+ """Return a list of public transport stops that cannot be reached."""
64
+ yield [
65
+ 1294132,
66
+ 1174101,
67
+ 1452601,
68
+ ]
69
+
70
+
71
+ @pytest.fixture
72
+ def unsnappable_points():
73
+ """Retrieve a set of points that cannot be snapped to the sample data network."""
74
+ yield geopandas.GeoDataFrame(
75
+ {
76
+ "id": [1, 2],
77
+ "geometry": [
78
+ shapely.Point(48.20, 16.36), # far away from Helsinki
79
+ shapely.Point(-0.22, -78.51), # even further
80
+ ],
81
+ },
82
+ crs="EPSG:4326",
83
+ )
@@ -0,0 +1,48 @@
1
+ #!/usr/bin/env python3
2
+
3
+
4
+ """Fixtures describing the expected routing results."""
5
+
6
+
7
+ import pytest
8
+
9
+ from .routing_results import ISOCHRONES_WALK
10
+
11
+
12
+ ISOCHRONES_WALK_BLAKE2B = "5e91181cfdff18a3ebcf289eba1955b61b27260fa40d1cd669bb2f754c31b23b59ecd74ee9d3a31f2d51c9de32aff0781ff5c948eb4ea220b622525d94e6a625"
13
+ ISOCHRONES_WALK_BLAKE2S = (
14
+ "da098b9fcf440e7252b2b213160dd810392c03ee07c58ababfddf7d4c5d8d502"
15
+ )
16
+ ISOCHRONES_WALK_SHA256 = (
17
+ "2a444c35ef676928d2a70914c64e34c569b10a6473ee6d61c74d9740351d80cc"
18
+ )
19
+
20
+
21
+ @pytest.fixture
22
+ def file_digest_test_file_as_pathlib_path():
23
+ """Return the path of a test file as a pathlib.Path."""
24
+ yield ISOCHRONES_WALK
25
+
26
+
27
+ @pytest.fixture
28
+ def file_digest_test_file_as_str(file_digest_test_file_as_pathlib_path):
29
+ """Return the path of a test file as a str."""
30
+ yield f"{file_digest_test_file_as_pathlib_path}"
31
+
32
+
33
+ @pytest.fixture()
34
+ def file_digest_sha256():
35
+ """Return the expected SHA256 hash for the test file."""
36
+ yield ISOCHRONES_WALK_SHA256
37
+
38
+
39
+ @pytest.fixture()
40
+ def file_digest_blake2b():
41
+ """Return the expected BLAKE2B hash for the test file."""
42
+ yield ISOCHRONES_WALK_BLAKE2B
43
+
44
+
45
+ @pytest.fixture()
46
+ def file_digest_blake2s():
47
+ """Return the expected BLAKE2S hash for the test file."""
48
+ yield ISOCHRONES_WALK_BLAKE2S
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env python3
2
+
3
+
4
+ """An auto-use fixture that calls Java garbage collection before every function."""
5
+
6
+
7
+ import jpype
8
+ import pytest
9
+
10
+
11
+ @pytest.fixture(autouse=True, scope="function")
12
+ def java_garbage_collection():
13
+ """Call Java GC before every function."""
14
+ jpype.java.lang.System.gc()
@@ -0,0 +1,72 @@
1
+ #!/usr/bin/env python3
2
+
3
+
4
+ """Fixtures related to routing origins."""
5
+
6
+
7
+ import warnings
8
+
9
+ import geopandas
10
+ import pytest
11
+
12
+ from .data_directory import DATA_DIRECTORY
13
+
14
+
15
+ ORIGINS_INVALID_NO_ID = DATA_DIRECTORY / "test_invalid_points_no_id_column.geojson"
16
+ ORIGINS_INVALID_DUPLICATE_IDS = (
17
+ DATA_DIRECTORY / "test_invalid_points_duplicate_ids.geojson"
18
+ )
19
+ ORIGINS_VALID_IDS = DATA_DIRECTORY / "test_valid_points_data.geojson"
20
+ SINGLE_VALID_ORIGIN = DATA_DIRECTORY / "test_valid_single_point_data.geojson"
21
+ MULTIPLE_ORIGINS = DATA_DIRECTORY / "test_multiple_origins.geojson"
22
+
23
+
24
+ @pytest.fixture()
25
+ def origins_invalid_no_id():
26
+ """Return a set of origins that has missing ID values."""
27
+ origins = geopandas.read_file(ORIGINS_INVALID_NO_ID)
28
+ yield origins
29
+
30
+
31
+ @pytest.fixture()
32
+ def origins_invalid_duplicate_ids():
33
+ """Return a set of origins that has duplicate ID values."""
34
+ # Since geopandas 1.0, it uses pyogrio in the background. pyogrio seems to
35
+ # filter less of the underlying OGR warning messages than what fiona did.
36
+ # Because of that, a warning message bubbles up that states non-unique IDs
37
+ # were corrected (when they, factually, were not corrected)
38
+
39
+ # for this fixture, we want to have non-unique values in the "id" column, so
40
+ # let's ignore that warning
41
+
42
+ with warnings.catch_warnings():
43
+ warnings.filterwarnings(
44
+ "ignore",
45
+ category=RuntimeWarning,
46
+ message=(
47
+ "Several features with id = 1 have been found. Altering it to be "
48
+ "unique. This warning will not be emitted anymore for this layer"
49
+ ),
50
+ )
51
+ origins = geopandas.read_file(ORIGINS_INVALID_DUPLICATE_IDS)
52
+ yield origins
53
+
54
+
55
+ @pytest.fixture
56
+ def origin_point():
57
+ """Return one origin point."""
58
+ yield geopandas.read_file(SINGLE_VALID_ORIGIN)
59
+
60
+
61
+ @pytest.fixture()
62
+ def origins_valid_ids():
63
+ """Return a set of origins that has valid ID values."""
64
+ origins = geopandas.read_file(ORIGINS_VALID_IDS)
65
+ yield origins
66
+
67
+
68
+ @pytest.fixture()
69
+ def multiple_origins():
70
+ """Return a set of multiple origins."""
71
+ origins = geopandas.read_file(MULTIPLE_ORIGINS)
72
+ yield origins
@@ -0,0 +1,57 @@
1
+ #!/usr/bin/env python3
2
+
3
+
4
+ """Fixtures related to the R5 classpath."""
5
+
6
+
7
+ import pathlib
8
+
9
+ import pytest
10
+
11
+
12
+ R5_JAR_URL = (
13
+ "https://github.com/r5py/r5/releases/download/v7.3-r5py/r5-v7.3-r5py-all.jar"
14
+ )
15
+ R5_JAR_SHA256 = "cb1ccad370757ba229cf17f1bedc9549ff5d77fdbb44b7a3058104fe1f243f53"
16
+ R5_JAR_SHA256_INVALID = "adfadsfadsfadsfasdfasdf"
17
+ R5_JAR_SHA256_GITHUB_ERROR_MESSAGE_WHEN_POSTING = (
18
+ "14aa2347be79c280e4d0fd3a137fb8f5bf2863261a1e48e1a122df1a52a0f453"
19
+ )
20
+
21
+
22
+ @pytest.fixture(scope="session")
23
+ def r5_jar_cached():
24
+ """Return a cache path for the R5 jar."""
25
+ from r5py.util.config import Config
26
+
27
+ yield str(Config().CACHE_DIR / pathlib.Path(R5_JAR_URL).name)
28
+
29
+
30
+ @pytest.fixture
31
+ def r5_jar_cached_invalid():
32
+ """Return an invalid cache path for the R5 jar."""
33
+ yield "/definitely/invalid/path/to/r5.jar"
34
+
35
+
36
+ @pytest.fixture
37
+ def r5_jar_sha256():
38
+ """Return the SHA256 hash for the R5 jar."""
39
+ yield R5_JAR_SHA256
40
+
41
+
42
+ @pytest.fixture
43
+ def r5_jar_sha256_invalid():
44
+ """Return an invalid SHA256 hash for the R5 jar."""
45
+ yield R5_JAR_SHA256_INVALID
46
+
47
+
48
+ @pytest.fixture
49
+ def r5_jar_sha256_github_error_message_when_posting():
50
+ """Return the SHA256 hash of the GitHub error message when accidently POSTing."""
51
+ yield R5_JAR_SHA256_GITHUB_ERROR_MESSAGE_WHEN_POSTING
52
+
53
+
54
+ @pytest.fixture()
55
+ def r5_jar_url():
56
+ """Return the URL of the R5 jar."""
57
+ yield R5_JAR_URL
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env python3
2
+
3
+
4
+ """Fixtures related to regional tasks and routing parameters."""
5
+
6
+
7
+ import datetime
8
+
9
+ import pytest
10
+
11
+
12
+ @pytest.fixture(scope="session")
13
+ def departure_datetime():
14
+ """Return the departure time to run tests for."""
15
+ yield datetime.datetime(2022, 2, 22, 8, 30)
16
+
17
+
18
+ @pytest.fixture
19
+ def regional_task(
20
+ population_grid_points,
21
+ transport_network,
22
+ departure_datetime,
23
+ ):
24
+ """Return an initialised `r5py.RegionalTask`."""
25
+ import r5py
26
+
27
+ regional_task = r5py.RegionalTask(
28
+ transport_network,
29
+ population_grid_points.at[1, "geometry"],
30
+ population_grid_points,
31
+ departure=departure_datetime,
32
+ )
33
+ yield regional_task