r5py 1.0.5__py3-none-any.whl → 1.0.7__py3-none-any.whl

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.

r5py/__init__.py CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  """Python wrapper for the R5 routing analysis engine."""
4
4
 
5
- __version__ = "1.0.5"
5
+ __version__ = "1.0.7"
6
6
 
7
7
 
8
8
  from .r5 import (
r5py/r5/regional_task.py CHANGED
@@ -38,9 +38,9 @@ class RegionalTask:
38
38
  access_modes=[TransportMode.WALK],
39
39
  egress_modes=None, # default: access_modes
40
40
  max_time=datetime.timedelta(hours=2),
41
- max_time_walking=datetime.timedelta(hours=2),
42
- max_time_cycling=datetime.timedelta(hours=2),
43
- max_time_driving=datetime.timedelta(hours=2),
41
+ max_time_walking=None,
42
+ max_time_cycling=None,
43
+ max_time_driving=None,
44
44
  speed_walking=3.6,
45
45
  speed_cycling=12.0,
46
46
  max_public_transport_rides=8,
@@ -90,7 +90,10 @@ class RegionalTask:
90
90
  egress_modes : list[r5py.TransportMode]
91
91
  Mode of transport from public transport stops. Default: access_modes
92
92
  max_time : datetime.timedelta
93
- Maximum trip duration. Default: 2 hours
93
+ Maximum trip duration. If any of ``max_time_walking``,
94
+ ``max_time_cycling``, or ``max_time_driving`` are set, ``max_time``
95
+ is increased to the maximum value of those, if it is lower.
96
+ Default: 2 hours
94
97
  max_time_walking : datetime.timedelta
95
98
  Maximum time spent walking, potentially including access and egress
96
99
  Default: max_time
@@ -128,15 +131,15 @@ class RegionalTask:
128
131
  self.percentiles = percentiles
129
132
 
130
133
  self.max_time = max_time
131
- self.max_time_walking = (
132
- max_time_walking if max_time_walking is not None else max_time
133
- )
134
134
  self.max_time_cycling = (
135
135
  max_time_cycling if max_time_cycling is not None else max_time
136
136
  )
137
137
  self.max_time_driving = (
138
138
  max_time_driving if max_time_driving is not None else max_time
139
139
  )
140
+ self.max_time_walking = (
141
+ max_time_walking if max_time_walking is not None else max_time
142
+ )
140
143
 
141
144
  self.speed_cycling = speed_cycling
142
145
  self.speed_walking = speed_walking
@@ -333,10 +336,29 @@ class RegionalTask:
333
336
  @max_time.setter
334
337
  def max_time(self, max_time):
335
338
  self._max_time = max_time
336
- max_time = int(max_time.total_seconds() / 60)
337
- self._regional_task.streetTime = max_time
338
- self._regional_task.maxTripDurationMinutes = max_time
339
- self._regional_task.maxCarTime = max_time
339
+
340
+ try:
341
+ max_time_cycling = self.max_time_cycling
342
+ if max_time_cycling > max_time:
343
+ max_time_cycling = max_time
344
+ except AttributeError:
345
+ pass
346
+ try:
347
+ max_time_driving = self.max_time_driving
348
+ if max_time_driving > max_time:
349
+ max_time_driving = max_time
350
+ except AttributeError:
351
+ pass
352
+ try:
353
+ max_time_walking = self.max_time_walking
354
+ if max_time_walking > max_time:
355
+ max_time_walking = max_time
356
+ except AttributeError:
357
+ pass
358
+
359
+ max_time_sec = int(max_time.total_seconds() / 60)
360
+ self._regional_task.streetTime = max_time_sec
361
+ self._regional_task.maxTripDurationMinutes = max_time_sec
340
362
 
341
363
  @property
342
364
  def max_time_cycling(self):
@@ -353,6 +375,9 @@ class RegionalTask:
353
375
  self._max_time_cycling = max_time_cycling
354
376
  self._regional_task.maxBikeTime = int(max_time_cycling.total_seconds() / 60)
355
377
 
378
+ if self.max_time < max_time_cycling:
379
+ self.max_time = max_time_cycling
380
+
356
381
  @property
357
382
  def max_time_driving(self):
358
383
  """Restrict routes to at most this duration of driving (datetime.timedelta)."""
@@ -363,6 +388,9 @@ class RegionalTask:
363
388
  self._max_time_driving = max_time_driving
364
389
  self._regional_task.maxCarTime = int(max_time_driving.total_seconds() / 60)
365
390
 
391
+ if self.max_time < max_time_driving:
392
+ self.max_time = max_time_driving
393
+
366
394
  @property
367
395
  def max_time_walking(self):
368
396
  """
@@ -378,6 +406,9 @@ class RegionalTask:
378
406
  self._max_time_walking = max_time_walking
379
407
  self._regional_task.maxWalkTime = int(max_time_walking.total_seconds() / 60)
380
408
 
409
+ if self.max_time < max_time_walking:
410
+ self.max_time = max_time_walking
411
+
381
412
  @property
382
413
  def percentiles(self):
383
414
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: r5py
3
- Version: 1.0.5
3
+ Version: 1.0.7
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
@@ -19,7 +19,7 @@ License-File: LICENSE
19
19
  Requires-Dist: ConfigArgParse
20
20
  Requires-Dist: filelock
21
21
  Requires-Dist: geohexgrid
22
- Requires-Dist: geopandas
22
+ Requires-Dist: geopandas<1.1.0
23
23
  Requires-Dist: joblib
24
24
  Requires-Dist: jpype1
25
25
  Requires-Dist: numpy
@@ -164,6 +164,6 @@ your project better.
164
164
  [r5-github]: https://github.com/conveyal/r5/
165
165
  [r5r-github]: https://github.com/ipeaGIT/r5r/
166
166
  [r5r-vignette]: https://ipeagit.github.io/r5r/
167
- [rtd-quickstart]: https://r5py.readthedocs.io/en/stable/user-guide/user-manual/quickstart.html
168
- [rtd-installation]: https://r5py.readthedocs.io/en/stable/user-guide/installation/installation.html
167
+ [rtd-quickstart]: https://r5py.readthedocs.io/stable/user-guide/user-manual/quickstart.html
168
+ [rtd-installation]: https://r5py.readthedocs.io/stable/user-guide/installation/installation.html
169
169
  [rtd-link]: https://r5py.readthedocs.io/
@@ -1,4 +1,4 @@
1
- r5py/__init__.py,sha256=1tPgrbMj7sfKn-uPq_7YhG9CLEMqAcdreD5ytUNBxXw,602
1
+ r5py/__init__.py,sha256=rykXr06acCvGQoCu5z10gCyf29zl7zS3YdASyUJ7HK0,602
2
2
  r5py/__main__.py,sha256=Wvn0ChD7E-dCSZ8b8k_HhHG0KMOk0qMNFkijGuSH3-0,81
3
3
  r5py/r5/__init__.py,sha256=ZvzhfO9jHbBsRon6cLjWg_gJWvC4L0rkJtmH5mIUlIg,1149
4
4
  r5py/r5/access_leg.py,sha256=W3GfPEpqmWD1c4xipd6UcVIaBC-yb6srGCZV30E2dPY,293
@@ -10,7 +10,7 @@ r5py/r5/elevation_cost_function.py,sha256=NXkwPRKZiotVugXQeOYLIgouQmKNx3juSAUi8G
10
10
  r5py/r5/elevation_model.py,sha256=tGXNzIlRt5fZvteCZ1XQYNby8RLxjzONzSp8k9q3GHs,2745
11
11
  r5py/r5/file_storage.py,sha256=wujo-IQyhJYsN7uxTemxNCKzt-pnL5zZgfyn7dZYaLY,1986
12
12
  r5py/r5/isochrones.py,sha256=NNpV3Df4NeLdDksGERkb2Eos33ziMBGEeaWyCKPt5P8,12974
13
- r5py/r5/regional_task.py,sha256=jpOoskx7Y-j-c4E-56uvJXiiuPYK3w28_FJsoGQLSbE,22062
13
+ r5py/r5/regional_task.py,sha256=OtPFI9wkDTh38MYY-tgOk_0YSPysgnGduEaymp0T_H0,23032
14
14
  r5py/r5/scenario.py,sha256=nUNAlN3cO7E_b4sMpNqdL0FD7WQaQ49iIvh-k8l4YRM,763
15
15
  r5py/r5/street_layer.py,sha256=2AWhIE0-aTNGQenX6bF1xv5bmhR_LV0CgqM4BKgVYfk,2329
16
16
  r5py/r5/street_segment.py,sha256=0O0QV8Eyfss-xHJShKGSQV1IusZfTrrxzu_AWl3KACo,1109
@@ -42,8 +42,8 @@ r5py/util/spatially_clustered_geodataframe.py,sha256=FxG8V3SSeK-PuCep565p1b3TNcl
42
42
  r5py/util/validating_requests_session.py,sha256=sH5FgpS9eGax5DG2qA2GrGuiwgTJgh8tKsZ9OiXKmvk,1807
43
43
  r5py/util/warnings.py,sha256=CvxKWKlNO_p3riB4SkNqbU5AGPsaY_3-OzqaBObE3B8,139
44
44
  r5py/util/working_copy.py,sha256=sbLbRCi39LtC-0tXxvh2y7ZN2D15chbhleCZXzHAFSc,1432
45
- r5py-1.0.5.dist-info/licenses/LICENSE,sha256=VAnuGDX1TPylSN9G2xLa-urDpj_SQwn-qqs068dx4tk,51
46
- r5py-1.0.5.dist-info/METADATA,sha256=gZw-LnQXOwdZur7nz04k6u06GjtbAL4Y7kD5MTBx6eo,10000
47
- r5py-1.0.5.dist-info/WHEEL,sha256=QZxptf4Y1BKFRCEDxD4h2V0mBFQOVFLFEpvxHmIs52A,91
48
- r5py-1.0.5.dist-info/top_level.txt,sha256=fOH1R85dkNDOI7jkg-lIsl5CQIO4fE5X868K9dTqs9U,5
49
- r5py-1.0.5.dist-info/RECORD,,
45
+ r5py-1.0.7.dist-info/licenses/LICENSE,sha256=VAnuGDX1TPylSN9G2xLa-urDpj_SQwn-qqs068dx4tk,51
46
+ r5py-1.0.7.dist-info/METADATA,sha256=vM03dnxpr9q75eiBHPtLcDrRwtX8tlJrhGrIaXPWQ3A,10000
47
+ r5py-1.0.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
48
+ r5py-1.0.7.dist-info/top_level.txt,sha256=fOH1R85dkNDOI7jkg-lIsl5CQIO4fE5X868K9dTqs9U,5
49
+ r5py-1.0.7.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.6.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5