Skip to content
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

feat: 1822 flex forbidden pickup type & forbidden drop off type #1936

Merged
merged 12 commits into from
Jan 15, 2025

Conversation

qcdyx
Copy link
Contributor

@qcdyx qcdyx commented Jan 7, 2025

Summary:

Closes #1822
Closes #1818

Expected behavior:
Display forbidden pickup/ drop off notice if conditions met.
image

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Run the unit tests with gradle test to make sure you didn't break anything
  • Add or update any needed documentation to the repo
  • Format the title like "feat: [new feature short description]". Title must follow the Conventional Commit Specification(https://www.conventionalcommits.org/en/v1.0.0/).
  • Linked all relevant issues
  • Include screenshot(s) showing how this pull request works and fixes the issue(s)

@qcdyx qcdyx linked an issue Jan 7, 2025 that may be closed by this pull request
@qcdyx qcdyx changed the title feat: 1822 flex forbidden pickup type feat: 1822 flex forbidden pickup type & forbidden drop off type Jan 7, 2025
Copy link
Contributor

github-actions bot commented Jan 7, 2025

This contribution does not follow the conventions set by the Google Java style guide. Please run the following command line at the root of the project to fix formatting errors: ./gradlew goJF.

entity.endPickupDropOffWindow()));
}
}

Copy link
Contributor

Choose a reason for hiding this comment

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

You should maybe add a shouldValidate method that allows skipping the validate call as an optimisation.
See for example:
StopTimesShapeDistTraveledPresenceValidator.java

And here is the PR where this feature was added: #1875

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

github-actions bot commented Jan 9, 2025

This contribution does not follow the conventions set by the Google Java style guide. Please run the following command line at the root of the project to fix formatting errors: ./gradlew goJF.

Copy link
Contributor

github-actions bot commented Jan 9, 2025

📝 Acceptance Test Report

📋 Summary

✅ The rule acceptance has passed for commit b639c9a
Download the full acceptance test report here (report will disappear after 90 days).

📊 Notices Comparison

New Errors (2 out of 1788 datasets, ~0%) ✅

Details of new errors due to code change, which is less than the provided threshold of 1%.

Dataset Notice Code
us-colorado-lake-county-senior-center-transportation-program-gtfs-2291 forbidden_drop_off_type
us-colorado-tsc-transit-gtfs-2052 forbidden_pickup_type
Dropped Errors (0 out of 1788 datasets, ~0%) ✅

No changes were detected due to the code change.

New Warnings (0 out of 1788 datasets, ~0%) ✅

No changes were detected due to the code change.

Dropped Warnings (0 out of 1788 datasets, ~0%) ✅

No changes were detected due to the code change.

🛡️ Corruption Check

0 out of 1788 sources (~0 %) are corrupted.

⏱️ Performance Assessment

📈 Validation Time

Assess the performance in terms of seconds taken for the validation process.

Time Metric Dataset ID Reference (s) Latest (s) Difference (s)
Average -- 4.00 4.13 ⬆️+0.13
Median -- 1.37 1.45 ⬆️+0.08
Standard Deviation -- 11.97 12.11 ⬆️+0.14
Minimum in References Reports us-michigan-detroit-people-mover-gtfs-417 0.52 0.63 ⬆️+0.10
Maximum in Reference Reports gb-unknown-uk-aggregate-feed-gtfs-2014 325.01 328.40 ⬆️+3.39
Minimum in Latest Reports ar-buenos-aires-subterraneos-de-buenos-aires-subte-gtfs-6 0.55 0.56 ⬆️+0.01
Maximum in Latest Reports gb-unknown-uk-aggregate-feed-gtfs-2014 325.01 328.40 ⬆️+3.39
📜 Memory Consumption
Metric Dataset ID Reference (s) Latest (s) Difference (s)
Average -- 471.50 MiB 467.19 MiB ⬇️-4.30 MiB
Median -- 240.50 MiB 238.39 MiB ⬇️-2.11 MiB
Standard Deviation -- 870.04 MiB 862.74 MiB ⬇️-7.29 MiB
Minimum in References Reports us-oregon-hut-airport-shuttle-gtfs-635 34.48 MiB 34.50 MiB ⬆️+25.45 KiB
Maximum in Reference Reports gb-unknown-uk-aggregate-feed-gtfs-2014 11.56 GiB 11.08 GiB ⬇️-485.66 MiB
Minimum in Latest Reports us-michigan-detroit-people-mover-gtfs-417 34.53 MiB 34.49 MiB ⬇️-48.00 KiB
Maximum in Latest Reports gb-unknown-uk-aggregate-feed-gtfs-2014 11.56 GiB 11.08 GiB ⬇️-485.66 MiB

