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

Implement #212 - Increasing distance stop times verification #350

Merged
merged 9 commits into from
Sep 4, 2020

Conversation

lionel-nj
Copy link
Contributor

@lionel-nj lionel-nj commented Aug 25, 2020

Summary:

This PR provides support to verify that for each stop time of a trip have increasing shape_dist_travelled valued

Expected behavior:

The Python validator code treats this rule as follows:

  • two consecutive stops times have same value for shape_dist_travelled-> this is an error
  • two consecutive stop times have values of shape_dist_travelled not ordered by ascending order -> this is an error

Code fro the Python valdiator https://github.com/MobilityData/transitfeed/blob/54a4081b59bfa015d5f0405b68203e61762d4a52/transitfeed/trip.py#L594

Tests from the python validator

https://github.com/MobilityData/transitfeed/blob/54a4081b59bfa015d5f0405b68203e61762d4a52/tests/transitfeed/testtrip.py#L357

Explain and/or show screenshots for how you expect the pull request to work in your testing (in case other devices exhibit different behavior).

Capture d’écran, le 2020-08-25 à 11 29 47

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
  • Format the title like "Fix #<issue_number> - " (for example - "Fix Bug: Running using documented Docker documentation fails #1111 - Check for null value before using field")
  • Linked all relevant issues
  • Include screenshot(s) showing how this pull request works and fixes the issue(s)

lionel-nj added 5 commits August 25, 2020 11:32
- write new error and warning notices
- export notices as pb and json
  - write test to verify said export
- write test to verify said implementation
@lionel-nj lionel-nj requested a review from barbeau August 25, 2020 16:00
@lionel-nj lionel-nj self-assigned this Aug 25, 2020
@lionel-nj lionel-nj added the python validator Rules implemented in the original Google Python Validator label Aug 25, 2020
Copy link
Member

@barbeau barbeau left a comment

Choose a reason for hiding this comment

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

Thanks @lionel-nj! Some comments in-line.

- remove unused Notice
- rework notice constructor for consistency and clarity
  - rename notice
  - update related tests
- update rules docs
  - write additional test
@lionel-nj lionel-nj requested a review from barbeau August 28, 2020 20:29
lionel-nj added 2 commits September 4, 2020 14:50
- change error code for future merge to master
# Conflicts:
#	RULES.md
#	adapter/exporter/src/main/java/org/mobilitydata/gtfsvalidator/exporter/JsonNoticeExporter.java
#	adapter/exporter/src/main/java/org/mobilitydata/gtfsvalidator/exporter/ProtobufNoticeExporter.java
#	adapter/exporter/src/test/java/org/mobilitydata/gtfsvalidator/exporter/JsonNoticeExporterTest.java
#	adapter/exporter/src/test/java/org/mobilitydata/gtfsvalidator/exporter/ProtobufNoticeExporterTest.java
#	domain/src/main/java/org/mobilitydata/gtfsvalidator/domain/entity/notice/NoticeExporter.java
#	domain/src/main/java/org/mobilitydata/gtfsvalidator/domain/entity/notice/base/ErrorNotice.java
#	domain/src/main/java/org/mobilitydata/gtfsvalidator/domain/entity/notice/base/Notice.java
Copy link
Member

@barbeau barbeau left a comment

Choose a reason for hiding this comment

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

LGTM!

# Conflicts:
#	adapter/exporter/src/main/java/org/mobilitydata/gtfsvalidator/exporter/JsonNoticeExporter.java
#	adapter/exporter/src/main/java/org/mobilitydata/gtfsvalidator/exporter/ProtobufNoticeExporter.java
#	adapter/exporter/src/test/java/org/mobilitydata/gtfsvalidator/exporter/JsonNoticeExporterTest.java
#	adapter/exporter/src/test/java/org/mobilitydata/gtfsvalidator/exporter/ProtobufNoticeExporterTest.java
#	domain/src/main/java/org/mobilitydata/gtfsvalidator/domain/entity/notice/NoticeExporter.java
#	domain/src/main/java/org/mobilitydata/gtfsvalidator/domain/entity/notice/base/Notice.java
#	domain/src/main/java/org/mobilitydata/gtfsvalidator/domain/entity/notice/base/WarningNotice.java
@lionel-nj lionel-nj merged commit 3202d79 into master Sep 4, 2020
@lionel-nj lionel-nj deleted the increasing-distance-stop-times-verification branch September 4, 2020 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python validator Rules implemented in the original Google Python Validator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[REQUEST] Implement stop times time and distance verification for a trip
2 participants