-
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
[Jormungandr] Fix LEZ when fallbacks are car #3969
Conversation
source/jormungandr/jormungandr/scenarios/helper_classes/complete_pt_journey.py
Show resolved
Hide resolved
tmp_list = [ | ||
not section.low_emission_zone.on_path | ||
for section in journey.sections | ||
if section.HasField('low_emission_zone') | ||
] | ||
# all([]) == True it's not what we want :( | ||
if tmp_list and all(tmp_list): | ||
journey.low_emission_zone.on_path = False | ||
elif any( | ||
section.low_emission_zone.on_path | ||
for section in journey.sections | ||
if section.HasField('low_emission_zone') | ||
): | ||
journey.low_emission_zone.on_path = True | ||
|
||
|
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.
tmp_list = [ | |
not section.low_emission_zone.on_path | |
for section in journey.sections | |
if section.HasField('low_emission_zone') | |
] | |
# all([]) == True it's not what we want :( | |
if tmp_list and all(tmp_list): | |
journey.low_emission_zone.on_path = False | |
elif any( | |
section.low_emission_zone.on_path | |
for section in journey.sections | |
if section.HasField('low_emission_zone') | |
): | |
journey.low_emission_zone.on_path = True | |
for section in journey.sections: | |
if section.HasField('low_emission_zone'): | |
if section.low_emission_zone.on_path: | |
journey.low_emission_zone.on_path = True | |
break |
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.
it won't work if none of the fallbacks has LEZ...
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.
and for the sake of compatibility, we don't display low_emission_zone.on_path
if the information of LEZ is unavailable...
Kudos, SonarCloud Quality Gate passed! |
In this PR, two cases are fixed:
at least one of the fallbacks traverses LEZ, we set

on_path
to true for the whole journey :none of the fallbacks traverses LEZ, we set

on_path
to false for the whole journey: