google-maps-routeoptimization 0.1.2__tar.gz → 0.1.3__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.
- {google_maps_routeoptimization-0.1.2/google_maps_routeoptimization.egg-info → google_maps_routeoptimization-0.1.3}/PKG-INFO +1 -1
- {google_maps_routeoptimization-0.1.2 → google_maps_routeoptimization-0.1.3}/google/maps/routeoptimization/__init__.py +2 -0
- {google_maps_routeoptimization-0.1.2 → google_maps_routeoptimization-0.1.3}/google/maps/routeoptimization/gapic_version.py +1 -1
- {google_maps_routeoptimization-0.1.2 → google_maps_routeoptimization-0.1.3}/google/maps/routeoptimization_v1/__init__.py +2 -0
- {google_maps_routeoptimization-0.1.2 → google_maps_routeoptimization-0.1.3}/google/maps/routeoptimization_v1/gapic_version.py +1 -1
- {google_maps_routeoptimization-0.1.2 → google_maps_routeoptimization-0.1.3}/google/maps/routeoptimization_v1/services/route_optimization/async_client.py +14 -4
- {google_maps_routeoptimization-0.1.2 → google_maps_routeoptimization-0.1.3}/google/maps/routeoptimization_v1/services/route_optimization/client.py +14 -1
- {google_maps_routeoptimization-0.1.2 → google_maps_routeoptimization-0.1.3}/google/maps/routeoptimization_v1/services/route_optimization/transports/grpc.py +13 -0
- {google_maps_routeoptimization-0.1.2 → google_maps_routeoptimization-0.1.3}/google/maps/routeoptimization_v1/services/route_optimization/transports/grpc_asyncio.py +13 -0
- {google_maps_routeoptimization-0.1.2 → google_maps_routeoptimization-0.1.3}/google/maps/routeoptimization_v1/types/__init__.py +2 -0
- {google_maps_routeoptimization-0.1.2 → google_maps_routeoptimization-0.1.3}/google/maps/routeoptimization_v1/types/route_optimization_service.py +109 -13
- {google_maps_routeoptimization-0.1.2 → google_maps_routeoptimization-0.1.3/google_maps_routeoptimization.egg-info}/PKG-INFO +1 -1
- {google_maps_routeoptimization-0.1.2 → google_maps_routeoptimization-0.1.3}/tests/unit/gapic/routeoptimization_v1/test_route_optimization.py +16 -12
- {google_maps_routeoptimization-0.1.2 → google_maps_routeoptimization-0.1.3}/LICENSE +0 -0
- {google_maps_routeoptimization-0.1.2 → google_maps_routeoptimization-0.1.3}/MANIFEST.in +0 -0
- {google_maps_routeoptimization-0.1.2 → google_maps_routeoptimization-0.1.3}/README.rst +0 -0
- {google_maps_routeoptimization-0.1.2 → google_maps_routeoptimization-0.1.3}/google/maps/routeoptimization/py.typed +0 -0
- {google_maps_routeoptimization-0.1.2 → google_maps_routeoptimization-0.1.3}/google/maps/routeoptimization_v1/gapic_metadata.json +0 -0
- {google_maps_routeoptimization-0.1.2 → google_maps_routeoptimization-0.1.3}/google/maps/routeoptimization_v1/py.typed +0 -0
- {google_maps_routeoptimization-0.1.2 → google_maps_routeoptimization-0.1.3}/google/maps/routeoptimization_v1/services/__init__.py +0 -0
- {google_maps_routeoptimization-0.1.2 → google_maps_routeoptimization-0.1.3}/google/maps/routeoptimization_v1/services/route_optimization/__init__.py +0 -0
- {google_maps_routeoptimization-0.1.2 → google_maps_routeoptimization-0.1.3}/google/maps/routeoptimization_v1/services/route_optimization/transports/__init__.py +0 -0
- {google_maps_routeoptimization-0.1.2 → google_maps_routeoptimization-0.1.3}/google/maps/routeoptimization_v1/services/route_optimization/transports/base.py +0 -0
- {google_maps_routeoptimization-0.1.2 → google_maps_routeoptimization-0.1.3}/google/maps/routeoptimization_v1/services/route_optimization/transports/rest.py +0 -0
- {google_maps_routeoptimization-0.1.2 → google_maps_routeoptimization-0.1.3}/google_maps_routeoptimization.egg-info/SOURCES.txt +0 -0
- {google_maps_routeoptimization-0.1.2 → google_maps_routeoptimization-0.1.3}/google_maps_routeoptimization.egg-info/dependency_links.txt +0 -0
- {google_maps_routeoptimization-0.1.2 → google_maps_routeoptimization-0.1.3}/google_maps_routeoptimization.egg-info/not-zip-safe +0 -0
- {google_maps_routeoptimization-0.1.2 → google_maps_routeoptimization-0.1.3}/google_maps_routeoptimization.egg-info/requires.txt +0 -0
- {google_maps_routeoptimization-0.1.2 → google_maps_routeoptimization-0.1.3}/google_maps_routeoptimization.egg-info/top_level.txt +0 -0
- {google_maps_routeoptimization-0.1.2 → google_maps_routeoptimization-0.1.3}/setup.cfg +0 -0
- {google_maps_routeoptimization-0.1.2 → google_maps_routeoptimization-0.1.3}/setup.py +0 -0
- {google_maps_routeoptimization-0.1.2 → google_maps_routeoptimization-0.1.3}/tests/__init__.py +0 -0
- {google_maps_routeoptimization-0.1.2 → google_maps_routeoptimization-0.1.3}/tests/unit/__init__.py +0 -0
- {google_maps_routeoptimization-0.1.2 → google_maps_routeoptimization-0.1.3}/tests/unit/gapic/__init__.py +0 -0
- {google_maps_routeoptimization-0.1.2 → google_maps_routeoptimization-0.1.3}/tests/unit/gapic/routeoptimization_v1/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: google-maps-routeoptimization
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.3
|
|
4
4
|
Summary: Google Maps Routeoptimization API client library
|
|
5
5
|
Home-page: https://github.com/googleapis/google-cloud-python/tree/main/packages/google-maps-routeoptimization
|
|
6
6
|
Author: Google LLC
|
|
@@ -41,6 +41,7 @@ from google.maps.routeoptimization_v1.types.route_optimization_service import (
|
|
|
41
41
|
OptimizeToursResponse,
|
|
42
42
|
OptimizeToursValidationError,
|
|
43
43
|
OutputConfig,
|
|
44
|
+
RouteModifiers,
|
|
44
45
|
Shipment,
|
|
45
46
|
ShipmentModel,
|
|
46
47
|
ShipmentRoute,
|
|
@@ -71,6 +72,7 @@ __all__ = (
|
|
|
71
72
|
"OptimizeToursResponse",
|
|
72
73
|
"OptimizeToursValidationError",
|
|
73
74
|
"OutputConfig",
|
|
75
|
+
"RouteModifiers",
|
|
74
76
|
"Shipment",
|
|
75
77
|
"ShipmentModel",
|
|
76
78
|
"ShipmentRoute",
|
|
@@ -39,6 +39,7 @@ from .types.route_optimization_service import (
|
|
|
39
39
|
OptimizeToursResponse,
|
|
40
40
|
OptimizeToursValidationError,
|
|
41
41
|
OutputConfig,
|
|
42
|
+
RouteModifiers,
|
|
42
43
|
Shipment,
|
|
43
44
|
ShipmentModel,
|
|
44
45
|
ShipmentRoute,
|
|
@@ -69,6 +70,7 @@ __all__ = (
|
|
|
69
70
|
"OptimizeToursResponse",
|
|
70
71
|
"OptimizeToursValidationError",
|
|
71
72
|
"OutputConfig",
|
|
73
|
+
"RouteModifiers",
|
|
72
74
|
"RouteOptimizationClient",
|
|
73
75
|
"Shipment",
|
|
74
76
|
"ShipmentModel",
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
# limitations under the License.
|
|
15
15
|
#
|
|
16
16
|
from collections import OrderedDict
|
|
17
|
-
import functools
|
|
18
17
|
import re
|
|
19
18
|
from typing import (
|
|
20
19
|
Callable,
|
|
@@ -211,9 +210,7 @@ class RouteOptimizationAsyncClient:
|
|
|
211
210
|
"""
|
|
212
211
|
return self._client._universe_domain
|
|
213
212
|
|
|
214
|
-
get_transport_class =
|
|
215
|
-
type(RouteOptimizationClient).get_transport_class, type(RouteOptimizationClient)
|
|
216
|
-
)
|
|
213
|
+
get_transport_class = RouteOptimizationClient.get_transport_class
|
|
217
214
|
|
|
218
215
|
def __init__(
|
|
219
216
|
self,
|
|
@@ -413,6 +410,19 @@ class RouteOptimizationAsyncClient:
|
|
|
413
410
|
containing ``ShipmentRoute``\ s, which are a set of routes to be
|
|
414
411
|
performed by vehicles minimizing the overall cost.
|
|
415
412
|
|
|
413
|
+
The user can poll ``operations.get`` to check the status of the
|
|
414
|
+
LRO:
|
|
415
|
+
|
|
416
|
+
If the LRO's ``done`` field is false, then at least one request
|
|
417
|
+
is still being processed. Other requests may have completed
|
|
418
|
+
successfully and their results are available in GCS.
|
|
419
|
+
|
|
420
|
+
If the LRO's ``done`` field is true, then all requests have been
|
|
421
|
+
processed. Any successfully processed requests will have their
|
|
422
|
+
results available in GCS. Any requests that failed will not have
|
|
423
|
+
their results available in GCS. If the LRO's ``error`` field is
|
|
424
|
+
set, then it contains the error from one of the failed requests.
|
|
425
|
+
|
|
416
426
|
.. code-block:: python
|
|
417
427
|
|
|
418
428
|
# This snippet has been automatically generated and should be regarded as a
|
|
@@ -669,7 +669,7 @@ class RouteOptimizationClient(metaclass=RouteOptimizationClientMeta):
|
|
|
669
669
|
Type[RouteOptimizationTransport],
|
|
670
670
|
Callable[..., RouteOptimizationTransport],
|
|
671
671
|
] = (
|
|
672
|
-
|
|
672
|
+
RouteOptimizationClient.get_transport_class(transport)
|
|
673
673
|
if isinstance(transport, str) or transport is None
|
|
674
674
|
else cast(Callable[..., RouteOptimizationTransport], transport)
|
|
675
675
|
)
|
|
@@ -812,6 +812,19 @@ class RouteOptimizationClient(metaclass=RouteOptimizationClientMeta):
|
|
|
812
812
|
containing ``ShipmentRoute``\ s, which are a set of routes to be
|
|
813
813
|
performed by vehicles minimizing the overall cost.
|
|
814
814
|
|
|
815
|
+
The user can poll ``operations.get`` to check the status of the
|
|
816
|
+
LRO:
|
|
817
|
+
|
|
818
|
+
If the LRO's ``done`` field is false, then at least one request
|
|
819
|
+
is still being processed. Other requests may have completed
|
|
820
|
+
successfully and their results are available in GCS.
|
|
821
|
+
|
|
822
|
+
If the LRO's ``done`` field is true, then all requests have been
|
|
823
|
+
processed. Any successfully processed requests will have their
|
|
824
|
+
results available in GCS. Any requests that failed will not have
|
|
825
|
+
their results available in GCS. If the LRO's ``error`` field is
|
|
826
|
+
set, then it contains the error from one of the failed requests.
|
|
827
|
+
|
|
815
828
|
.. code-block:: python
|
|
816
829
|
|
|
817
830
|
# This snippet has been automatically generated and should be regarded as a
|
|
@@ -336,6 +336,19 @@ class RouteOptimizationGrpcTransport(RouteOptimizationTransport):
|
|
|
336
336
|
containing ``ShipmentRoute``\ s, which are a set of routes to be
|
|
337
337
|
performed by vehicles minimizing the overall cost.
|
|
338
338
|
|
|
339
|
+
The user can poll ``operations.get`` to check the status of the
|
|
340
|
+
LRO:
|
|
341
|
+
|
|
342
|
+
If the LRO's ``done`` field is false, then at least one request
|
|
343
|
+
is still being processed. Other requests may have completed
|
|
344
|
+
successfully and their results are available in GCS.
|
|
345
|
+
|
|
346
|
+
If the LRO's ``done`` field is true, then all requests have been
|
|
347
|
+
processed. Any successfully processed requests will have their
|
|
348
|
+
results available in GCS. Any requests that failed will not have
|
|
349
|
+
their results available in GCS. If the LRO's ``error`` field is
|
|
350
|
+
set, then it contains the error from one of the failed requests.
|
|
351
|
+
|
|
339
352
|
Returns:
|
|
340
353
|
Callable[[~.BatchOptimizeToursRequest],
|
|
341
354
|
~.Operation]:
|
|
@@ -343,6 +343,19 @@ class RouteOptimizationGrpcAsyncIOTransport(RouteOptimizationTransport):
|
|
|
343
343
|
containing ``ShipmentRoute``\ s, which are a set of routes to be
|
|
344
344
|
performed by vehicles minimizing the overall cost.
|
|
345
345
|
|
|
346
|
+
The user can poll ``operations.get`` to check the status of the
|
|
347
|
+
LRO:
|
|
348
|
+
|
|
349
|
+
If the LRO's ``done`` field is false, then at least one request
|
|
350
|
+
is still being processed. Other requests may have completed
|
|
351
|
+
successfully and their results are available in GCS.
|
|
352
|
+
|
|
353
|
+
If the LRO's ``done`` field is true, then all requests have been
|
|
354
|
+
processed. Any successfully processed requests will have their
|
|
355
|
+
results available in GCS. Any requests that failed will not have
|
|
356
|
+
their results available in GCS. If the LRO's ``error`` field is
|
|
357
|
+
set, then it contains the error from one of the failed requests.
|
|
358
|
+
|
|
346
359
|
Returns:
|
|
347
360
|
Callable[[~.BatchOptimizeToursRequest],
|
|
348
361
|
Awaitable[~.Operation]]:
|
|
@@ -30,6 +30,7 @@ from .route_optimization_service import (
|
|
|
30
30
|
OptimizeToursResponse,
|
|
31
31
|
OptimizeToursValidationError,
|
|
32
32
|
OutputConfig,
|
|
33
|
+
RouteModifiers,
|
|
33
34
|
Shipment,
|
|
34
35
|
ShipmentModel,
|
|
35
36
|
ShipmentRoute,
|
|
@@ -58,6 +59,7 @@ __all__ = (
|
|
|
58
59
|
"OptimizeToursResponse",
|
|
59
60
|
"OptimizeToursValidationError",
|
|
60
61
|
"OutputConfig",
|
|
62
|
+
"RouteModifiers",
|
|
61
63
|
"Shipment",
|
|
62
64
|
"ShipmentModel",
|
|
63
65
|
"ShipmentRoute",
|
|
@@ -35,6 +35,7 @@ __protobuf__ = proto.module(
|
|
|
35
35
|
"Shipment",
|
|
36
36
|
"ShipmentTypeIncompatibility",
|
|
37
37
|
"ShipmentTypeRequirement",
|
|
38
|
+
"RouteModifiers",
|
|
38
39
|
"Vehicle",
|
|
39
40
|
"TimeWindow",
|
|
40
41
|
"DistanceLimit",
|
|
@@ -382,7 +383,8 @@ class OptimizeToursRequest(proto.Message):
|
|
|
382
383
|
|
|
383
384
|
Values:
|
|
384
385
|
DEFAULT_SOLVE (0):
|
|
385
|
-
Solve the model.
|
|
386
|
+
Solve the model. Warnings may be issued in
|
|
387
|
+
[OptimizeToursResponse.validation_errors][google.cloud.optimization.v1.OptimizeToursResponse.validation_errors].
|
|
386
388
|
VALIDATE_ONLY (1):
|
|
387
389
|
Only validates the model without solving it: populates as
|
|
388
390
|
many
|
|
@@ -531,7 +533,8 @@ class OptimizeToursResponse(proto.Message):
|
|
|
531
533
|
detect independently. See the "MULTIPLE ERRORS" explanation
|
|
532
534
|
for the
|
|
533
535
|
[OptimizeToursValidationError][google.maps.routeoptimization.v1.OptimizeToursValidationError]
|
|
534
|
-
message.
|
|
536
|
+
message. Instead of errors, this will include warnings in
|
|
537
|
+
the case ``solving_mode`` is ``DEFAULT_SOLVE``.
|
|
535
538
|
metrics (google.maps.routeoptimization_v1.types.OptimizeToursResponse.Metrics):
|
|
536
539
|
Duration, distance and usage metrics for this
|
|
537
540
|
solution.
|
|
@@ -1524,6 +1527,53 @@ class ShipmentTypeRequirement(proto.Message):
|
|
|
1524
1527
|
)
|
|
1525
1528
|
|
|
1526
1529
|
|
|
1530
|
+
class RouteModifiers(proto.Message):
|
|
1531
|
+
r"""Encapsulates a set of optional conditions to satisfy when
|
|
1532
|
+
calculating vehicle routes. This is similar to ``RouteModifiers`` in
|
|
1533
|
+
the Google Maps Platform Routes Preferred API; see:
|
|
1534
|
+
https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteModifiers.
|
|
1535
|
+
|
|
1536
|
+
Attributes:
|
|
1537
|
+
avoid_tolls (bool):
|
|
1538
|
+
Specifies whether to avoid toll roads where
|
|
1539
|
+
reasonable. Preference will be given to routes
|
|
1540
|
+
not containing toll roads. Applies only to
|
|
1541
|
+
motorized travel modes.
|
|
1542
|
+
avoid_highways (bool):
|
|
1543
|
+
Specifies whether to avoid highways where
|
|
1544
|
+
reasonable. Preference will be given to routes
|
|
1545
|
+
not containing highways. Applies only to
|
|
1546
|
+
motorized travel modes.
|
|
1547
|
+
avoid_ferries (bool):
|
|
1548
|
+
Specifies whether to avoid ferries where
|
|
1549
|
+
reasonable. Preference will be given to routes
|
|
1550
|
+
not containing travel by ferries. Applies only
|
|
1551
|
+
to motorized travel modes.
|
|
1552
|
+
avoid_indoor (bool):
|
|
1553
|
+
Optional. Specifies whether to avoid navigating indoors
|
|
1554
|
+
where reasonable. Preference will be given to routes not
|
|
1555
|
+
containing indoor navigation. Applies only to the
|
|
1556
|
+
``WALKING`` travel mode.
|
|
1557
|
+
"""
|
|
1558
|
+
|
|
1559
|
+
avoid_tolls: bool = proto.Field(
|
|
1560
|
+
proto.BOOL,
|
|
1561
|
+
number=2,
|
|
1562
|
+
)
|
|
1563
|
+
avoid_highways: bool = proto.Field(
|
|
1564
|
+
proto.BOOL,
|
|
1565
|
+
number=3,
|
|
1566
|
+
)
|
|
1567
|
+
avoid_ferries: bool = proto.Field(
|
|
1568
|
+
proto.BOOL,
|
|
1569
|
+
number=4,
|
|
1570
|
+
)
|
|
1571
|
+
avoid_indoor: bool = proto.Field(
|
|
1572
|
+
proto.BOOL,
|
|
1573
|
+
number=5,
|
|
1574
|
+
)
|
|
1575
|
+
|
|
1576
|
+
|
|
1527
1577
|
class Vehicle(proto.Message):
|
|
1528
1578
|
r"""Models a vehicle in a shipment problem. Solving a shipment problem
|
|
1529
1579
|
will build a route starting from ``start_location`` and ending at
|
|
@@ -1542,6 +1592,10 @@ class Vehicle(proto.Message):
|
|
|
1542
1592
|
The travel mode which affects the roads usable by the
|
|
1543
1593
|
vehicle and its speed. See also
|
|
1544
1594
|
``travel_duration_multiple``.
|
|
1595
|
+
route_modifiers (google.maps.routeoptimization_v1.types.RouteModifiers):
|
|
1596
|
+
A set of conditions to satisfy that affect
|
|
1597
|
+
the way routes are calculated for the given
|
|
1598
|
+
vehicle.
|
|
1545
1599
|
start_location (google.type.latlng_pb2.LatLng):
|
|
1546
1600
|
Geographic location where the vehicle starts before picking
|
|
1547
1601
|
up any shipments. If not specified, the vehicle starts at
|
|
@@ -1964,6 +2018,11 @@ class Vehicle(proto.Message):
|
|
|
1964
2018
|
number=1,
|
|
1965
2019
|
enum=TravelMode,
|
|
1966
2020
|
)
|
|
2021
|
+
route_modifiers: "RouteModifiers" = proto.Field(
|
|
2022
|
+
proto.MESSAGE,
|
|
2023
|
+
number=2,
|
|
2024
|
+
message="RouteModifiers",
|
|
2025
|
+
)
|
|
1967
2026
|
start_location: latlng_pb2.LatLng = proto.Field(
|
|
1968
2027
|
proto.MESSAGE,
|
|
1969
2028
|
number=3,
|
|
@@ -2098,8 +2157,9 @@ class TimeWindow(proto.Message):
|
|
|
2098
2157
|
|
|
2099
2158
|
::
|
|
2100
2159
|
|
|
2101
|
-
0 <= `start_time` <= `
|
|
2102
|
-
0 <= `start_time` <= `
|
|
2160
|
+
0 <= `start_time` <= `end_time` and
|
|
2161
|
+
0 <= `start_time` <= `soft_start_time` and
|
|
2162
|
+
0 <= `soft_end_time` <= `end_time`.
|
|
2103
2163
|
|
|
2104
2164
|
|
|
2105
2165
|
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
|
|
@@ -2203,6 +2263,18 @@ class DistanceLimit(proto.Message):
|
|
|
2203
2263
|
must be nonnegative.
|
|
2204
2264
|
|
|
2205
2265
|
This field is a member of `oneof`_ ``_soft_max_meters``.
|
|
2266
|
+
cost_per_kilometer_below_soft_max (float):
|
|
2267
|
+
Cost per kilometer incurred, increasing up to
|
|
2268
|
+
``soft_max_meters``, with formula:
|
|
2269
|
+
|
|
2270
|
+
::
|
|
2271
|
+
|
|
2272
|
+
min(distance_meters, soft_max_meters) / 1000.0 *
|
|
2273
|
+
cost_per_kilometer_below_soft_max.
|
|
2274
|
+
|
|
2275
|
+
This cost is not supported in ``route_distance_limit``.
|
|
2276
|
+
|
|
2277
|
+
This field is a member of `oneof`_ ``_cost_per_kilometer_below_soft_max``.
|
|
2206
2278
|
cost_per_kilometer_above_soft_max (float):
|
|
2207
2279
|
Cost per kilometer incurred if distance is above
|
|
2208
2280
|
``soft_max_meters`` limit. The additional cost is 0 if the
|
|
@@ -2229,6 +2301,11 @@ class DistanceLimit(proto.Message):
|
|
|
2229
2301
|
number=2,
|
|
2230
2302
|
optional=True,
|
|
2231
2303
|
)
|
|
2304
|
+
cost_per_kilometer_below_soft_max: float = proto.Field(
|
|
2305
|
+
proto.DOUBLE,
|
|
2306
|
+
number=4,
|
|
2307
|
+
optional=True,
|
|
2308
|
+
)
|
|
2232
2309
|
cost_per_kilometer_above_soft_max: float = proto.Field(
|
|
2233
2310
|
proto.DOUBLE,
|
|
2234
2311
|
number=3,
|
|
@@ -3056,7 +3133,8 @@ class SkippedShipment(proto.Message):
|
|
|
3056
3133
|
if specified in the ``Shipment``.
|
|
3057
3134
|
reasons (MutableSequence[google.maps.routeoptimization_v1.types.SkippedShipment.Reason]):
|
|
3058
3135
|
A list of reasons that explain why the shipment was skipped.
|
|
3059
|
-
See comment above ``Reason``.
|
|
3136
|
+
See comment above ``Reason``. If we are unable to understand
|
|
3137
|
+
why a shipment was skipped, reasons will not be set.
|
|
3060
3138
|
"""
|
|
3061
3139
|
|
|
3062
3140
|
class Reason(proto.Message):
|
|
@@ -3115,9 +3193,7 @@ class SkippedShipment(proto.Message):
|
|
|
3115
3193
|
|
|
3116
3194
|
Values:
|
|
3117
3195
|
CODE_UNSPECIFIED (0):
|
|
3118
|
-
This should never be used.
|
|
3119
|
-
to understand why a shipment was skipped, we
|
|
3120
|
-
simply return an empty set of reasons.
|
|
3196
|
+
This should never be used.
|
|
3121
3197
|
NO_VEHICLE (1):
|
|
3122
3198
|
There is no vehicle in the model making all
|
|
3123
3199
|
shipments infeasible.
|
|
@@ -3420,8 +3496,8 @@ class InjectedSolutionConstraint(proto.Message):
|
|
|
3420
3496
|
or before them.
|
|
3421
3497
|
RELAX_VISIT_TIMES_AND_SEQUENCE_AFTER_THRESHOLD (2):
|
|
3422
3498
|
Same as ``RELAX_VISIT_TIMES_AFTER_THRESHOLD``, but the visit
|
|
3423
|
-
sequence is also relaxed: visits
|
|
3424
|
-
|
|
3499
|
+
sequence is also relaxed: visits can only be performed by
|
|
3500
|
+
this vehicle, but can potentially become unperformed.
|
|
3425
3501
|
RELAX_ALL_AFTER_THRESHOLD (3):
|
|
3426
3502
|
Same as ``RELAX_VISIT_TIMES_AND_SEQUENCE_AFTER_THRESHOLD``,
|
|
3427
3503
|
but the vehicle is also relaxed: visits are completely free
|
|
@@ -3478,7 +3554,7 @@ class InjectedSolutionConstraint(proto.Message):
|
|
|
3478
3554
|
|
|
3479
3555
|
|
|
3480
3556
|
class OptimizeToursValidationError(proto.Message):
|
|
3481
|
-
r"""Describes an error encountered when validating an
|
|
3557
|
+
r"""Describes an error or warning encountered when validating an
|
|
3482
3558
|
``OptimizeToursRequest``.
|
|
3483
3559
|
|
|
3484
3560
|
Attributes:
|
|
@@ -3592,8 +3668,10 @@ class OptimizeToursValidationError(proto.Message):
|
|
|
3592
3668
|
- TIME_WINDOW_OVERLAPPING_ADJACENT_OR_EARLIER_THAN_PREVIOUS
|
|
3593
3669
|
= 2812;
|
|
3594
3670
|
- TIME_WINDOW_START_TIME_AFTER_SOFT_START_TIME = 2813;
|
|
3595
|
-
-
|
|
3596
|
-
|
|
3671
|
+
- TIME_WINDOW_SOFT_START_TIME_OUTSIDE_GLOBAL_TIME_WINDOW
|
|
3672
|
+
= 2819;
|
|
3673
|
+
- TIME_WINDOW_SOFT_END_TIME_OUTSIDE_GLOBAL_TIME_WINDOW =
|
|
3674
|
+
2820;
|
|
3597
3675
|
- TIME_WINDOW_SOFT_END_TIME_AFTER_END_TIME = 2816;
|
|
3598
3676
|
- TIME_WINDOW_COST_BEFORE_SOFT_START_TIME_SET_AND_MULTIPLE_WINDOWS
|
|
3599
3677
|
= 2817;
|
|
@@ -3754,6 +3832,15 @@ class OptimizeToursValidationError(proto.Message):
|
|
|
3754
3832
|
|
|
3755
3833
|
- PRECEDENCE_ERROR = 46;
|
|
3756
3834
|
|
|
3835
|
+
- PRECEDENCE_RULE_MISSING_FIRST_INDEX = 4600;
|
|
3836
|
+
- PRECEDENCE_RULE_MISSING_SECOND_INDEX = 4601;
|
|
3837
|
+
- PRECEDENCE_RULE_FIRST_INDEX_OUT_OF_BOUNDS = 4602;
|
|
3838
|
+
- PRECEDENCE_RULE_SECOND_INDEX_OUT_OF_BOUNDS = 4603;
|
|
3839
|
+
- PRECEDENCE_RULE_DUPLICATE_INDEX = 4604;
|
|
3840
|
+
- PRECEDENCE_RULE_INEXISTENT_FIRST_VISIT_REQUEST = 4605;
|
|
3841
|
+
- PRECEDENCE_RULE_INEXISTENT_SECOND_VISIT_REQUEST =
|
|
3842
|
+
4606;
|
|
3843
|
+
|
|
3757
3844
|
- BREAK_ERROR = 48;
|
|
3758
3845
|
|
|
3759
3846
|
- BREAK_RULE_EMPTY = 4800;
|
|
@@ -3826,6 +3913,15 @@ class OptimizeToursValidationError(proto.Message):
|
|
|
3826
3913
|
5600;
|
|
3827
3914
|
- DURATION_SECONDS_MATRIX_DURATION_EXCEEDS_GLOBAL_DURATION
|
|
3828
3915
|
= 5601;
|
|
3916
|
+
|
|
3917
|
+
- WARNING = 9;
|
|
3918
|
+
|
|
3919
|
+
- WARNING_INJECTED_FIRST_SOLUTION = 90;
|
|
3920
|
+
|
|
3921
|
+
- WARNING_INJECTED_FIRST_SOLUTION_INFEASIBLE_SHIPMENTS_REMOVED
|
|
3922
|
+
= 9000;
|
|
3923
|
+
- WARNING_INJECTED_FIRST_SOLUTION_INFEASIBLE_AFTER_GETTING_TRAVEL_TIMES
|
|
3924
|
+
= 9001;
|
|
3829
3925
|
display_name (str):
|
|
3830
3926
|
The error display name.
|
|
3831
3927
|
fields (MutableSequence[google.maps.routeoptimization_v1.types.OptimizeToursValidationError.FieldReference]):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: google-maps-routeoptimization
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.3
|
|
4
4
|
Summary: Google Maps Routeoptimization API client library
|
|
5
5
|
Home-page: https://github.com/googleapis/google-cloud-python/tree/main/packages/google-maps-routeoptimization
|
|
6
6
|
Author: Google LLC
|
|
@@ -1333,22 +1333,23 @@ async def test_optimize_tours_async_use_cached_wrapped_rpc(
|
|
|
1333
1333
|
)
|
|
1334
1334
|
|
|
1335
1335
|
# Replace cached wrapped function with mock
|
|
1336
|
-
|
|
1336
|
+
mock_rpc = mock.AsyncMock()
|
|
1337
|
+
mock_rpc.return_value = mock.Mock()
|
|
1337
1338
|
client._client._transport._wrapped_methods[
|
|
1338
1339
|
client._client._transport.optimize_tours
|
|
1339
|
-
] =
|
|
1340
|
+
] = mock_rpc
|
|
1340
1341
|
|
|
1341
1342
|
request = {}
|
|
1342
1343
|
await client.optimize_tours(request)
|
|
1343
1344
|
|
|
1344
1345
|
# Establish that the underlying gRPC stub method was called.
|
|
1345
|
-
assert
|
|
1346
|
+
assert mock_rpc.call_count == 1
|
|
1346
1347
|
|
|
1347
1348
|
await client.optimize_tours(request)
|
|
1348
1349
|
|
|
1349
1350
|
# Establish that a new wrapper was not created for this call
|
|
1350
1351
|
assert wrapper_fn.call_count == 0
|
|
1351
|
-
assert
|
|
1352
|
+
assert mock_rpc.call_count == 2
|
|
1352
1353
|
|
|
1353
1354
|
|
|
1354
1355
|
@pytest.mark.asyncio
|
|
@@ -1570,8 +1571,9 @@ def test_batch_optimize_tours_use_cached_wrapped_rpc():
|
|
|
1570
1571
|
# Establish that the underlying gRPC stub method was called.
|
|
1571
1572
|
assert mock_rpc.call_count == 1
|
|
1572
1573
|
|
|
1573
|
-
# Operation methods build a cached
|
|
1574
|
-
#
|
|
1574
|
+
# Operation methods call wrapper_fn to build a cached
|
|
1575
|
+
# client._transport.operations_client instance on first rpc call.
|
|
1576
|
+
# Subsequent calls should use the cached wrapper
|
|
1575
1577
|
wrapper_fn.reset_mock()
|
|
1576
1578
|
|
|
1577
1579
|
client.batch_optimize_tours(request)
|
|
@@ -1627,26 +1629,28 @@ async def test_batch_optimize_tours_async_use_cached_wrapped_rpc(
|
|
|
1627
1629
|
)
|
|
1628
1630
|
|
|
1629
1631
|
# Replace cached wrapped function with mock
|
|
1630
|
-
|
|
1632
|
+
mock_rpc = mock.AsyncMock()
|
|
1633
|
+
mock_rpc.return_value = mock.Mock()
|
|
1631
1634
|
client._client._transport._wrapped_methods[
|
|
1632
1635
|
client._client._transport.batch_optimize_tours
|
|
1633
|
-
] =
|
|
1636
|
+
] = mock_rpc
|
|
1634
1637
|
|
|
1635
1638
|
request = {}
|
|
1636
1639
|
await client.batch_optimize_tours(request)
|
|
1637
1640
|
|
|
1638
1641
|
# Establish that the underlying gRPC stub method was called.
|
|
1639
|
-
assert
|
|
1642
|
+
assert mock_rpc.call_count == 1
|
|
1640
1643
|
|
|
1641
|
-
# Operation methods build a cached
|
|
1642
|
-
#
|
|
1644
|
+
# Operation methods call wrapper_fn to build a cached
|
|
1645
|
+
# client._transport.operations_client instance on first rpc call.
|
|
1646
|
+
# Subsequent calls should use the cached wrapper
|
|
1643
1647
|
wrapper_fn.reset_mock()
|
|
1644
1648
|
|
|
1645
1649
|
await client.batch_optimize_tours(request)
|
|
1646
1650
|
|
|
1647
1651
|
# Establish that a new wrapper was not created for this call
|
|
1648
1652
|
assert wrapper_fn.call_count == 0
|
|
1649
|
-
assert
|
|
1653
|
+
assert mock_rpc.call_count == 2
|
|
1650
1654
|
|
|
1651
1655
|
|
|
1652
1656
|
@pytest.mark.asyncio
|
|
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
|
{google_maps_routeoptimization-0.1.2 → google_maps_routeoptimization-0.1.3}/tests/__init__.py
RENAMED
|
File without changes
|
{google_maps_routeoptimization-0.1.2 → google_maps_routeoptimization-0.1.3}/tests/unit/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|