Skip to content

Update event_type enum values to snake_case - #247

Merged
chrisyamas merged 10 commits into
developfrom
feature/issue-235-event-naming
Oct 19, 2026
Merged

chrisyamas merged 10 commits into
developfrom
feature/issue-235-event-naming

Conversation

@chrisyamas

@chrisyamas chrisyamas commented Dec 30, 2025 •

Copy link
Copy Markdown
Contributor

Summary

This is a normative, breaking change converting enum values from 'Sentence case' to snake_case across all TIDES-defined vocabularies, for code compatibility. Scope follows the community's decisions, including @botanize's question in #235, the agreement at the Aug 13 Contributors Group meeting to finish the job on this in v2.0, and the consensus reached at the Sept 10 Contributors Group meeting determining that enum sets inherited from external vocabularies should keep their source form. Following the review discussion here, trips_performed.ntd_mode (NTD) now uses the official NTD two-character mode codes (MB, CR, PB, and so on), with Demand Taxi and Other removed since they have no NTD code, and trips_performed.route_type (GTFS) now uses the numeric route type codes GTFS itself uses, including Google's Extended Route Types. This resolves #235.

Changes

Changes include:

  • 11 enum fields converted across 6 schema files (device_type; fare_action and fare_media; all three schedule_relationships; train_car_type; trip_type in both tables; current_status; gps_quality), with device_events.event_type coming in through Rename passenger_events to device_events with expanded scope #251
  • one editorial rename, such that the sentence-long fare media value becomes operator_button_press
  • ntd_mode switched to the 19 NTD two-character mode codes, and the field is left empty when a trip has no NTD mode
  • stop_visits.door_status renamed door_action, with shorter values (none, front_only, back_only, all, other) and a short meaning for each in the field description (Joey's suggestion, with John agreeing)
  • trips_performed.route_type becomes an integer field using the GTFS numeric route type codes, including Google's Extended Route Types (91 codes, covering every value the old list allowed plus 403 and 405, whose names duplicated other entries)
  • fare_action's per-value glossary is updated to match
  • CHANGELOG is rewritten for the full scope

Value mapping tables, including a name-to-code table for route_type, will be included in the migration guide (#274). direction_id is already numeric and is untouched in these changes.

Review checklist

Per change management policy, the following must be met before feature branch changes can merge to develop branch:

  • All JSON files validate
  • Reviewed and approved by 2+ contributors or board members

Community review status (updated October 14, 2026)

How community review works: Per the TIDES Change Management Policy, a proposal moves forward once at least three TIDES Contributors outside the originating working group publicly comment with a score: Accepted, Accepted with minor changes, or Substantially revised. A few sentences with your read of the proposal is a complete review.

Originating working group (Fall 2025 Issues Working Group, December 1 and 10, 2025 sessions): Christopher Yamas, Gabriel Sánchez Martínez, Ian Thistle, Jay Gordon, John Levin, Joey Reid, Spenser Sutinen. Their work is reflected in the proposal itself; community review comes from Contributors beyond this group.

Review so far: @lauriemerrell accepted this change and the Sept 10 Contributors Group meeting settled the scope (TIDES-defined values convert; external vocabularies keep their source form). The full conversion landed September 14 and is re-circulating per the change management policy, with previous reviewers notified. Fresh reviews welcome. A follow-up revision on Oct 7 moved ntd_mode to the NTD two-character codes and accepted John's remained_closed suggestion. A further revision on Oct 14, following Joey's review, renamed door_status to door_action with shorter values and moved route_type to the GTFS numeric codes, and the branch was rebased onto develop after #249, #248, #250, #279, and #251 merged, so the proposal is re-circulating again.

The revised proposal is re-circulating for at least 72 hours per the change management policy; if nothing gives you pause it proceeds, and comments are always welcome.

The full v2.0 map lives on #271.

@chrisyamas chrisyamas self-assigned this Dec 30, 2025
@chrisyamas
chrisyamas requested review from a team as code owners December 30, 2025 17:40
@chrisyamas chrisyamas added 📄 spec Pertains to the specification itself 🔄 normative change A normative change requires approval of TIDES Board labels Dec 30, 2025
@chrisyamas chrisyamas added this to the v2.0 milestone Dec 30, 2025
@github-actions

github-actions Bot commented Dec 30, 2025 •

Copy link
Copy Markdown
Contributor

@chrisyamas chrisyamas added the 📙 docs Elaborating or updating the documentation – inline or otherwise label Dec 30, 2025
@chrisyamas
chrisyamas changed the base branch from main to develop January 2, 2026 16:05
@jlstpaul

jlstpaul commented Jan 2, 2026

Copy link
Copy Markdown
Contributor

This may end up being a separate issue, but I notice that we have bike_rack_deployed, but not bike_rack_raised. We also have ramp_failed but not lift_failed.

@botanize botanize left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me

@CTRAN-Sutinen CTRAN-Sutinen left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Edit: the other events tables need to be updated as well for consistency's sake. if we are going to snake_case enums in passenger events, we should be doing the same in fare events as well.

@lauriemerrell

Copy link
Copy Markdown
Contributor

@botanize proposal in Contributors meeting 8/13: convert this PR to handle all enums so that snake case is adopted uniformly in the 2.0 release

@lauriemerrell lauriemerrell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

putting a request changes review on to indicate the need to update this to handle ALL enums

@jlstpaul

Copy link
Copy Markdown
Contributor

Here are the other enums in the spec right now.

devices.device_type

Current Proposed
"Farebox" farebox
"Fare gate" fare_gate
"Fare vending machine" fare_vending_machine
"Passenger counter" passenger_counter
"Vehicle location" vehicle_location
"Other" Other’

fare_transactions.fare_action

Current Proposed
“Unknown action type" unknown_action_type
“Purchase" purchase
”Enter" enter
"Exit" exit
"Transfer entrance" transfer_entrance
"Transfer exit" transfer_exit
"Add" add
"New" new
"Capture" capture
"Extend" extend
"Combine" combine
"Void" void
"Activate" activate
"Adjust" adjust
"Other" other

fare_transactions.fare_media_id

Current Proposed
"Cash or coins" cash_or_coins
"Smart card or ticket" smart_card_or_ticket
"Magnetic-stripe card or ticket" magnetic-stripe_card_or_ticket
"Bank card" bank_card
"Mobile NFC" mobile_NFC
"Optical scan" optical_scan
"Button pressed by driver or operator to indicate a boarding or alighting passenger." button_pressed by_operator
"Other type" other_type

stop_visits.door_status

Current Proposed
“Doors did not open" doors_did_not_open
"Front door opened and back doors remain closed" front_door_opened_and_back_doors_remain_closed
"Back doors opened and front door remained closed" back_doors_opened_and_front_door_remained_closed
"All doors opened" all_doors_opened
"Other configuration" other_configuration

stop_visits.schedule_relationship

Current Proposed
"Scheduled" scheduled
"Skipped" skipped
"Added" added
"Missing" missing

trips_performed.route_type
Since these come from GTFS, should we leave them or change them?

Current Proposed
"Tram / Streetcar / Light rail"
"Subway / Metro"
"Rail"
"Bus"
"Ferry"
"Cable tram"
"Aerial lift"
"Funicular"
"Trolleybus"
"Monorail"
"Railway Service"
"High Speed Rail Service"
"Long Distance Trains"
"Inter Regional Rail Service"
"Car Transport Rail Service"
"Sleeper Rail Service"
"Regional Rail Service"
"Tourist Railway Service"
"Rail Shuttle (Within Complex)"
"Suburban Railway"
"Replacement Rail Service"
"Special Rail Service"
"Lorry Transport Rail Service"
"All Rail Services"
"Cross-Country Rail Service"
"Vehicle Transport Rail Service"
"Rack and Pinion Railway"
"Additional Rail Service"
"Coach Service"
"International Coach Service"
"National Coach Service"
"Shuttle Coach Service"
"Regional Coach Service"
"Special Coach Service"
"Sightseeing Coach Service"
"Tourist Coach Service"
"Commuter Coach Service"
"All Coach Services"
"Urban Railway Service"
"Metro Service"
"Underground Service"
"All Urban Railway Services"
"Bus Service"
"Regional Bus Service"
"Express Bus Service"
"Stopping Bus Service"
"Local Bus Service"
"Night Bus Service"
"Post Bus Service"
"Special Needs Bus"
"Mobility Bus Service"
"Mobility Bus for Registered Disabled"
"Sightseeing Bus"
"Shuttle Bus"
"School Bus"
"School and Public Service Bus"
"Rail Replacement Bus Service"
"Demand and Response Bus Service"
"All Bus Services"
"Trolleybus Service"
"Tram Service"
"City Tram Service"
"Local Tram Service"
"Regional Tram Service"
"Sightseeing Tram Service"
"Shuttle Tram Service"
"All Tram Services"
"Water Transport Service"
"Air Service"
"Ferry Service"
"Aerial Lift Service"
"Telecabin Service"
"Cable Car Service"
"Elevator Service"
"Chair Lift Service"
"Drag Lift Service"
"Small Telecabin Service"
"All Telecabin Services"
"Funicular Service"
"Taxi Service"
"Communal Taxi Service"
"Water Taxi Service"
"Rail Taxi Service"
"Bike Taxi Service"
"Licensed Taxi Service"
"Private Hire Service Vehicle"
"All Taxi Services"
"Miscellaneous Service"
"Horse-drawn Carriage"

trips_performed.NTD_mode
Since these come from GTFS, should we leave them or change them?

Current Proposed
"Aerial Tramway"
"Alaska Railroad"
"Bus"
"Bus Rapid Transit"
"Cable Car"
"Commuter Bus"
"Commuter Rail"
"Demand Response"
"Demand Taxi"
"Ferryboat"
"Heavy Rail"
"Hybrid Rail"
"Inclined Plane"
"Jitney"
"Light Rail"
"Monorail/Automated Guideway"
"Other"
"Público"
"Streetcar"
"Trolleybus"
"Vanpool"

trips_performed.trip_type

Current Proposed
"In service" in_service
"Deadhead" deadhead
"Layover" layover
"Pullout" pullout
"Pullin" pullin
"Extra Pullout" extra_pullout
"Extra Pullin" extra_pullin
"Deadhead To Layover" deadhead_to_layover
"Deadhead From Layover" deadhead_from_layover
"Other not in service" other_not_in_service

trips_performed.,schedule_relationship

Current Proposed
"Scheduled" scheduled
"Added" added
"Unscheduled" unscheduled
"Canceled" canceled
"Duplicated" duplicated

vehicle_locations.current_status

Current Proposed
"Incoming at" incoming_at
"Stopped at" stopped_at
"In transit to" in_transit_to

vehicle_locations.gps_quality

Current Proposed
"Excellent" excellent
"Good" good
"Poor" poor

vehicle_locations.,schedule_relationship

Current Proposed
"Scheduled" scheduled
"Skipped" skipped
"Added" added
"Missing" missing

@lauriemerrell

Copy link
Copy Markdown
Contributor

In GTFS schedule I though those enums were numeric so the styling shouldn't matter?

(Overall, I accept this change and don't have a strong concern about how the GTFS decision falls, but my vote would be for uniformity in TIDES)

@wtimmerman-fitp

Copy link
Copy Markdown

on GTFS route_type, seconding laurie's comment to refer to the ones here: https://gtfs.org/documentation/schedule/reference/#routestxt

on NTD mode, we could use the two-letter short codes (MB for bus), etc. Trying to find link, but early pages of the NTD reporting guide typically include this

We may need to document as-of dates or version references for these sources in the TIDES spec, since they do change

@botanize

Copy link
Copy Markdown
Contributor

I'm in favor of using consistent formatting for TIDES defined enums, and adopting enums values as if from other standards.

@wtimmerman-fitp

Copy link
Copy Markdown

I wanted to ask @botanize :

I'm in favor of using consistent formatting for TIDES defined enums, and adopting enums values as if from other standards.

so you'd be okay with all snake_case, but okay using NTD (short string initials ala 'MB') and GTFS (numeric) identifiers

also wanted to offer @chrisyamas -- i know there's a lot going on, if you want me to take some of the conversation here and fold this into the PR i'd be happy to help next week. i think i missed in the call what form we wanted the crosswalk to take here, but maybe you can fill me in

@chrisyamas

Copy link
Copy Markdown
Contributor Author

The consensus from the Sept 10 Contributors Group meeting was that TIDES-defined enum values should convert to snake_case, and values inherited from external vocabularies (including route_type from GTFS, ntd_mode from NTD) keep their source form. @botanize's point about GTFS enums being numeric underneath helped settle the compatibility side of this issue, and the inclusion of a crosswalk (advocated by @planitmichael at the Sept 9 TIDES Board meeting) will involve the mapping as a companion artifact in the migration guide, rather than part of this PR. (@wtimmerman-fitp's suggestion of the NTD two-letter codes during the Sept 10 meeting is noted as we move toward the crosswalk conversation)

The branch update implementing this scope is now up. Per the change management policy, the revised proposal recirculates for at least 72 hours with previous reviewers notified. @botanize a new look at this when you have a moment would be great since your approval predates the expanded scope, and @lauriemerrell with the scope question settled, your earlier changes-requested marker can clear whenever suits. Thank you all!

Comment thread spec/stop_visits.schema.json Outdated
"All doors opened",
"Other configuration"
"doors_did_not_open",
"front_door_opened_and_back_doors_remain_closed",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
"front_door_opened_and_back_doors_remain_closed",
"front_door_opened_and_back_doors_remained_closed",

Comment thread spec/trips_performed.schema.json Outdated
"type": "string",
"title": "ID referencing operators.operator_id",
"description": "Identifies the vehicle’s operator."
"description": "Identifies the vehicle\u2019s operator."

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nit: replace with ascii apostrophe throughout? also made this on other PR, saw here too

Comment thread spec/trips_performed.schema.json Outdated
"Monorail/Automated Guideway",
"Other",
"Público",
"P\u00fablico",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

question: i saw the comment in the changelog about preserving source references for NTD, but couldn't we make these use the NTD short codes instead? (Bus -> MB, Commuter Rail -> CR) I think that would derisk weird formatting issues (as we're trying to do in this PR) and still maintain the convention from NTD. Don't know how many TIDES publico reporters we'll get, but "PB" seems easier than having non-ascii characters in the spec and TIDES data, for instance.

A source reference for NTD modes could be found here: https://www.transit.dot.gov/sites/fta.dot.gov/files/2026-06/2026-NTD-Full-Policy-Manual_0.pdf (see footer page 29/ pdf page 47)

Image

I think one challenge is that these modes do evolve from year (BRT got its own mode at one point, etc.). I think for TIDES reporters we could probably safely adopt the 2026 terms, then decide later how to handle evolutions in what NTD defines.

We could also defer this to another ticket to get the 2.0 update out--and i realize this is not a snake_case matter--but it seems fairly straightforward to me and the enum PR seems like it could be the right place.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Agreed. Using the NTD two characters codes is what I thought we were moving towards here. (But I also got a little confused in the conversation). I also agree that this will continue to need some adjustment over time, especially beyond the scope of FTA/NTD.

@jlstpaul

Copy link
Copy Markdown
Contributor

I'd like to get to consensus on the last two fields so we can resolve this PR.

For trips_performed.NTD_mode, I continue to think we should use the two character NTD values. While the use of NTD is limited geographically to the U.S., the list of modes and associated codes is well defined, clearly documented, and somewhat stable. Note that this change would require removing Demand Taxi, Other, and any other existing values that are not in the FTA documentation.

The trips_performed.route_type field is more complex. The current spec copies the text descriptions of the list of route types, including extended route types, from GTFS. That list is very long and overlapping, since it includes both the original and extended route types. (And the GTFS extended route types are themselves derived from the other standards.).

There are several different options for how to proceed with route_type:

Option 1: Leave the field as is. Come back to it at a later date.
Option 2: Switch the field to a numeric enumerated type, with values and descriptions matching the GTFS route_type field.
Option 3: Change the field to an unconstrained text field, with documentation that suggests the possible values, but ultimately leave this up to the agency or data producer to define.

I would vote for Option 1 for inclusion in v2.0-alpha.1. Please reply with your thoghts or suggestions.

@wtimmerman-fitp

Copy link
Copy Markdown

thanks for following up, christopher! Looks fine to me. Maybe we add somewhere in docs that we're referring to the 2026 NTD mode vintage, since that could change later, but not a big deal. i'm okay to move on, approved

@botanize

botanize commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

I would prefer to see the GTFS numeric codes used for route type in the pre-release

@botanize botanize left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I recommend simplifying door_status and implementing all enum changes at this time.

Comment thread spec/stop_visits.schema.json Outdated
Comment on lines +163 to +167
"doors_did_not_open",
"front_door_opened_and_back_doors_remained_closed",
"back_doors_opened_and_front_door_remained_closed",
"all_doors_opened",
"other_configuration"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we could simplify these considerably, and might want to change the name of the field to door_action:

Suggested change
"doors_did_not_open",
"front_door_opened_and_back_doors_remained_closed",
"back_doors_opened_and_front_door_remained_closed",
"all_doors_opened",
"other_configuration"
"none",
"front_only",
"back_only",
"all",
"other"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like these new values and the suggestion to change the field name to door_action

"type": "string",
"description": "Indicates the type of transportation used on a route. References GTFS routes.route_type including Google's [Extended Route Types](https://developers.google.com/transit/gtfs/reference/extended-route-types) GTFS extension",
"constraints": {
"enum": [

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Strongly recommend we change these to the numeric values used by GTFS now and not push this off.

@lauriemerrell lauriemerrell left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I agree with @botanize comments but don't need to independently verify the outcome, not sure if I should mark that as "approved" on the PR or leave myself at commented.

ETA: Below should say "simplicity" 😛

@lauriemerrell
lauriemerrell dismissed their stale review October 9, 2026 19:14

Defer to Joey's requested changes status for simplicy

@chrisyamas

Copy link
Copy Markdown
Contributor Author

Thanks @botanize for the review, and @lauriemerrell for weighing in too! I think it makes sense to take both of these now while these enums are already changing, so implementers only have to update once.

  • door_status will become door_action, with your shorter values (none, front_only, back_only, all, other), which @jlstpaul also liked along with the rename. Since the short values say less on their own, I'm adding a one-line meaning for each to the field description, the same way fare_action does it.
  • route_type will move to the GTFS numeric codes and become an integer field. GTFS itself writes route_type as these numbers, so this is really closer to the source form we were going for on Sept 10. I'm planning to keep Google's Extended Route Types in the list next to the basic GTFS codes, since TIDES has allowed them since v1.0, so nothing that can be expressed today goes away. (Numeric codes also make room for 403 and 405, which share their names with 400 and 12 and so couldn't be listed as text.)

I'll push this shortly and follow up here when the new review window starts. And @wtimmerman-fitp, good call on the 2026 NTD mode vintage, that's going into the migration guide (#274) and the alpha.1 CHANGELOG entry.

@chrisyamas
chrisyamas force-pushed the feature/issue-235-event-naming branch from 70d5bdb to 4f44af3 Compare October 15, 2026 01:52
@github-actions

Copy link
Copy Markdown
Contributor

Data Validation Report

Sample Status
./samples/template/TIDES ⚠️

@chrisyamas

Copy link
Copy Markdown
Contributor Author

Just wanted to give a heads up to @botanize @lauriemerrell @jlstpaul @wtimmerman-fitp @CTRAN-Sutinen that this proposal has been revised again in response to Joey's review, so it's re-circulating per the change management policy (at least 72 hours, previous reviewers notified).

With this round of changes, door_status is renamed door_action and takes Joey's shorter values (none, front_only, back_only, all, other), with a short meaning for each in the field description. trips_performed.route_type now uses the GTFS numeric codes as an integer field, keeping Google's Extended Route Types alongside the basic GTFS codes, so the change is in how values are written rather than in what can be expressed. I also rebased the branch onto the latest develop, which now includes #249, #248, #250, #279, and #251, so this push was a force-push (just this once). The diff here now shows only what this PR adds, since the device_events.event_type conversion came in with #251.

If nothing here gives you pause, it will go ahead and proceed through review in accordance with the CMP, and fresh reviews are welcome either way. @botanize a new look when you have a moment would be great, and @lauriemerrell if an approval on the new head works for you, that would definitely help, though no pressure if you'd rather stay at commented. Thank you all!

@chrisyamas

Copy link
Copy Markdown
Contributor Author

A recap on where this PR stands before we proceed with merging. The revision that followed Joey's review re-circulated for more than 72 hours with no objections, per the change management policy, and it has fresh approvals on the current head from Joey and Wylie, with the CHANGELOG entry in place. So I'm going ahead and merging it into develop as SDWG Chair, in accordance with the CMP's rules for the develop branch, and the TIDES Manager and the Board will review the whole pre-release on the release PR into main. Thank you all for sticking with this one!

@chrisyamas
chrisyamas merged commit 5640e2e into develop Oct 19, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📙 docs Elaborating or updating the documentation – inline or otherwise 🔄 normative change A normative change requires approval of TIDES Board 📄 spec Pertains to the specification itself

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛📄 – Improve event_type naming convention in passenger_events

6 participants