Skip to content

Merge duplicate operating rules by combining calendars#49

Merged
gcamp merged 2 commits into
mainfrom
gcamp/merge-duplicate-operating-rules
May 6, 2026
Merged

Merge duplicate operating rules by combining calendars#49
gcamp merged 2 commits into
mainfrom
gcamp/merge-duplicate-operating-rules

Conversation

@gcamp

@gcamp gcamp commented May 6, 2026

Copy link
Copy Markdown
Member

Summary

Operating rules that share the same identity (from_zone, to_zone, time windows, route, vehicle type) but differ only in calendar are now merged into a single rule with a combined calendars list.

Previously, add_zone_to_zone_rule created a new OperationRule per trip, each with a single-element calendars list. For feeds with many trips across the same zone pairs (e.g. different days of the week), this produced massive duplication — one real-world feed went from 1608 rules down to 132 after this change.

This should fix a crash on LINEADFR_F on Dreux in bpinCompression which overflow int_max. Context : https://transit.slack.com/archives/C01K58SPPQ8/p1777906113949719

gcamp added 2 commits May 5, 2026 21:56
Rules sharing the same (from_zone, to_zone, time_windows, route, vehicle_type)
now merge their calendars lists instead of creating separate entries per trip.
@gcamp gcamp requested review from agregoire and jsteelz May 6, 2026 02:04

@agregoire agregoire left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@gcamp gcamp merged commit e6d3203 into main May 6, 2026
1 check passed
@gcamp gcamp deleted the gcamp/merge-duplicate-operating-rules branch May 6, 2026 18:06
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.

2 participants