Skip to content

JosePazNoguera/NRAS

Repository files navigation

NRAS

The project is designed to use a collection of indicators to flag and calculate scenarios in which to decide stations that should be upgraded to a step free and accessible category (A and B1)

Scenario_generator.py

This script is written and designed to calculate scenario data relating to an upgrade or change in station categories allowing the user to run the code and generate results based on these new conditions.

Scenarios.xlsx - this is an Excel file containing all station codes under the column ‘CRS CODE’ and station name ‘Station Name (MOIRA Name)’. The following columns are the different scenarios to be processed, labelled by their scenario label i.e. ‘CW_CP7’ and new category labels for all stations to be upgraded within the rows below. The ‘SCENARIO MASTER’ sheet also contains the scenario description of each scenario label

Step Free Scoring.xlsx - this is a workbook previously created, containing the base scores and categories for all stations, this is read in as an input to be the template for the upgraded categories/scenario

MOIRAOD.accdb - the access database that is provided by NR, this provides the list of all stations, their categories and journey data, in the form of an O-D Matrix, this is read in a template for the journey data calculations

Dashboard Script - powerbi_table_generator.py

This script is written and design to calculate scenario data relating to an upgrade or change in station categories allowing the user to run the code in PowerBi and view the new values in the KPIs dynamically.

Inputs:

Input template.xlsx - this is a workbook containing the station codes and new category label of all stations to be upgraded in a given scenario, the input template allows to specify any number of scenarios

Step Free Scoring.xlsx - this is a workbook previously created, containing the base scores and categories for all stations, this is read in as an input to be the template for the upgraded categories/scenario

MOIRAOD.accdb - the access database that is provided by NR, this provides the list of all stations, their categories and journey data, in the form of an O-D Matrix, this is read in a template for the journey data calculations

What the script does:

  1. The script then reads in the OD Matrix and the input template; defined by the user before running, into data frames and updates the station categories by the values defined in the input csv, this is done in the functions below
def scenario_input():

def input_OD_Matrix():

def map_input_stations(OD_df, input_df):
  1. The following elements are saved into a clone of the original spreadsheet: a. new station categories b. scenario description c. a series of KPI's d. a national OD Matrix summarized total journeys are grouped by station and are outputted to a new spreadsheet with the updated categories listed
def into_stepfree_spreadsheet(grouped_origin_df, grouped_destination_df, path_of_spreadsh, scenario_desc, pivot):

Outputs:

  • New OD Matrix (PowerBi Table): Generated by the MOIRAOD database and the input template csv, the stations reflect the upgraded stations from the csv

  • Scenario Spreadsheets Spreadsheet generated from the xlsx, input csv and the MOIRAOD file, the sheets ‘st_cat’, Inaccessible O Accessi D, Accessible O Inaccessi D are all updated to reflect the new categories

  • An output log of the calculations that occured in that single run as a txt file

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published