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

[Warning] Service has zeros in all days of the week within calendar.txt #1940

Open
praneethd7 opened this issue Jan 10, 2025 · 0 comments
Open
Labels
new rule New rule to be added status: Needs triage Applied to all new issues

Comments

@praneethd7
Copy link
Contributor

praneethd7 commented Jan 10, 2025

Describe the problem

I have been experimenting with a bunch of questions for my recent application - TransitGPT. I have encountered this problem where several feeds have 0s for all days of the week for some or all of their services within calendar.txt. Although the service_ids are listed within calendar_dates.txt, it is misguiding the users that want to analyze say the routes or trips running on a typical day of the week. This is because the specification implies that 0 is used for a service that is unavailable:

Indicates whether the service operates on all Mondays in the date range specified by the start_date and end_date fields. Note that exceptions for particular dates may be listed in calendar_dates.txt. Valid options are:

1 - Service is available for all Mondays in the date range.
0 - Service is not available for Mondays in the date range.

Describe the new validation rule

For each service_id (row) check if all days of the week are 0. If yes, raise an error

for each row in calendar.txt:
    if (monday == 0 AND tuesday == 0 AND wednesday == 0 AND thursday == 0 AND friday == 0 AND saturday == 0 AND sunday == 0):
        Trigger a `service_inactive_all_week` notice with the service_id

Sample GTFS datasets

This error has been found in several feeds - 188 of 1967 feeds

Sample Feeds

Details - mdb-12 - mdb-32 - mdb-66 - mdb-88 - mdb-124 - mdb-127 - mdb-129 - mdb-132 - mdb-133 - mdb-156 - mdb-163 - mdb-164 - mdb-167 - mdb-172 - mdb-175 - mdb-177 - mdb-243 - mdb-244 - mdb-254 - mdb-258 - mdb-286 - mdb-300 - mdb-303 - mdb-319 - mdb-322 - mdb-332 - mdb-384 - mdb-388 - mdb-419 - mdb-425 - mdb-426 - mdb-450 - mdb-459 - mdb-519 - mdb-524 - mdb-556 - mdb-560 - mdb-605 - mdb-607 - mdb-614 - mdb-638 - mdb-639 - mdb-659 - mdb-665 - mdb-681 - mdb-682 - mdb-686 - mdb-702 - mdb-769 - mdb-770 - mdb-771 - mdb-772 - mdb-774 - mdb-781 - mdb-783 - mdb-785 - mdb-790 - mdb-800 - mdb-825 - mdb-833 - mdb-834 - mdb-841 - mdb-842 - mdb-843 - mdb-844 - mdb-864 - mdb-888 - mdb-889 - mdb-890 - mdb-895 - mdb-900 - mdb-906 - mdb-914 - mdb-1039 - mdb-1056 - mdb-1075 - mdb-1082 - mdb-1085 - mdb-1132 - mdb-1143 - mdb-1158 - mdb-1173 - mdb-1184 - mdb-1194 - mdb-1213 - mdb-1236 - mdb-1290 - mdb-1291 - mdb-1320 - mdb-1321 - mdb-1328 - mdb-1813 - mdb-1815 - mdb-1859 - mdb-1905 - mdb-1929 - mdb-1957 - mdb-1986 - mdb-2005 - mdb-2009 - mdb-2020 - mdb-2021 - mdb-2022 - mdb-2023 - mdb-2031 - mdb-2045 - mdb-2047 - mdb-2048 - mdb-2051 - mdb-2055 - mdb-2056 - mdb-2061 - mdb-2077 - mdb-2078 - mdb-2089 - mdb-2115 - mdb-2134 - mdb-2139 - mdb-2151 - mdb-2153 - mdb-2208 - mdb-2248 - mdb-2268 - mdb-2290 - mdb-2295 - mdb-2299 - mdb-2322 - mdb-2323 - mdb-2325 - mdb-2328 - ntd-24 - ntd-312 - ntd-10162 - ntd-40037 - ntd-41136 - ntd-44929 - ntd-50060 - ntd-60095 - ntd-60160 - ntd-80150 - ntd-80255 - ntd-90035 - ntd-91092 - tld-55 - tld-105 - tld-158 - tld-159 - tld-169 - tld-204 - tld-235 - tld-342 - tld-388 - tld-461 - tld-674 - tld-849 - tld-851 - tld-956 - tld-993 - tld-1005 - tld-1041 - tld-1058 - tld-1061 - tld-1071 - tld-1178 - tld-1668 - tld-2256 - tld-2272 - tld-2285 - tld-2288 - tld-3400 - tld-4466 - tld-4551 - tld-5573 - tld-5757 - tld-5862 - tld-6078 - tld-6082 - tld-6675 - tld-6678 - tld-6679 - tld-6681 - tld-6682 - tld-6692 - tld-6866 - tld-6897 - tld-6900 - tld-6906 - tld-6907
[gtfs.zip](https://github.com/user-attachments/files/18369698/gtfs.zip)

Severity

While we cannot be sure if this is an error as it does not violate the specification directly it is indicative of a deeper issue especially when more than one or all of the services within the feed are having this. Also, ~10% of feeds having this violation is indicative that it is a common misinterpretation. There are two possible pathways that I can think of whenever a service in calendar.txt has this issue:

  • Raise this as a Warning [OR]
  • Add to the specification that at least one of the days of the week should be 1, which would make this rule an Error. This would hopefully prevent further occurrences as it is on the specification too.

Additional context

No response

@praneethd7 praneethd7 added new rule New rule to be added status: Needs triage Applied to all new issues labels Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new rule New rule to be added status: Needs triage Applied to all new issues
Projects
None yet
Development

No branches or pull requests

1 participant