Skip to content
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

Merged
merged 28 commits into from
Apr 19, 2023
Merged

Manage poi access points in journeys #3978

merged 28 commits into from
Apr 19, 2023

Conversation

azime
Copy link
Contributor

@azime azime commented Apr 17, 2023

No description provided.

Abderrahim AZIME added 2 commits April 17, 2023 16:53
@azime azime changed the title Init poi access journeys Manage poi access in journeys Apr 18, 2023
@azime azime changed the title Manage poi access in journeys Manage poi access points in journeys Apr 18, 2023
Comment on lines +377 to +379
poi_access = fallback_sections[-1].vias.add()
else:
poi_access = fallback_sections[0].vias.add()
Copy link
Contributor

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 ?

Copy link
Contributor Author

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

Abderrahim AZIME added 2 commits April 18, 2023 15:48
Comment on lines 320 to 327
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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

Copy link
Contributor Author

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'],
Copy link
Member

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?

Suggested change
['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'],

Copy link
Contributor Author

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(
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines 385 to 393
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],
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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]

Copy link
Contributor Author

@azime azime Apr 18, 2023

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

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 22 Code Smells

90.9% 90.9% Coverage
0.0% 0.0% Duplication

@azime azime merged commit 7a76967 into dev Apr 19, 2023
@azime azime deleted the init_poi_access_journeys branch April 19, 2023 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants