-
Notifications
You must be signed in to change notification settings - Fork 75
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
Include names in paths in CSV #930
Conversation
reverse order of name and ID in output and enum. string flags are maintained in request but no longer used. deleted code serves as example of how to use flags.
Updated to add a nested CsvRequestOptions structure to control route, stop, feed ID representation independently (as decided on 2024-02-08 meeting). Order of name and ID have been reversed to place name first. This has been tested locally with no CsvRequestOptions, and with options affecting each of routes and stops separately, as well as together. It seems to work as intended.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall -- just a few suggestions to tidy imports.
src/main/java/com/conveyal/analysis/models/AnalysisRequest.java
Outdated
Show resolved
Hide resolved
src/main/java/com/conveyal/analysis/models/AnalysisRequest.java
Outdated
Show resolved
Hide resolved
src/main/java/com/conveyal/analysis/models/CsvResultOptions.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Anson Stewart <[email protected]>
Co-authored-by: Anson Stewart <[email protected]>
Co-authored-by: Anson Stewart <[email protected]>
This makes it possible to represent stops and routes in CSV output using their names in addition to (or instead of) their IDs. Users have commented that they greatly prefer to work with the names, and often only with the names. Though they're not guaranteed to be unique, in some data sets names are clear enough to work well.
Showing route names has the additional major benefit of showing which modification created a route (instead of a meaningless UUID) in routes that did not come from GTFS.
As recently discussed, this also introduced a freeform
Set<String>
flags field in requests for enabling experimental, undocumented, or arcane behavior in backend or workers. When making a JSON request this will look like"flags": ["csv_names", "csv_no_ids"]
. This should progressively replace all previous special behavior flags that were embedded inside analysis names etc.I have tested this locally and it seems to work for all three entity representations.
Now that it's implemented, a few questions emerge. One is whether it's really worth it to define an enum for
EntityRepresentation { ID_ONLY, NAME_ONLY, ID_AND_NAME }
or it should just be two boolean parameters. Another is whether this would be better represented by actually adding a real enum-typed parameter to the requests. It would require less conversions and make it easier to toggle stop and route representations separately for example.I think the flags facility should still be retained for other purposes even if we stop using it for this purpose.