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: verify conditional requirement of levels.txt presence #966

Merged
merged 7 commits into from
Aug 20, 2021

Conversation

lionel-nj
Copy link
Contributor

Summary:

This PR provides support to verify conditionnal requirements on levels.txt.

  • levels.txt must be provided and non-empty if a row from pathways.txt has pathways.pathway_mode=5.

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 "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)

@MobilityData MobilityData deleted a comment from github-actions bot Aug 18, 2021
@lionel-nj lionel-nj linked an issue Aug 18, 2021 that may be closed by this pull request
@lionel-nj lionel-nj marked this pull request as ready for review August 18, 2021 19:01
@lionel-nj lionel-nj self-assigned this Aug 18, 2021
Copy link
Contributor

@maximearmstrong maximearmstrong left a comment

Choose a reason for hiding this comment

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

Great job! A single question in-line before approving :)

Copy link
Contributor

@maximearmstrong maximearmstrong left a comment

Choose a reason for hiding this comment

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

Excellent 🎉

@maximearmstrong maximearmstrong merged commit bfa30d7 into master Aug 20, 2021
@maximearmstrong maximearmstrong deleted the feat/check-levels-presence branch August 20, 2021 15:11
@isabelle-dr
Copy link
Contributor

@lionel-nj can you rename this notice as "MissingLevelsFileNotice" to be consistent with MissingCalendarAndCalendarDateFilesNotice?

@lionel-nj
Copy link
Contributor Author

lionel-nj commented Aug 23, 2021 via email

@isabelle-dr
Copy link
Contributor

Should this be set at an error severity to be consistent with the spec and the other missing required file notices in the validator?

@lionel-nj
Copy link
Contributor Author

Should this be set at an error severity to be consistent with the spec and the other missing required file notices in the validator?

Yes!

if (levels.entityCount() != 0) {
return;
}
ListMultimap<GtfsPathwayMode, GtfsPathway> byPathwayModeMap = ArrayListMultimap.create();
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the purpose of this map? Are you using it for any goal other than to check whether there is a pathway of mode=elevator?

Did you have an intention to extend this code in the future?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@aababilov As mentioned in #994 (comment), I used this as a way to avoid checking if each pathway has pathway mode set to elevator - we could remove it, but would need to do the additional check for each pathway.

@isabelle-dr isabelle-dr mentioned this pull request Oct 28, 2021
4 tasks
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.

Add validation on levels.txt presence
4 participants