-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Manage poi access points in journeys #3978
Conversation
source/jormungandr/jormungandr/scenarios/helper_classes/helper_utils.py
Outdated
Show resolved
Hide resolved
source/jormungandr/jormungandr/scenarios/helper_classes/helper_utils.py
Outdated
Show resolved
Hide resolved
poi_access = fallback_sections[-1].vias.add() | ||
else: | ||
poi_access = fallback_sections[0].vias.add() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't care about the order of the poi_access
objects in the vias
list ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the important via_uri in path
self._requested_place_obj.embedded_type == type_pb2.POI | ||
and self._mode | ||
in [ | ||
FallbackModes.walking.name, | ||
FallbackModes.bike.name, | ||
] | ||
and self._requested_place_obj.poi.children | ||
and self._request.get("_poi_access_points", False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self._requested_place_obj.embedded_type == type_pb2.POI | |
and self._mode | |
in [ | |
FallbackModes.walking.name, | |
FallbackModes.bike.name, | |
] | |
and self._requested_place_obj.poi.children | |
and self._request.get("_poi_access_points", False) | |
self._request.get("_poi_access_points", False) | |
and self._requested_place_obj.embedded_type == type_pb2.POI | |
and self._mode | |
in [ | |
FallbackModes.walking.name, | |
FallbackModes.bike.name, | |
] | |
and self._requested_place_obj.poi.children |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -54,7 +54,8 @@ | |||
|
|||
# use dataclass when python3.7 is available | |||
DurationElement = namedtuple( | |||
'DurationElement', ['duration', 'status', 'car_park', 'car_park_crowfly_duration', 'via_access_point'] | |||
'DurationElement', | |||
['duration', 'status', 'car_park', 'car_park_crowfly_duration', 'via_access_point', 'via_poi_access'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to rename via_access_point
to via_pt_access
?
['duration', 'status', 'car_park', 'car_park_crowfly_duration', 'via_access_point', 'via_poi_access'], | |
['duration', 'status', 'car_park', 'car_park_crowfly_duration', 'via_pt_access', 'via_poi_access'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
centers_isochrone = self._determine_centers_isochrone() | ||
result = [] | ||
for center_isochrone in centers_isochrone: | ||
result.append( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 could be parallelized later, if necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
best_duration = element.duration | ||
best_element = DurationElement( | ||
element.duration, | ||
element.status, | ||
element.car_park, | ||
element.car_park_crowfly_duration, | ||
element.via_access_point, | ||
centers_isochrone[index], | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
best_duration = element.duration | |
best_element = DurationElement( | |
element.duration, | |
element.status, | |
element.car_park, | |
element.car_park_crowfly_duration, | |
element.via_access_point, | |
centers_isochrone[index], | |
) | |
best_duration = element.duration | |
best_element = copy.deepcopy(element) | |
best_element.via_poi_access = centers_isochrone[index] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
best_element is a namedtuple, you can't change a value
Kudos, SonarCloud Quality Gate passed! |
No description provided.