@qcdyx qcdyx requested a review from jcpitre January 9, 2025 21:45
@Override
public void validate(GtfsStopTime entity, NoticeContainer noticeContainer) {
if ((entity.hasStartPickupDropOffWindow() || entity.hasEndPickupDropOffWindow())
&& (entity.pickupType().equals(GtfsPickupDropOff.ALLOWED)
Copy link
Contributor

Choose a reason for hiding this comment

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

I find it confusing that the regular pickup or dropoff enum value is ALLOWED when with this new rule it's actually not allowed.
Out of scope for this PR, I guess, but can't we rename the enum value to REGULAR instead of ALLOWED. Looking at the GTFS reference, we have this for pickup_type. drop_off_type is similar:

Indicates pickup method. Valid options are:
   0 or empty - Regularly scheduled pickup.
   1 - No pickup available.
   2 - Must phone agency to arrange pickup.
   3 - Must coordinate with driver to arrange pickup.

which more in line with having a REGULAR enum vlue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @emmambd shall we open a new issue for it?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm confused why it can't be done within the scope of this issue - how often does this enum value recur across notices?

Copy link
Contributor

@jcpitre jcpitre Jan 13, 2025

Choose a reason for hiding this comment

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

It can be done within this issue. I just don't want @qcdyx to feel obliged to do it since it has no effect on the resolution of the current issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It'll be implemented in another PR - no need to open a new issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I evaluated this request, it's not just about replacing a string because GtfsPickupDropOff is generated code, we need to identify the source template/code generation logic that produces the file. It's worthy of a new issue. #1942 @davidgamez

Copy link
Contributor

📝 Acceptance Test Report

📋 Summary

✅ The rule acceptance has passed for commit cc02367
Download the full acceptance test report here (report will disappear after 90 days).

📊 Notices Comparison

New Errors (2 out of 1788 datasets, ~0%) ✅

Details of new errors due to code change, which is less than the provided threshold of 1%.

Dataset Notice Code
us-colorado-lake-county-senior-center-transportation-program-gtfs-2291 forbidden_drop_off_type
us-colorado-tsc-transit-gtfs-2052 forbidden_pickup_type
Dropped Errors (0 out of 1788 datasets, ~0%) ✅

No changes were detected due to the code change.

New Warnings (0 out of 1788 datasets, ~0%) ✅

No changes were detected due to the code change.

Dropped Warnings (0 out of 1788 datasets, ~0%) ✅

No changes were detected due to the code change.

🛡️ Corruption Check

0 out of 1788 sources (~0 %) are corrupted.

⏱️ Performance Assessment

📈 Validation Time

Assess the performance in terms of seconds taken for the validation process.

Time Metric Dataset ID Reference (s) Latest (s) Difference (s)
Average -- 4.01 4.15 ⬆️+0.14
Median -- 1.38 1.49 ⬆️+0.11
Standard Deviation -- 11.82 11.94 ⬆️+0.13
Minimum in References Reports us-oregon-hut-airport-shuttle-gtfs-635 0.51 0.61 ⬆️+0.10
Maximum in Reference Reports gb-unknown-uk-aggregate-feed-gtfs-2014 317.17 323.82 ⬆️+6.65
Minimum in Latest Reports us-oregon-hut-airport-shuttle-gtfs-635 0.51 0.61 ⬆️+0.10
Maximum in Latest Reports gb-unknown-uk-aggregate-feed-gtfs-2014 317.17 323.82 ⬆️+6.65
📜 Memory Consumption
Metric Dataset ID Reference (s) Latest (s) Difference (s)
Average -- 466.34 MiB 476.65 MiB ⬆️+10.32 MiB
Median -- 237.02 MiB 240.51 MiB ⬆️+3.49 MiB
Standard Deviation -- 870.06 MiB 884.23 MiB ⬆️+14.17 MiB
Minimum in References Reports us-california-west-berkeley-shuttle-gtfs-2238 34.48 MiB 34.49 MiB ⬆️+8.00 KiB
Maximum in Reference Reports gb-unknown-uk-aggregate-feed-gtfs-2014 10.88 GiB 10.53 GiB ⬇️-361.63 MiB
Minimum in Latest Reports us-massachusetts-massachusetts-area-express-max-gtfs-431 34.49 MiB 34.49 MiB ⬇️0 bytes
Maximum in Latest Reports gb-unknown-uk-aggregate-feed-gtfs-2014 10.88 GiB 10.53 GiB ⬇️-361.63 MiB

Copy link
Contributor

📝 Acceptance Test Report

📋 Summary

✅ The rule acceptance has passed for commit 5130474
Download the full acceptance test report here (report will disappear after 90 days).

📊 Notices Comparison

New Errors (2 out of 1788 datasets, ~0%) ✅

Details of new errors due to code change, which is less than the provided threshold of 1%.

Dataset Notice Code
us-colorado-lake-county-senior-center-transportation-program-gtfs-2291 forbidden_drop_off_type
us-colorado-tsc-transit-gtfs-2052 forbidden_pickup_type
Dropped Errors (0 out of 1788 datasets, ~0%) ✅

No changes were detected due to the code change.

New Warnings (0 out of 1788 datasets, ~0%) ✅

No changes were detected due to the code change.

Dropped Warnings (0 out of 1788 datasets, ~0%) ✅

No changes were detected due to the code change.

🛡️ Corruption Check

0 out of 1788 sources (~0 %) are corrupted.

⏱️ Performance Assessment

📈 Validation Time

Assess the performance in terms of seconds taken for the validation process.

Time Metric Dataset ID Reference (s) Latest (s) Difference (s)
Average -- 4.00 4.11 ⬆️+0.11
Median -- 1.36 1.44 ⬆️+0.08
Standard Deviation -- 11.88 11.87 ⬇️-0.00
Minimum in References Reports us-oregon-hut-airport-shuttle-gtfs-635 0.52 0.69 ⬆️+0.18
Maximum in Reference Reports gb-unknown-uk-aggregate-feed-gtfs-2014 321.68 319.37 ⬇️-2.31
Minimum in Latest Reports us-massachusetts-massachusetts-area-express-max-gtfs-431 0.52 0.56 ⬆️+0.04
Maximum in Latest Reports gb-unknown-uk-aggregate-feed-gtfs-2014 321.68 319.37 ⬇️-2.31
📜 Memory Consumption
Metric Dataset ID Reference (s) Latest (s) Difference (s)
Average -- 473.16 MiB 489.70 MiB ⬆️+16.54 MiB
Median -- 238.49 MiB 239.61 MiB ⬆️+1.12 MiB
Standard Deviation -- 867.28 MiB 915.28 MiB ⬆️+48.00 MiB
Minimum in References Reports us-massachusetts-massachusetts-area-express-max-gtfs-431 34.48 MiB 34.50 MiB ⬆️+24.00 KiB
Maximum in Reference Reports gb-unknown-uk-aggregate-feed-gtfs-2014 10.56 GiB 10.77 GiB ⬆️+216.47 MiB
Minimum in Latest Reports us-california-san-juan-capistrano-free-weekend-trolley-gtfs-2235 34.49 MiB 34.49 MiB ⬆️+5.84 KiB
Maximum in Latest Reports gb-unknown-uk-aggregate-feed-gtfs-2014 10.56 GiB 10.77 GiB ⬆️+216.47 MiB

@tzujenchanmbd
Copy link

Notice name, fields displayed, and description LGTM!

@qcdyx qcdyx merged commit ee798a1 into master Jan 15, 2025
140 checks passed
@qcdyx qcdyx deleted the 1822-flex-forbidden_pickup_type branch January 15, 2025 14:59
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.

Flex: forbidden_pickup_type Flex: forbidden_drop_off_type
4 participants