Conversation
Summary of ChangesHello @mmathieum, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a new cleanup mechanism to remove unused trip IDs from the system. By integrating a Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a mechanism to remove unused trip IDs, which helps in cleaning up data. The implementation adds a cleanupIds method in GSpec that iterates through trip IDs and removes those not associated with any route. A corresponding remove method is added to MTripIds. The logic is sound. I have one suggestion to improve the performance of the new cleanup logic by avoiding an unnecessary sorting operation.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a mechanism to remove unused GTFS trip IDs, which is a necessary cleanup step. The changes are logical, particularly the switch from HashSet to HashMap for mTrips to allow for efficient lookups.
I have a few suggestions to improve the implementation:
- Correct a minor typo in a log message.
- Refactor the trip merging logic to be more concise using
putIfAbsent. - Improve the memory efficiency of the unused trip ID removal process by avoiding the creation of a large intermediate list.
Overall, good work on addressing the need to prune unused IDs.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a feature to remove unused trip IDs, which is an important cleanup step. The implementation correctly changes the data structure for trips to a HashMap for efficient processing and adds the pruning logic. My review includes a suggestion to improve the performance of the new prune method in MTripIds.kt, which could be a bottleneck with large GTFS datasets. The rest of the changes look good and are consistent with the PR's objective.
- commons: CI: add frequently used gh command with inputs in comments - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
- commons: mt-sync-code-data.yml > fix skip on main repo - commons: CI: add frequently used gh command with inputs in comments - commons: Auto-trigger data sync when archive contains newer data than deployed mtransitapps/commons#537 - parser: Fix compat with service IDs only used for data changed - parser: fix compat with no last service calendar dates - parser: Remove unused trip IDs ints. mtransitapps/parser#31 - parser: Schedule > clear head-sign instead of setting empty string mtransitapps/parser#30 - parser: Data Changed > compat with service IDs regex mtransitapps/parser#32
Most GTFS trip IDs are not reused in new schedules so we need to remove unused ones every time.