cal-itp / reports

GTFS data quality reports for California transit providers
https://reports.calitp.org
GNU Affero General Public License v3.0
7 stars 0 forks source link

User Story: Reports include RT presence and speedmap link, if available #183

Closed edasmalchi closed 1 year ago

edasmalchi commented 2 years ago

Summary

As a transit agency or other interested stakeholder, I want to know if my agency currently publishes a GTFS-RT feed so that I know whether or not we are providing realtime information to riders. Additionally, I want to be able to see my speedmap if available so that I can work with Caltrans and other jurisdictions to advance transit priority projects.

Acceptance Criteria

  1. report indicates presence of GTFS-RT feed
  2. report includes link to relevant speedmap, if any
  3. report includes brief text explaining relevance of GTFS-RT and requirements to generate a speedmap

Notes

Ideally this could be implemented soon, before GTFS-RT mart tables are fully built out. One approach could be to generate the links from https://github.com/cal-itp/data-analyses/blob/main/portfolio/sites/rt.yml

Tester [Stakeholder]

  1. @edasmalchi

Sprint Ready Checklist

    • [ ] Acceptance criteria defined
    • [ ] Team understands acceptance criteria
    • [ ] Team has defined solution / steps to satisfy acceptance criteria
    • [ ] Acceptance criteria is verifiable / testable
    • [ ] External / 3rd Party dependencies identified
edasmalchi commented 2 years ago

Wanted to flag that @tiffanychu90 figured out generating speedmap links from the portfolio -- sharing here:

script for link assembly

https://github.com/cal-itp/data-analyses/blob/8100fcd21a64fa6437ddb36701d77470b7592362/bus_service_increase/deploy_portfolio_yaml.py#L107-L129

as-deployed in Tiffany's notebook

RT_SITE_YAML = "../portfolio/sites/rt.yml"

# Grab list of ITP IDs with GTFS RT speedmaps
rt_itp_id_dict = deploy_portfolio_yaml.check_if_rt_data_available(RT_SITE_YAML)

if itp_id in list(rt_itp_id_dict.keys()):

    # Construct the URL 
    RT_URL = ("https://analysis.calitp.org/rt/"
              f"district_{district_number}-{district_name}/"
              f"{rt_itp_id_dict[itp_id]}__speedmaps__"
              f"district_{district_number}-{district_name}__"
              f"itp_id_{itp_id}.html"
             ) 

    # If this ITP ID is found in RT analysis, give URL to that operator in analysis.calitp.org
    display(HTML(f'''<a href={RT_URL}>GTFS RT speedmaps here.</a>'''))

else:
    display(HTML("No GTFS RT data available."))