-
Notifications
You must be signed in to change notification settings - Fork 10
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
Validation zhuzh-up: headway value checks #146
Conversation
…valid stage on schedule level
…ay-values # Conflicts: # tests/test_core_network.py
'service_level': { | ||
'service': {'is_valid_service': True, 'invalid_stages': [], | ||
'has_valid_routes': True, 'invalid_routes': []}}, | ||
'route_level': { | ||
'service': {'1': {'is_valid_route': True, 'invalid_stages': []}, | ||
'2': {'is_valid_route': True, 'invalid_stages': []}}}, | ||
'service': {'1': {'is_valid_route': True, 'invalid_stages': [], |
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.
A quick note on an edge case that we ran into in the NZ ABM was with (inter-regional) buses which often only have one service / trip a day. Not sure how often this would occur in other geographies however, we ended up accounting for them by hardcoding all services with a service/trip length of 1
to a 24-hour headway
as these would otherwise turn out to have a 0/ nan value.
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.
Yeah that's a very good point, in the old version those would default to a 0 headway. I settled on leaving the NaT/NaN because I didn't want to presume.. My thinking is, we could leave the empty for the user to interpret - I think it's not impossible there to be a service that shows up in the schedule but runs once a week and then the headway should ideally be 72460 right? But we can't know about it because we lost the part of GTFS that could tell us about it. All throughout the genet schedule though, we talk about gtfs DAY and the services are assumed to be running in a day, so a 24h default would make sense.
What do you think would make most sense / be the most convenient for a potential user?
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.
This has been a very helpful function that we use to check whether schedules have been implemented sensibly. A quick note to consider is the edge case that we ran into in the NZ ABM of services with only 1 trip per day, which would result in a 0 or infinite headway rather than 24 hours. :)
# Conflicts: # genet/core.py # tests/test_core_network.py
Resolves #144 - Check PT headway values during validation
NaN
/NaT
and is ignored when computing stats later on.DataFrame
s toRoute
andService
objects (originally onlySchedule
could produce these)Nb. Part of a wider validation upgrade series. I'm leaving updating the notebook: 6.1. Validating Network: MATSim Specific to last in the series.