Skip to content

A set of scripts for working with TransitMaster

License

Notifications You must be signed in to change notification settings

mbta/registered

Repository files navigation

Registered

A set of scripts for working with TransitMaster. Reference the rating process documentation here.

Effect: Different steps throughout the rating process. Allows data validation before importing into TransitMaster. Circumstances: As needed. Generally once per quarterly rating. Required Skills: None Required Tools: VPN access, Git, a text editor, access to TM databases

Setup

Reminder: Before the set-up process, clone the registered repository and make sure you're working within it.

Linux/MacOS

$ brew install freetds gdal uv
$ uv python install
$ uv sync
$ cp .env.template .env
$ vi .env

Windows

$ powershell -ExecutionPolicy ByPass -c "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; irm https://astral.sh/uv/install.ps1 | iex"
$ set Path=C:\Users\%USERNAME%\.cargo\bin;%Path%
$ uv python install
$ uv sync
$ copy .env.template .env
$ notepad .env

HASTUS sync

Sync a HASTUS export to the TransitMaster server, validating the data in the process.

  • Writes the data to support/ratings/* for later processing if needed.
  • Will prompt for your AD password, or you can put it in the AD_PASSWORD environment variable. If you have trouble logging in, set USERNAME to your AD account.
$ uv run python -m registered.hastus_sync

If you're testing, add --no-push to avoid actually updating the rating data on the TM server.

Scripts

For the scripts below, you will have to access the rating folder on <TRANSITMASTER_FILE_SERVER> on your local machine to direct it to the right path. If you're working from a PC computer, you are all set. If you're working from a MAC, follow the instructions below.

Linux/MacOS

  • From your MAC, open finder
  • Click 'Go'
  • Click 'Connect to Server'
  • Type 'smb://<TRANSITMASTER_FILE_SERVER>/c$/Ratings'
  • Access the files at '/Volumes/Ratings/[Rating]' (i.e. /Volumes/Ratings/Winter12202020)

Merge

Merge a set of rating files together in the Combine directory. This step is found under TM-03.05, step 2 in TransitMaster New Rating Procedure

Writes the merged files to <rating>.pat, <rating>.nde, &c.

$ uv run run python -m registered.merge <path to Rating/Combine>

Validate

Validate that the rating files are correct. This step is found under TM-03.05, step 4 (Integrity Checker) in TransitMaster New Rating Procedure

Exits with 1 if there were any errors.

$ uv run python -m registered.validate <path to Rating/Combine or Rating/Combine/HASTUS_export>

Calendar

Print a CSV which has the service information for each garage, by date. This step is meant to help facilitate TM-03.05, step 7 in TransitMaster New Rating Procedure

$ uv run python -m registered.calendar <path to Rating/Combine/HASTUS_export>

Cheat Sheet

Print a summary of the relevant dates/services for the rating.

$ uv run python -m registered.cheat_sheet <path to Rating/Combine/HASTUS_export>

Stop Comparison

Print a CSV which shows new/changed stops between two ratings. This step is found under TM-03.06, step 1 in TransitMaster New Rating Procedure

  1. Copy .env.template to .env and fill out at least the following variables with the TransitMaster DB server information from 1Password.
    • TRANSITMASTER_DATABASE_SERVER
    • TRANSITMASTER_UID
    • TRANSITMASTER_PWD
$ uv run python -m registered.stop_comparison <path to current Rating/Combine> <path to next Rating/Combine>

Missing/Stop Intervals

Writes an HTML file showing calculated distance/direction intervals which are not in the TransitMaster database.

This step is found under TM-03.06, step 2 in TransitMaster New Rating Procedure

  1. Copy .env.template to .env and fill out at least the following variables with the TransitMaster DB server information from 1Password.
    • TRANSITMASTER_DATABASE_SERVER
    • TRANSITMASTER_UID
    • TRANSITMASTER_PWD
$ uv run python -m registered.missing_intervals intervals.html

And then open intervals.html in your browser.

For stop intervals:

$ uv run python -m registered.stop_intervals intervals.html --stop-id=32549

About

A set of scripts for working with TransitMaster

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published