Skip to content

Add notice when a feed's service period does not match its validity period. #2078

@skalexch

Description

@skalexch

Describe the problem

The feed validity period from feed_info.txt should be enough to cover the service periods from calendar.txt and calendar_dates.txt.
Conversely, the overall service period from calendar.txt and calendar_dates.txt should not be much smaller than the validity period, in which case there is a service gap in which the feed is assumed to be valid.

This can be also split into two notices:

  • service_window_extends_past_feed_period --> If [feed_start_date, feed_end_date] does not fully include [min service date, max service date]
  • feed_valid_beyond_total_service_window --> If [feed_start_date, feed_end_date] covers [min service date, max service date] and the difference between them is higher than a threshold (e.g. one week).

Describe the new validation rule

Notice Requirements

Related spec language Rationale for rule Notice name to update or add Pseudologic Notice table columns Severity Notice description
calendar.start_date, calendar.end_date, calendar_dates.date, feed_info.feed_start_date, feed_info.feed_end_date The feed validity period from feed_info.txt should cover every service window from calendar.txt and calendar_dates.txt. service_window_extends_past_feed_period For every entry service_id in calendar.txt:
If calendar.start_date < feed_info.feed_start_date or calendar.end_date > feed_info.feed_end_date: Trigger

For every entry in calendar_dates.txt, if exception_type=2: Continue (Ignore)
else, If date < feed_info.feed_start_date or date > feed_info.feed_end_date: Trigger
serviceId, filename (calendar.txt or calendar_dates.txt), fieldName (calendar.start_date, calendar.end_date or calendar_dates.date), fieldValue INFO A service window is not covered by the feed's validity period.
calendar.start_date, calendar.end_date, calendar_dates.date, feed_info.feed_start_date, feed_info.feed_end_date The feed validity period from feed_info.txt should not extend far beyond the feed's total service window. feed_valid_beyond_total_service_window Compute total service window of the feed totalServiceWindow using calendar.txt and calendar_dates.txt

If totalServiceWindow.start_date < feed_start_date - THRESHOLD or totalServiceWindow.start_date > feed_end_date + THRESHOLD:Trigger
feedStartDate, feedEndDate, totalServiceWindowStartDate, totalServiceWindowEndDate INFO The feed is valid far beyond its total service window.

Sample GTFS datasets

No response

Severity

INFO

Additional context

@emmambd

For service_window_extends_past_feed_period, there might throw several notices for one service_id which is okay, each entry should be fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    new ruleNew rule to be added

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions