-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix trip splitting when a block extends over 3 days or more. (#22)
* halp * Possible bug fix * Yoink silly prints * Push updated snapshots maybeee * Add simple case for multi day blocks (#23) * Add simple case * Update snapshots * Back --------- Co-authored-by: Nicholas Paun <[email protected]> --------- Co-authored-by: Jeremy Steele <[email protected]> Co-authored-by: Jeremy Steele <[email protected]>
- Loading branch information
1 parent
0ea1d23
commit ff35e0a
Showing
15 changed files
with
169 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
service_id,monday,tuesday,wednesday,thursday,friday,saturday,sunday,start_date,end_date | ||
fri,0,0,0,0,1,0,0,20210101,20211231 | ||
fri-sat,0,0,0,0,1,1,0,20210101,20211231 | ||
fri-sat-sun,0,0,0,0,1,1,1,20210101,20211231 | ||
friday,0,0,0,0,1,0,0,20240506,20240521 | ||
mon,1,0,0,0,0,0,0,20210101,20211231 | ||
mon-tues-thurs-fri-sat,1,1,0,1,1,1,0,20210101,20211231 | ||
mon-tues-wed-thurs,1,1,1,1,0,0,0,20210101,20211231 | ||
mon-tues-wed-thurs-fri-sat,1,1,1,1,1,1,0,20210101,20211231 | ||
mon-tues-wed-thurs-fri-sat-sun,1,1,1,1,1,1,1,20210101,20211231 | ||
mon-wed,1,0,1,0,0,0,0,20210101,20211231 | ||
saturday,0,0,0,0,0,1,0,20240506,20240521 | ||
sun,0,0,0,0,0,0,1,20210101,20211231 | ||
sunday,0,0,0,0,0,0,1,20240506,20240521 | ||
wed,0,0,1,0,0,0,0,20210101,20211231 | ||
weekday,1,1,1,1,1,0,0,20240506,20240521 |
11 changes: 11 additions & 0 deletions
11
tests/test_multi_day_blocks/expected_linear/calendar_dates.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
service_id,date,exception_type | ||
b2t:service_0,20240506,1 | ||
b2t:service_0,20240507,1 | ||
b2t:service_0,20240508,1 | ||
b2t:service_0,20240509,1 | ||
b2t:service_0,20240513,1 | ||
b2t:service_0,20240514,1 | ||
b2t:service_0,20240515,1 | ||
b2t:service_0,20240516,1 | ||
b2t:service_0,20240520,1 | ||
b2t:service_0,20240521,1 |
25 changes: 25 additions & 0 deletions
25
tests/test_multi_day_blocks/expected_linear/stop_times.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
trip_id,stop_sequence,stop_id,arrival_time,departure_time,start_pickup_drop_off_window,end_pickup_drop_off_window,pickup_type,drop_off_type,mean_duration_factor,mean_duration_offset,safe_duration_factor,safe_duration_offset | ||
trip_0_b2t:if_b2t:service_0,0,slocan-park,05:50:00,05:50:00,,,0,0,,,, | ||
trip_0_b2t:if_b2t:service_0,1,junction,05:51:15,05:51:15,,,0,0,,,, | ||
trip_0_b2t:if_friday,0,slocan-park,05:50:00,05:50:00,,,0,0,,,, | ||
trip_0_b2t:if_friday,1,junction,05:51:15,05:51:15,,,0,0,,,, | ||
trip_0b_b2t:if_b2t:service_0,0,junction,05:52:00,05:52:00,,,0,0,,,, | ||
trip_0b_b2t:if_b2t:service_0,1,slocan-park,05:59:15,05:59:15,,,0,0,,,, | ||
trip_0b_b2t:if_friday,0,junction,05:52:00,05:52:00,,,0,0,,,, | ||
trip_0b_b2t:if_friday,1,slocan-park,05:59:15,05:59:15,,,0,0,,,, | ||
trip_1_b2t:if_b2t:service_0,0,slocan-park,06:00:00,06:00:00,,,0,0,,,, | ||
trip_1_b2t:if_b2t:service_0,1,junction,24:15:15,24:15:15,,,0,0,,,, | ||
trip_1_b2t:if_friday,0,slocan-park,06:00:00,06:00:00,,,0,0,,,, | ||
trip_1_b2t:if_friday,1,junction,24:15:15,24:15:15,,,0,0,,,, | ||
trip_2_b2t:if_b2t:service_0,0,junction,24:15:30,24:15:30,,,0,0,,,, | ||
trip_2_b2t:if_b2t:service_0,1,slocan-park,28:59:00,28:59:00,,,0,0,,,, | ||
trip_2_b2t:if_friday,0,junction,24:15:30,24:15:30,,,0,0,,,, | ||
trip_2_b2t:if_friday,1,slocan-park,28:59:00,28:59:00,,,0,0,,,, | ||
trip_2a,0,slocan-park,05:00:00,05:00:00,,,0,0,,,, | ||
trip_2a,1,junction,05:01:00,05:01:00,,,0,0,,,, | ||
trip_3,0,junction,05:02:00,05:02:00,,,0,0,,,, | ||
trip_3,1,slocan-park,24:15:15,24:15:15,,,0,0,,,, | ||
trip_4,1,slocan-park,24:17:15,24:17:15,,,0,0,,,, | ||
trip_4,2,junction,24:19:15,24:19:15,,,0,0,,,, | ||
trip_5,1,junction,05:59:00,05:59:00,,,0,0,,,, | ||
trip_5,2,slocan-park,06:00:00,06:00:00,,,0,0,,,, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from_trip_id,to_trip_id,transfer_type | ||
trip_0_b2t:if_b2t:service_0,trip_0b_b2t:if_b2t:service_0,5 | ||
trip_0_b2t:if_friday,trip_0b_b2t:if_friday,5 | ||
trip_0b_b2t:if_b2t:service_0,trip_1_b2t:if_b2t:service_0,5 | ||
trip_0b_b2t:if_friday,trip_1_b2t:if_friday,5 | ||
trip_1_b2t:if_b2t:service_0,trip_2_b2t:if_b2t:service_0,5 | ||
trip_1_b2t:if_friday,trip_2_b2t:if_friday,5 | ||
trip_2_b2t:if_friday,trip_2a,5 | ||
trip_2a,trip_3,5 | ||
trip_3,trip_4,5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
route_id,trip_id,service_id,block_id | ||
red,trip_0_b2t:if_b2t:service_0,b2t:service_0,1 | ||
red,trip_0_b2t:if_friday,friday,1 | ||
red,trip_0b_b2t:if_b2t:service_0,b2t:service_0,1 | ||
red,trip_0b_b2t:if_friday,friday,1 | ||
red,trip_1_b2t:if_b2t:service_0,b2t:service_0,1 | ||
red,trip_1_b2t:if_friday,friday,1 | ||
red,trip_2_b2t:if_b2t:service_0,b2t:service_0,1 | ||
red,trip_2_b2t:if_friday,friday,1 | ||
red,trip_2a,saturday,1 | ||
red,trip_3,saturday,1 | ||
red,trip_4,saturday,1 | ||
red,trip_5,sunday,1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
trip_id,stop_sequence,stop_id,arrival_time,departure_time | ||
trip_0,0,slocan-park,05:50:00,05:50:00, | ||
trip_0,1,junction,05:51:15,05:51:15 | ||
trip_0b,0,junction,05:52:00,05:52:00 | ||
trip_0b,1,slocan-park,05:59:15,05:59:15 | ||
trip_1,0,slocan-park,06:00:00,06:00:00, | ||
trip_1,1,junction,24:15:15,24:15:15 | ||
trip_2,0,junction,24:15:30,24:15:30 | ||
trip_2,1,slocan-park,28:59:00,28:59:00 | ||
trip_2a,0,slocan-park,05:00:00,05:00:00, | ||
trip_2a,1,junction,05:01:00,05:01:00 | ||
trip_3,0,junction,05:02:00,05:02:00 | ||
trip_3,1,slocan-park,24:15:15,24:15:15 | ||
trip_4,1,slocan-park,24:17:15,24:17:15 | ||
trip_4,2,junction,24:19:15,24:19:15 | ||
trip_5,1,junction,05:59:00,05:59:00 | ||
trip_5,2,slocan-park,06:00:00,06:00:00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
route_id,trip_id,service_id,block_id | ||
red,trip_0,weekday,1 | ||
red,trip_0b,weekday,1 | ||
red,trip_1,weekday,1 | ||
red,trip_2,weekday,1 | ||
red,trip_2a,saturday,1 | ||
red,trip_3,saturday,1 | ||
red,trip_4,saturday,1 | ||
red,trip_5,sunday,1 |
17 changes: 17 additions & 0 deletions
17
tests/test_simple_multi_day_block/expected_linear/stop_times.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
trip_id,stop_sequence,stop_id,arrival_time,departure_time,start_pickup_drop_off_window,end_pickup_drop_off_window,pickup_type,drop_off_type,mean_duration_factor,mean_duration_offset,safe_duration_factor,safe_duration_offset | ||
trip_0,0,slocan-park,05:50:00,05:50:00,,,0,0,,,, | ||
trip_0,1,junction,05:51:15,05:51:15,,,0,0,,,, | ||
trip_0b,0,junction,05:52:00,05:52:00,,,0,0,,,, | ||
trip_0b,1,slocan-park,05:59:15,05:59:15,,,0,0,,,, | ||
trip_1,0,slocan-park,06:00:00,06:00:00,,,0,0,,,, | ||
trip_1,1,junction,24:15:15,24:15:15,,,0,0,,,, | ||
trip_2,0,junction,24:15:30,24:15:30,,,0,0,,,, | ||
trip_2,1,slocan-park,28:59:00,28:59:00,,,0,0,,,, | ||
trip_2a,0,slocan-park,05:00:00,05:00:00,,,0,0,,,, | ||
trip_2a,1,junction,05:01:00,05:01:00,,,0,0,,,, | ||
trip_3,0,junction,05:02:00,05:02:00,,,0,0,,,, | ||
trip_3,1,slocan-park,24:15:15,24:15:15,,,0,0,,,, | ||
trip_4,1,slocan-park,24:17:15,24:17:15,,,0,0,,,, | ||
trip_4,2,junction,24:19:15,24:19:15,,,0,0,,,, | ||
trip_5,1,junction,05:59:00,05:59:00,,,0,0,,,, | ||
trip_5,2,slocan-park,06:00:00,06:00:00,,,0,0,,,, |
7 changes: 7 additions & 0 deletions
7
tests/test_simple_multi_day_block/expected_linear/transfers.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from_trip_id,to_trip_id,transfer_type | ||
trip_0,trip_0b,5 | ||
trip_0b,trip_1,5 | ||
trip_1,trip_2,5 | ||
trip_2,trip_2a,5 | ||
trip_2a,trip_3,5 | ||
trip_3,trip_4,5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
route_id,trip_id,service_id,block_id | ||
red,trip_0,friday,1 | ||
red,trip_0b,friday,1 | ||
red,trip_1,friday,1 | ||
red,trip_2,friday,1 | ||
red,trip_2a,saturday,1 | ||
red,trip_3,saturday,1 | ||
red,trip_4,saturday,1 | ||
red,trip_5,sunday,1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
trip_id,stop_sequence,stop_id,arrival_time,departure_time | ||
trip_0,0,slocan-park,05:50:00,05:50:00, | ||
trip_0,1,junction,05:51:15,05:51:15 | ||
trip_0b,0,junction,05:52:00,05:52:00 | ||
trip_0b,1,slocan-park,05:59:15,05:59:15 | ||
trip_1,0,slocan-park,06:00:00,06:00:00, | ||
trip_1,1,junction,24:15:15,24:15:15 | ||
trip_2,0,junction,24:15:30,24:15:30 | ||
trip_2,1,slocan-park,28:59:00,28:59:00 | ||
trip_2a,0,slocan-park,05:00:00,05:00:00, | ||
trip_2a,1,junction,05:01:00,05:01:00 | ||
trip_3,0,junction,05:02:00,05:02:00 | ||
trip_3,1,slocan-park,24:15:15,24:15:15 | ||
trip_4,1,slocan-park,24:17:15,24:17:15 | ||
trip_4,2,junction,24:19:15,24:19:15 | ||
trip_5,1,junction,05:59:00,05:59:00 | ||
trip_5,2,slocan-park,06:00:00,06:00:00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
route_id,trip_id,service_id,block_id | ||
red,trip_0,friday,1 | ||
red,trip_0b,friday,1 | ||
red,trip_1,friday,1 | ||
red,trip_2,friday,1 | ||
red,trip_2a,saturday,1 | ||
red,trip_3,saturday,1 | ||
red,trip_4,saturday,1 | ||
red,trip_5,sunday,1 |