[#1] Only group trips within the same agency
All checks were successful
Amarillo/amarillo-gitea/amarillo-grfs-export/pipeline/head This commit looks good
All checks were successful
Amarillo/amarillo-gitea/amarillo-grfs-export/pipeline/head This commit looks good
This commit is contained in:
parent
2c1190adb6
commit
174f3a4a2f
|
|
@ -103,8 +103,9 @@ class GtfsExport:
|
||||||
current_trip.route_id = current_route_id
|
current_trip.route_id = current_route_id
|
||||||
|
|
||||||
for other_id, other_trip in list(ungrouped_trips.items()):
|
for other_id, other_trip in list(ungrouped_trips.items()):
|
||||||
# if an ungrouped trip is close to any of the grouped trips, add it to the route group
|
# if an ungrouped trip is from the same agency close to any of the grouped trips, add it to the route group
|
||||||
if (any(self.trips_are_close(other_trip, grouped_trip) for grouped_trip in current_group.values())):
|
# TODO: it should be possible to optimize this
|
||||||
|
if (any(grouped_trip.agency == other_trip.agency and self.trips_are_close(other_trip, grouped_trip) for grouped_trip in current_group.values())):
|
||||||
current_group[other_id] = ungrouped_trips.pop(other_id)
|
current_group[other_id] = ungrouped_trips.pop(other_id)
|
||||||
current_group[other_id].route_id = current_route_id
|
current_group[other_id].route_id = current_route_id
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[project]
|
[project]
|
||||||
name = "amarillo-grfs-export"
|
name = "amarillo-grfs-export"
|
||||||
version = "0.0.2"
|
version = "0.0.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"amarillo",
|
"amarillo",
|
||||||
"amarillo-enhancer",
|
"amarillo-enhancer",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue