From 05a77c5edc1a979d2482f628ea02057808f81831 Mon Sep 17 00:00:00 2001 From: Andrew Rohne Date: Wed, 20 Sep 2023 17:25:25 -0400 Subject: [PATCH 01/22] Updates to run locally. More information is in Local Machine Instructions.md. --- HostnamesWithCube.txt | 1 + Local Machine Instructions.md | 39 +++++++++++++++++++++++++++++++++++ Wrangler/HighwayNetwork.py | 6 ++++-- _static/Cube/CubeNet.py | 11 +++++----- 4 files changed, 49 insertions(+), 8 deletions(-) create mode 100644 HostnamesWithCube.txt create mode 100644 Local Machine Instructions.md diff --git a/HostnamesWithCube.txt b/HostnamesWithCube.txt new file mode 100644 index 0000000..d18580b --- /dev/null +++ b/HostnamesWithCube.txt @@ -0,0 +1 @@ +localhost \ No newline at end of file diff --git a/Local Machine Instructions.md b/Local Machine Instructions.md new file mode 100644 index 0000000..4677f6a --- /dev/null +++ b/Local Machine Instructions.md @@ -0,0 +1,39 @@ +# Intro + +This code has been updated to run on a laptop that has Cube Voyager 6.5.0 installed locally. This is primarily the removal and override of anything that appears to be MTC specific (e.g. paths to cube hostnames and a batch file used when calling runtpp). + +Questions can be directed to Andrew Rohne at RSG (andrew.rohne (at) rsginc.com). 9/20/2023. + +# Setting Up Network Wrangler + +1. Created an Anaconda environment + conda create --name NetworkWrangler python=3.9 +2. Switched to it + conda activate NetworkWrangler +3. Installed packages + conda install pandas pywin32 + conda install xlrd + pip install SimpleParse + pip install partridge +4. Open python, import NetworkWrangler, ensure no errors +5. Get the base network - clone https://github.com/BayAreaMetro/TM1_2015_Base_Network to a local folder (I used C:\Models) +6. Get the projects from Box + From https://mtcdrive.box.com/s/unic7tf0sokleacg4fgu0dtu8ixkyfg6 + Copied to the files folder as "04_Network_Work\MTC Data\NetworkProjects_20230719.zip + I unzipped to C:\Models\TM1_NetworkProjects +7. Also download everything on Box since July 19 + Copied to files folder as "04_Network_Work\MTC Data\TM1_NetworkProjects-selected.zip" +8. Create a Cube hostname file called "HostnamesWithCube.txt". For local installations, that file should have the word "localhost" (no quotes) in it. +9. Set base network env var + conda env config vars set "TM1_2015_Base_Network=C:\Models\TM1_2015_Base_Network" + conda env config vars set "TM1_NetworkProjects=C:\Models\TM1_NetworkProjects" + conda env config vars set "CUBE_HOST_FILE=C:\Models\NetworkWrangler\HostnamesWithCube.txt" + conda activate NetworkWrangler + +# Running Network Wrangler for the Base Year + +1. Be in the correct Anaconda Environment (if not already) + conda activate NetworkWrangler +2. Build the test network + python .\build_network_mtc.py Test .\net_spec_test.py + diff --git a/Wrangler/HighwayNetwork.py b/Wrangler/HighwayNetwork.py index 5b890c5..d7b0d22 100644 --- a/Wrangler/HighwayNetwork.py +++ b/Wrangler/HighwayNetwork.py @@ -1,4 +1,5 @@ import collections, csv, os, re, shutil, subprocess, time +import copy from socket import gethostname, getfqdn from .HwySpecsRTP import HwySpecsRTP @@ -31,7 +32,8 @@ def getCubeHostnames(): # read them HighwayNetwork.cube_hostnames = [] - f = open(r"Y:\COMMPATH\HostnamesWithCube.txt") + env = copy.copy(os.environ) + f = open(env['CUBE_HOST_FILE']) for line in f: if line[0] == "#": continue HighwayNetwork.cube_hostnames.append(line.split()[0]) # use the first token of non-comment lines @@ -146,7 +148,7 @@ def applyProject(self, parentdir, networkdir, gitdir, projectsubdir=None, **kwar # dispatch it, cube license hostname = gethostname().lower() - if hostname not in HighwayNetwork.getCubeHostnames(): + if False: #hostname not in HighwayNetwork.getCubeHostnames(): print("Dispatching cube script to taraval from %s".format(hostname)) f = open(os.path.join(applyDir,'runtpp_dispatch.tmp'), 'w') f.write("runtpp " + applyScript + "\n") diff --git a/_static/Cube/CubeNet.py b/_static/Cube/CubeNet.py index c77a136..776ce70 100644 --- a/_static/Cube/CubeNet.py +++ b/_static/Cube/CubeNet.py @@ -22,8 +22,8 @@ def getCubeHostnames(): # at mtc, assume cube license is available if fqdn.endswith("mtc.ca.gov"): return [ gethostname().lower() ] - - f = open(r"Y:\COMMPATH\HostnamesWithCube.txt") + env = copy.copy(os.environ) + f = open(env['CUBE_HOST_FILE']) for line in f: if line[0] == "#": continue hostnames.append(line.split()[0]) # use the first token of non-comment lines @@ -88,10 +88,9 @@ def export_cubenet_to_csvs(file, extra_link_vars=[], extra_node_vars=[], sys.exit(2) env["MACHINES"] = CUBE_COMPUTER - - cmd = r'y:\champ\util\bin\dispatch-one.bat "runtpp ' + script + '"' - print(cmd) - proc = subprocess.Popen( cmd, cwd = filedir, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env) + + cmd = f'runtpp "{script}"' + proc = subprocess.Popen( cmd, cwd = filedir, stdout=subprocess.PIPE, stderr=subprocess.PIPE )#, env=env) for line in proc.stdout: if type(line)==bytes: line = line.decode() # convert to string, not byetes line = line.strip('\r\n') From 57dbb54ab8f709332c69b3ceea5cf4a39ef296f0 Mon Sep 17 00:00:00 2001 From: Andrew Rohne Date: Thu, 21 Sep 2023 16:50:28 -0400 Subject: [PATCH 02/22] Additional updates to instructions and python scripts to ensure compatibility with Python 3. --- Local Machine Instructions.md | 92 +++++++++++++------ scripts/build_network.py | 48 +++++----- scripts/build_network_mtc_futures.py | 4 +- .../net_spec_MAJ_BRT030001_BART_to_SanJose.py | 77 ++++++++++++++++ 4 files changed, 169 insertions(+), 52 deletions(-) create mode 100644 scripts/net_spec_MAJ_BRT030001_BART_to_SanJose.py diff --git a/Local Machine Instructions.md b/Local Machine Instructions.md index 4677f6a..4a4a835 100644 --- a/Local Machine Instructions.md +++ b/Local Machine Instructions.md @@ -4,36 +4,76 @@ This code has been updated to run on a laptop that has Cube Voyager 6.5.0 instal Questions can be directed to Andrew Rohne at RSG (andrew.rohne (at) rsginc.com). 9/20/2023. -# Setting Up Network Wrangler +# Setting Up Cube + +The computer's path needs to include the path to Cube Voyager to use an executable there. Follow [these instructions](https://www.computerhope.com/issues/ch000549.htm) for your OS version, add C:\Program Files\Citilabs\CubeVoyager to the path. + +To test this, open any command prompt () and type `runtpp`. There should be an error that says "Error in Arg 1: (null)". -1. Created an Anaconda environment - conda create --name NetworkWrangler python=3.9 -2. Switched to it - conda activate NetworkWrangler -3. Installed packages - conda install pandas pywin32 - conda install xlrd - pip install SimpleParse - pip install partridge -4. Open python, import NetworkWrangler, ensure no errors -5. Get the base network - clone https://github.com/BayAreaMetro/TM1_2015_Base_Network to a local folder (I used C:\Models) -6. Get the projects from Box - From https://mtcdrive.box.com/s/unic7tf0sokleacg4fgu0dtu8ixkyfg6 - Copied to the files folder as "04_Network_Work\MTC Data\NetworkProjects_20230719.zip +# Setting Up Network Wrangler +1. Download the [Anaconda environment](https://github.com/RSGInc/travel-model-one/blob/transit_2050/tm15-python310.yml) to a location on your hard drive. +1. Created the local Anaconda environment. Open Anaconda Prompt or Anaconda Powershell (either will work, hereinafter referred to as Anaconda Prompt) and type: + `cd path\you\downloaded\the\above\file\to` + `conda create -f tm15-python310.yml` +2. Switched to it. Use the following command in the Anaconda prompt + `conda activate tm15-python310` +3. Change directories to an appropriate location on your hard drive. +4. Clone the network Wrangler Repo + `git clone https://github.com/RSGInc/NetworkWrangler.git` +5. Go into that folder and checkout the transit_2050 branch + `git checkout transit_2050` +6. Install NetworkWrangler. + `cd NetworkWrangler` + `pip install -e .` +7. Open python, import NetworkWrangler, ensure no errors +8. Get the base network - clone https://github.com/BayAreaMetro/TM1_2015_Base_Network to a local folder (I used C:\Models). This probably should not be done inside the network wrangler folder. +9. Get the projects from Box + Not-RSG: From https://mtcdrive.box.com/s/unic7tf0sokleacg4fgu0dtu8ixkyfg6 + RSG: I Copied to the files folder to Sharepoint as "04_Network_Work\MTC Data\NetworkProjects_20230719.zip I unzipped to C:\Models\TM1_NetworkProjects -7. Also download everything on Box since July 19 - Copied to files folder as "04_Network_Work\MTC Data\TM1_NetworkProjects-selected.zip" -8. Create a Cube hostname file called "HostnamesWithCube.txt". For local installations, that file should have the word "localhost" (no quotes) in it. -9. Set base network env var - conda env config vars set "TM1_2015_Base_Network=C:\Models\TM1_2015_Base_Network" - conda env config vars set "TM1_NetworkProjects=C:\Models\TM1_NetworkProjects" - conda env config vars set "CUBE_HOST_FILE=C:\Models\NetworkWrangler\HostnamesWithCube.txt" - conda activate NetworkWrangler - -# Running Network Wrangler for the Base Year +10. Also download everything on Box since July 19 + Not-RSG: use box, sort by date, select all necessary + RSG: Copied to files folder as "04_Network_Work\MTC Data\TM1_NetworkProjects-selected.zip" +11. Set base network env var. Use these commands in an Anaconda prompt: + `conda env config vars set "TM1_2015_Base_Network=C:\Models\TM1_2015_Base_Network"` + `conda env config vars set "TM1_NetworkProjects=C:\Models\TM1_NetworkProjects"` + `conda env config vars set "CUBE_HOST_FILE=C:\Models\NetworkWrangler\HostnamesWithCube.txt"` + `conda activate NetworkWrangler` + Note: you can test these using `conda env config vars list` +# Running Network Wrangler for the Base Year 1. Be in the correct Anaconda Environment (if not already) - conda activate NetworkWrangler + conda activate tm15-python310 2. Build the test network python .\build_network_mtc.py Test .\net_spec_test.py +# Adding Project Cards + +--- +Note: This is still being written! +--- + +This largely follows [the Network Wrangler Documentation](https://github.com/BayAreaMetro/modeling-website/wiki/Network-Building-with-NetworkWrangler#step-4-build-a-network-with-your-project) but is distilled down to something a little more concise. + +The basic version is to add the cards to the TM1_NetworkProjects folder, and then copy the net_spec_test.py script to something a little more descriptive (for the BART San Jose example, I used `net_spec_MAJ_BRT030001_BART_to_SanJose.py`). The script needs to have a project code, scenario (for the purposes of this project, I use `build`) + +Run with `python build_network_mtc.py build net_spec_MAJ_BRT030001_BART_to_SanJose.py` + +## Determine Pre-requisite Projects + + + +# Notes and Errors + +## Pre-requisite Projects + +If you see this: `WranglerLogger: DEBUG !!!WARNING!!! Some PRE-REQUISITES were not found or ordered correctly. Continue anyway? (y/n)`, that means you're missing one or more projects and these projects are required for the project you're using to work. Listed above this, you'll see the pre-requisite projects: + +``` +WranglerLogger: INFO Requirement verification - Pre-requisite +WranglerLogger: INFO Year Project Pre-requisite Project Year +WranglerLogger: INFO trn 2020.trn.01 MAJ_BRT030001_BART_to_SanJose trn ALA050015_BART_to_WarmSprings -1 +WranglerLogger: INFO trn 2020.trn.01 MAJ_BRT030001_BART_to_SanJose trn SCL110005_BART_to_Berryessa -1 +``` + +In this case, it can be fixed by including the prerequisite projects in the appropriate network. \ No newline at end of file diff --git a/scripts/build_network.py b/scripts/build_network.py index cd5505d..759fcdf 100644 --- a/scripts/build_network.py +++ b/scripts/build_network.py @@ -217,21 +217,21 @@ def writeRequirementsToScreen(REQUIREMENTS, req_type='prereq'): else: return None - print "Match type 2: Perfect match " - print "Match type 1: Possible match " - print "Match type 0: No match " - print "------------------------------ " + print("Match type 2: Perfect match ") + print("Match type 1: Possible match ") + print("Match type 0: No match ") + print("------------------------------ ") for net in REQUIREMENTS.keys(): proj_name_max_width = 22 - print "--------------------------------------------------------------------------------------------" - print "%s" % net.upper() - print "--------------------------------------------------------------------------------------------" - print " REQ NET MATCH POSSIBLE NET " - print "PROJECT TYPE TYPE %-23sLEVEL %-23sTYPE" % (print_req.upper(), print_req.upper()+' MATCH') - print "---------------------- ------ ----- ---------------------- ----- ---------------------- ----" + print("--------------------------------------------------------------------------------------------") + print("%s" % net.upper()) + print("--------------------------------------------------------------------------------------------") + print(" REQ NET MATCH POSSIBLE NET ") + print("PROJECT TYPE TYPE %-23sLEVEL %-23sTYPE" % (print_req.upper(), print_req.upper()+' MATCH')) + print("---------------------- ------ ----- ---------------------- ----- ---------------------- ----") if REQUIREMENTS[net].keys() == []: - print "NO %sS FOUND FOR %s NETWORK TYPE" % (print_req.upper(), net.upper()) + print("NO %sS FOUND FOR %s NETWORK TYPE" % (print_req.upper(), net.upper())) for proj in REQUIREMENTS[net].keys(): for req in REQUIREMENTS[net][proj].keys(): @@ -269,8 +269,8 @@ def writeRequirementsToScreen(REQUIREMENTS, req_type='prereq'): else: line_to_print = line_to_print + '\n' + line_part_one + "%-6s%-23s%-4s\n" %("NA","MISSING","NA") i += 1 - print line_to_print - print '\n' + print(line_to_print) + print('\n') def getProjectAttributes(project): # Start with TAG if not build mode, no kwargs @@ -303,7 +303,7 @@ def getProjectAttributes(project): os.environ['CHAMP_NODE_NAMES'] = CHAMP_NODE_NAMES if len(args) < 1: - print USAGE + print(USAGE) sys.exit(2) NETWORK_CONFIG = args[0] @@ -322,7 +322,7 @@ def getProjectAttributes(project): if o=="-c": CONFIG_WORD = a if BUILD_MODE not in [None,"test"]: - print USAGE + print(USAGE) sys.exit(2) if BUILD_MODE=="test": @@ -334,25 +334,25 @@ def getProjectAttributes(project): # Verify mandatory fields are set if PROJECT==None: - print "PROJECT not set in %s" % NETWORK_CONFIG + print(f"PROJECT not set in {NETWORK_CONFIG}") sys.exit(2) if YEAR==None: - print "YEAR not set in %s" % NETWORK_CONFIG + print(f"YEAR not set in {NETWORK_CONFIG}") sys.exit(2) if SCENARIO==None: - print "SCENARIO not set in %s" % NETWORK_CONFIG + print(f"SCENARIO not set in {NETWORK_CONFIG}") sys.exit(2) if TAG==None: - print "TAG not set in %s" % NETWORK_CONFIG + print(f"TAG not set in {NETWORK_CONFIG}") sys.exit(2) if OUT_DIR==None: - print "OUT_DIR not set in %s" % NETWORK_CONFIG + print(f"OUT_DIR not set in {NETWORK_CONFIG}") sys.exit(2) if TRANSIT_CAPACITY_DIR==None: - print "TRANSIT_CAPACITY_DIR not set in %s" % NETWORK_CONFIG + print(f"TRANSIT_CAPACITY_DIR not set in {NETWORK_CONFIG}") sys.exit(2) if NETWORK_PROJECTS==None: - print "NETWORK_PROJECTS not set in %s" % NETWORK_CONFIG + print(f"NETWORK_PROJECTS not set in {NETWORK_CONFIG}") sys.exit(2) # Set up logging @@ -464,7 +464,7 @@ def getProjectAttributes(project): (prereqs, coreqs, conflicts) = networks[netmode].getReqs(networkdir=project_name, projectsubdir=tail, tag=tag, projtype=projType, tempdir=TEMP_SUBDIR) - print "Checking projType... %s" % projType + print(f"Checking projType... {projType}") if projType=='plan': #Open specs file and get list of projects specFile = os.path.join(TEMP_SUBDIR,NETWORK_PLAN_SUBDIR,'planSpecs.csv') @@ -675,4 +675,4 @@ def getProjectAttributes(project): Wrangler.WranglerLogger.debug("Wrote transit report to %s" % transit_report_filename) Wrangler.WranglerLogger.debug("Successfully completed running %s" % os.path.abspath(__file__)) - print "Remember to copy MissionLocalDelay.csv from the Muni_2011Oct dir!" + print("Remember to copy MissionLocalDelay.csv from the Muni_2011Oct dir!") diff --git a/scripts/build_network_mtc_futures.py b/scripts/build_network_mtc_futures.py index 6ec274d..9c6a454 100644 --- a/scripts/build_network_mtc_futures.py +++ b/scripts/build_network_mtc_futures.py @@ -201,9 +201,9 @@ continue # Initialize output subdirectories up a level (not in scratch) - hwypath=os.path.join("..", SCENARIO, OUT_DIR.format(YEAR),HWY_SUBDIR) + hwypath=os.path.join("..", SCENARIO, OUT_DIR.format(YEAR),build_network_mtc.HWY_SUBDIR) if not os.path.exists(hwypath): os.makedirs(hwypath) - trnpath = os.path.join("..", SCENARIO, OUT_DIR.format(YEAR),TRN_SUBDIR) + trnpath = os.path.join("..", SCENARIO, OUT_DIR.format(YEAR),build_network_mtc.TRN_SUBDIR) if not os.path.exists(trnpath): os.makedirs(trnpath) networks['hwy'].write(path=hwypath,name=HWY_NET_NAME,suppressQuery=True, diff --git a/scripts/net_spec_MAJ_BRT030001_BART_to_SanJose.py b/scripts/net_spec_MAJ_BRT030001_BART_to_SanJose.py new file mode 100644 index 0000000..b774764 --- /dev/null +++ b/scripts/net_spec_MAJ_BRT030001_BART_to_SanJose.py @@ -0,0 +1,77 @@ +import os + +# MANDATORY. Set this to be the Project Name. +# e.g. "RTP2021", "TIP2021", etc +PROJECT = "PBA50-1" + +# MANDATORY. Set this to be the Scenario Name +# e.g. "Base", "Baseline" +SCENARIO = "build" + +# MANDATORY. Set this to be the git tag for checking out network projects. +TAG = "HEAD" + +# MANDATORY. Set this to the directory in which to write your outputs. +# "hwy" and "trn" subdirectories will be created here. +OUT_DIR = SCENARIO + "_network_{}" # YEAR + +# MANDATORY. Should be a dictionary with keys "hwy", "muni", "rail", "bus" +# to a list of projects. A project can either be a simple string, or it can be +# a dictionary with with keys 'name', 'tag' (optional), and 'kwargs' (optional) +# to specify a special tag or special keyword args for the projects apply() call. +# For example: +# {'name':"Muni_TEP", 'kwargs':{'servicePlan':"'2012oct'"}} +NETWORK_PROJECTS = collections.OrderedDict([ + (2015, + {'hwy':[ + 'PROJ_attributes' # adds PROJ attributes to NODE and LINK + ], + 'trn':[] + }), + (2020, { + 'hwy':[], + 'trn':['ALA050015_BART_to_WarmSprings', 'SCL110005_BART_to_Berryessa'] + }), + (2025, { + 'hwy':[], + 'trn':[] + }), + (2030, { + 'hwy':[], + 'trn':['MAJ_BRT030001_BART_to_SanJose'] + }), + (2035, { + 'hwy':[], + 'trn':['MAJ_BRT030001_BART_to_SanJose'] + }), + (2040, { + 'hwy':[], + 'trn':['MAJ_BRT030001_BART_to_SanJose'] + }), + (2045, { + 'hwy':[], + 'trn':['MAJ_BRT030001_BART_to_SanJose'] + }), + (2050, { + 'hwy':[], + 'trn':['MAJ_BRT030001_BART_to_SanJose'] + }) +]) + +# OPTIONAL. The default route network project directory is Y:\networks. If +# projects are stored in another directory, then use this variable to specify it. +# For example: Y:\networks\projects +# NETWORK_BASE_DIR = None +# NETWORK_PROJECT_SUBDIR = None +# NETWORK_SEED_SUBDIR = None +# NETWORK_PLAN_SUBDIR = None + +# OPTIONAL. A list of project names which have been previously applied in the +# PIVOT_DIR network that projects in this project might rely on. For example +# if DoyleDrive exists, then Muni_TEP gets applied differently so transit lines +# run on the new Doyle Drive alignment +APPLIED_PROJECTS = None + +# OPTIONAL. A list of project names. For test mode, these projects won't use +# the TAG. This is meant for developing a network project. +TEST_PROJECTS = [] From 908f1a4e25dea091807ad4772bc06ef0494ef85b Mon Sep 17 00:00:00 2001 From: Andrew Rohne Date: Thu, 21 Sep 2023 16:52:56 -0400 Subject: [PATCH 03/22] Fixed typo in instructions --- Local Machine Instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Local Machine Instructions.md b/Local Machine Instructions.md index 4a4a835..4612f76 100644 --- a/Local Machine Instructions.md +++ b/Local Machine Instructions.md @@ -8,7 +8,7 @@ Questions can be directed to Andrew Rohne at RSG (andrew.rohne (at) rsginc.com). The computer's path needs to include the path to Cube Voyager to use an executable there. Follow [these instructions](https://www.computerhope.com/issues/ch000549.htm) for your OS version, add C:\Program Files\Citilabs\CubeVoyager to the path. -To test this, open any command prompt () and type `runtpp`. There should be an error that says "Error in Arg 1: (null)". +To test this, open Anaconda Prompt or Anaconda Powershell and type `runtpp`. There should be an error that says "Error in Arg 1: (null)". # Setting Up Network Wrangler 1. Download the [Anaconda environment](https://github.com/RSGInc/travel-model-one/blob/transit_2050/tm15-python310.yml) to a location on your hard drive. From 698ab65fd08b74000ef254d42bb7a071caa9ebbf Mon Sep 17 00:00:00 2001 From: williamwangrsg <109112463+williamwangrsg@users.noreply.github.com> Date: Tue, 26 Sep 2023 17:35:19 -0700 Subject: [PATCH 04/22] Update Local Machine Instructions.md to use 'reportDiff' --- Local Machine Instructions.md | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/Local Machine Instructions.md b/Local Machine Instructions.md index 4612f76..d70ebc4 100644 --- a/Local Machine Instructions.md +++ b/Local Machine Instructions.md @@ -12,40 +12,43 @@ To test this, open Anaconda Prompt or Anaconda Powershell and type `runtpp`. The # Setting Up Network Wrangler 1. Download the [Anaconda environment](https://github.com/RSGInc/travel-model-one/blob/transit_2050/tm15-python310.yml) to a location on your hard drive. -1. Created the local Anaconda environment. Open Anaconda Prompt or Anaconda Powershell (either will work, hereinafter referred to as Anaconda Prompt) and type: +2. Created the local Anaconda environment. Open Anaconda Prompt or Anaconda Powershell (either will work, hereinafter referred to as Anaconda Prompt) and type: `cd path\you\downloaded\the\above\file\to` `conda create -f tm15-python310.yml` -2. Switched to it. Use the following command in the Anaconda prompt +3. Switched to it. Use the following command in the Anaconda prompt `conda activate tm15-python310` -3. Change directories to an appropriate location on your hard drive. -4. Clone the network Wrangler Repo +4. Change directories to an appropriate location on your hard drive. +5. Clone the network Wrangler Repo `git clone https://github.com/RSGInc/NetworkWrangler.git` -5. Go into that folder and checkout the transit_2050 branch +6. Go into that folder and checkout the transit_2050 branch `git checkout transit_2050` -6. Install NetworkWrangler. +7. Install NetworkWrangler. `cd NetworkWrangler` `pip install -e .` -7. Open python, import NetworkWrangler, ensure no errors -8. Get the base network - clone https://github.com/BayAreaMetro/TM1_2015_Base_Network to a local folder (I used C:\Models). This probably should not be done inside the network wrangler folder. -9. Get the projects from Box +8. Open python, import NetworkWrangler, ensure no errors +9. Get the base network - clone https://github.com/BayAreaMetro/TM1_2015_Base_Network to a local folder (I used C:\Models). This probably should not be done inside the network wrangler folder. +10. Get the projects from Box Not-RSG: From https://mtcdrive.box.com/s/unic7tf0sokleacg4fgu0dtu8ixkyfg6 RSG: I Copied to the files folder to Sharepoint as "04_Network_Work\MTC Data\NetworkProjects_20230719.zip I unzipped to C:\Models\TM1_NetworkProjects -10. Also download everything on Box since July 19 +11. Also download everything on Box since July 19 Not-RSG: use box, sort by date, select all necessary RSG: Copied to files folder as "04_Network_Work\MTC Data\TM1_NetworkProjects-selected.zip" -11. Set base network env var. Use these commands in an Anaconda prompt: +12. Set base network env var. Use these commands in an Anaconda prompt: `conda env config vars set "TM1_2015_Base_Network=C:\Models\TM1_2015_Base_Network"` `conda env config vars set "TM1_NetworkProjects=C:\Models\TM1_NetworkProjects"` `conda env config vars set "CUBE_HOST_FILE=C:\Models\NetworkWrangler\HostnamesWithCube.txt"` `conda activate NetworkWrangler` + Note: you can test these using `conda env config vars list` +13. If you wish to use the 'reportDiff' function, you will need to install ArcGIS Pro on your machine and, while having NetworkWrangler activated, use `conda install arcpy=3.1 -c esri` in Anaconda prompt. # Running Network Wrangler for the Base Year 1. Be in the correct Anaconda Environment (if not already) - conda activate tm15-python310 + `conda activate tm15-python310` 2. Build the test network - python .\build_network_mtc.py Test .\net_spec_test.py + `python .\build_network_mtc.py Test .\net_spec_test.py`\ + (If 'reportDiff' is desired, add `--create_project_diffs` to the end of the command above.) # Adding Project Cards @@ -76,4 +79,4 @@ WranglerLogger: INFO trn 2020.trn.01 MAJ_BRT030001_BART_to_SanJose WranglerLogger: INFO trn 2020.trn.01 MAJ_BRT030001_BART_to_SanJose trn SCL110005_BART_to_Berryessa -1 ``` -In this case, it can be fixed by including the prerequisite projects in the appropriate network. \ No newline at end of file +In this case, it can be fixed by including the prerequisite projects in the appropriate network. From 20e45191618183cf367705e5224390c134c48347 Mon Sep 17 00:00:00 2001 From: williamwangrsg Date: Thu, 28 Sep 2023 12:09:59 -0700 Subject: [PATCH 05/22] william updated spec file for FBP_AL_021_South_Bay_Connect, ready for RSG internal review --- .../net_spec_FBP_AL_021_South_Bay_Connect.py | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 scripts/net_spec_FBP_AL_021_South_Bay_Connect.py diff --git a/scripts/net_spec_FBP_AL_021_South_Bay_Connect.py b/scripts/net_spec_FBP_AL_021_South_Bay_Connect.py new file mode 100644 index 0000000..95537c9 --- /dev/null +++ b/scripts/net_spec_FBP_AL_021_South_Bay_Connect.py @@ -0,0 +1,82 @@ +import os + +# MANDATORY. Set this to be the Project Name. +# e.g. "RTP2021", "TIP2021", etc +PROJECT = "PBA50-1" + +# MANDATORY. Set this to be the Scenario Name +# e.g. "Base", "Baseline" +SCENARIO = "FBP_AL_021_South_Bay_Connect" + +# MANDATORY. Set this to be the git tag for checking out network projects. +TAG = "HEAD" + +# MANDATORY. Set this to the directory in which to write your outputs. +# "hwy" and "trn" subdirectories will be created here. +OUT_DIR = SCENARIO + "_network_{}" # YEAR + +# MANDATORY. Should be a dictionary with keys "hwy", "muni", "rail", "bus" +# to a list of projects. A project can either be a simple string, or it can be +# a dictionary with with keys 'name', 'tag' (optional), and 'kwargs' (optional) +# to specify a special tag or special keyword args for the projects apply() call. +# For example: +# {'name':"Muni_TEP", 'kwargs':{'servicePlan':"'2012oct'"}} +NETWORK_PROJECTS = collections.OrderedDict([ + (2015, + {'hwy':[ + 'PROJ_attributes' # adds PROJ attributes to NODE and LINK + ], + 'trn':[] + }), + (2020, { + 'hwy':[ + #{'name':'demo_project', 'kwargs':{'TEST':'BUNNIES'}} + ], + 'trn':[] + }), + (2025, { + 'hwy':[ + ], + 'trn':[ + #{'name':'demo_project', 'kwargs':{'FUTURE':"'BackToTheFuture'"}} + ] + }), + (2030, { + 'hwy':[], + 'trn':[] + }), + (2035, { + 'hwy':[], + 'trn':[] + }), + (2040, { + 'hwy':[], + 'trn':[] + }), + (2045, { + 'hwy':[], + 'trn':[] + }), + (2050, { + 'hwy':["FBP_AL_021_South_Bay_Connect"], + 'trn':["FBP_AL_021_South_Bay_Connect"] + }) +]) + +# OPTIONAL. The default route network project directory is Y:\networks. If +# projects are stored in another directory, then use this variable to specify it. +# For example: Y:\networks\projects +# NETWORK_BASE_DIR = None +# NETWORK_PROJECT_SUBDIR = None +# NETWORK_SEED_SUBDIR = None +# NETWORK_PLAN_SUBDIR = None + +# OPTIONAL. A list of project names which have been previously applied in the +# PIVOT_DIR network that projects in this project might rely on. For example +# if DoyleDrive exists, then Muni_TEP gets applied differently so transit lines +# run on the new Doyle Drive alignment +APPLIED_PROJECTS = None + +# OPTIONAL. A list of project names. For test mode, these projects won't use +# the TAG. This is meant for developing a network project. +TEST_PROJECTS = [] From 11851caeab8f5dee07d02f8e64c19d42db3169bd Mon Sep 17 00:00:00 2001 From: Rohan Sirupa <91225888+rsirupa@users.noreply.github.com> Date: Sun, 1 Oct 2023 20:39:34 -0700 Subject: [PATCH 06/22] Python environment for Network Wrangler Uploading a yaml file for Network Wrangler's python environment --- environment_nw.yml | Bin 0 -> 16782 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 environment_nw.yml diff --git a/environment_nw.yml b/environment_nw.yml new file mode 100644 index 0000000000000000000000000000000000000000..b2738ca7ae6ead7305861e1d4536f60eb1b46277 GIT binary patch literal 16782 zcmbW8*-{%#5{3JEBIX_b7mx!XjQvl9Utwa}6J?Qh7?w{R1x{K~M zeYVmk58YZ+eEOGuW_n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network Wrangler --- Local Machine Instructions.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Local Machine Instructions.md b/Local Machine Instructions.md index d70ebc4..5c1232b 100644 --- a/Local Machine Instructions.md +++ b/Local Machine Instructions.md @@ -11,12 +11,12 @@ The computer's path needs to include the path to Cube Voyager to use an executab To test this, open Anaconda Prompt or Anaconda Powershell and type `runtpp`. There should be an error that says "Error in Arg 1: (null)". # Setting Up Network Wrangler -1. Download the [Anaconda environment](https://github.com/RSGInc/travel-model-one/blob/transit_2050/tm15-python310.yml) to a location on your hard drive. +1. Download the [Anaconda environment](https://github.com/RSGInc/NetworkWrangler/blob/transit_2050/environment_nw.yml) to a location on your hard drive. 2. Created the local Anaconda environment. Open Anaconda Prompt or Anaconda Powershell (either will work, hereinafter referred to as Anaconda Prompt) and type: `cd path\you\downloaded\the\above\file\to` - `conda create -f tm15-python310.yml` + `conda create -f environment_nw.yml` 3. Switched to it. Use the following command in the Anaconda prompt - `conda activate tm15-python310` + `conda activate NetworkWrangler` 4. Change directories to an appropriate location on your hard drive. 5. Clone the network Wrangler Repo `git clone https://github.com/RSGInc/NetworkWrangler.git` @@ -42,10 +42,10 @@ To test this, open Anaconda Prompt or Anaconda Powershell and type `runtpp`. The Note: you can test these using `conda env config vars list` -13. If you wish to use the 'reportDiff' function, you will need to install ArcGIS Pro on your machine and, while having NetworkWrangler activated, use `conda install arcpy=3.1 -c esri` in Anaconda prompt. +13. If you wish to use the 'reportDiff' function, you will need to install and activate ArcGIS Pro on your machine. The NetworkWrangler environment already has `arcpy` environment installed with it. # Running Network Wrangler for the Base Year 1. Be in the correct Anaconda Environment (if not already) - `conda activate tm15-python310` + `conda activate NetworkWrangler` 2. Build the test network `python .\build_network_mtc.py Test .\net_spec_test.py`\ (If 'reportDiff' is desired, add `--create_project_diffs` to the end of the command above.) From 39a1e9c9ab353e5149a59a458893fb5d4ba27bdf Mon Sep 17 00:00:00 2001 From: williamwangrsg <109112463+williamwangrsg@users.noreply.github.com> Date: Tue, 3 Oct 2023 16:37:31 -0700 Subject: [PATCH 08/22] added instructions to use build_network_mtc_add_project.py for PPA --- Local Machine Instructions.md | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/Local Machine Instructions.md b/Local Machine Instructions.md index 5c1232b..4f19f48 100644 --- a/Local Machine Instructions.md +++ b/Local Machine Instructions.md @@ -4,6 +4,10 @@ This code has been updated to run on a laptop that has Cube Voyager 6.5.0 instal Questions can be directed to Andrew Rohne at RSG (andrew.rohne (at) rsginc.com). 9/20/2023. +--- +Note: This is still being written! +--- + # Setting Up Cube The computer's path needs to include the path to Cube Voyager to use an executable there. Follow [these instructions](https://www.computerhope.com/issues/ch000549.htm) for your OS version, add C:\Program Files\Citilabs\CubeVoyager to the path. @@ -11,6 +15,9 @@ The computer's path needs to include the path to Cube Voyager to use an executab To test this, open Anaconda Prompt or Anaconda Powershell and type `runtpp`. There should be an error that says "Error in Arg 1: (null)". # Setting Up Network Wrangler + +This largely follows [the Network Wrangler Documentation](https://github.com/BayAreaMetro/modeling-website/wiki/Network-Building-with-NetworkWrangler#step-4-build-a-network-with-your-project) but is distilled down to something a little more concise. + 1. Download the [Anaconda environment](https://github.com/RSGInc/NetworkWrangler/blob/transit_2050/environment_nw.yml) to a location on your hard drive. 2. Created the local Anaconda environment. Open Anaconda Prompt or Anaconda Powershell (either will work, hereinafter referred to as Anaconda Prompt) and type: `cd path\you\downloaded\the\above\file\to` @@ -50,21 +57,29 @@ To test this, open Anaconda Prompt or Anaconda Powershell and type `runtpp`. The `python .\build_network_mtc.py Test .\net_spec_test.py`\ (If 'reportDiff' is desired, add `--create_project_diffs` to the end of the command above.) -# Adding Project Cards - ---- -Note: This is still being written! ---- - -This largely follows [the Network Wrangler Documentation](https://github.com/BayAreaMetro/modeling-website/wiki/Network-Building-with-NetworkWrangler#step-4-build-a-network-with-your-project) but is distilled down to something a little more concise. +# Test Project Coding The basic version is to add the cards to the TM1_NetworkProjects folder, and then copy the net_spec_test.py script to something a little more descriptive (for the BART San Jose example, I used `net_spec_MAJ_BRT030001_BART_to_SanJose.py`). The script needs to have a project code, scenario (for the purposes of this project, I use `build`) Run with `python build_network_mtc.py build net_spec_MAJ_BRT030001_BART_to_SanJose.py` -## Determine Pre-requisite Projects +# Adding a Project Card for PPA + +Use [build_network_mtc_add_project.py](https://github.com/BayAreaMetro/NetworkWrangler/blob/master/scripts/build_network_mtc_add_project.py) for PPA since only a small number of projects are added (mostly just 1). The base network should be the latest 2050 network in [Sample of L drive Projects Folder](https://mtcdrive.box.com/s/vbpsrs7tpvj1qfxmasink52wls8pexrj), one for each future. The script will automatically use `XXX_17` (latest). In [build_network_mtc_add_project.py](https://github.com/BayAreaMetro/NetworkWrangler/blob/master/scripts/build_network_mtc_add_project.py), point `PPA_DIR` to [Sample of L drive Projects Folder](https://mtcdrive.box.com/s/vbpsrs7tpvj1qfxmasink52wls8pexrj) and `NODE_NAMES` to `TM1_2015_Base_Network\Node Description.xls`. +Required arguments to use the script: +1. Future scenario: one of these three - `CleanAndGreen`, `RisingTides`, and `BackToTheFuture`. `CleanAndGreen` is taken as an example to demonstrate. +2. Input network: `..\Sample of L drive Projects Folder\2050_TM151_PPA_CG_17\INPUT`. +3. Project to be added: one of the projects in `TM1_NetworkProjects`. Take `MAJ_BRT030001_BART_to_SanJose` as an example. +4. Nature of project: `--hwy`, `--trn`, or both. +5. Output: create a separate folder - `..\MTC_Outputs\MAJ_BRT030001_BART_to_SanJose_CG`. +6. `project_short_id`: in this case it's `MAJ_BRT030001_BART_to_SanJose_CG`. + +Full example: `python build_network_mtc_add_project.py --trn --input_network "..\Box\Performance and Equity\Project Performance\Sample of L drive Projects Folder\2050_TM151_PPA_CG_17\INPUT" --output_network "..\MTC_Outputs\MAJ_BRT030001_BART_to_SanJose_CG" --create_project_diffs CleanAndGreen MAJ_BRT030001_BART_to_SanJose_CG MAJ_BRT030001_BART_to_SanJose` + + +## Determine Pre-requisite Projects # Notes and Errors From 0075e0539c2028128bc26d44e8988913d65536d9 Mon Sep 17 00:00:00 2001 From: williamwangrsg <109112463+williamwangrsg@users.noreply.github.com> Date: Wed, 18 Oct 2023 21:43:55 -0700 Subject: [PATCH 09/22] add a reminder as RSG switches to coding/reviewing project cards straight from Box --- Local Machine Instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Local Machine Instructions.md b/Local Machine Instructions.md index 4f19f48..01f8c4f 100644 --- a/Local Machine Instructions.md +++ b/Local Machine Instructions.md @@ -48,7 +48,7 @@ This largely follows [the Network Wrangler Documentation](https://github.com/Bay `conda activate NetworkWrangler` Note: you can test these using `conda env config vars list` - + Note2: Don't forget to reset if you start editing project cards straight from Box. 13. If you wish to use the 'reportDiff' function, you will need to install and activate ArcGIS Pro on your machine. The NetworkWrangler environment already has `arcpy` environment installed with it. # Running Network Wrangler for the Base Year 1. Be in the correct Anaconda Environment (if not already) From 546af7f1104c470669c940f4bb3dda8cc8b9505e Mon Sep 17 00:00:00 2001 From: williamwangrsg <109112463+williamwangrsg@users.noreply.github.com> Date: Wed, 31 Jan 2024 14:28:13 -0500 Subject: [PATCH 10/22] add z drive installation instructions --- Xdrive Script (1).txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Xdrive Script (1).txt diff --git a/Xdrive Script (1).txt b/Xdrive Script (1).txt new file mode 100644 index 0000000..d4f6dca --- /dev/null +++ b/Xdrive Script (1).txt @@ -0,0 +1,14 @@ +Please copy the entire script below and paste into PowerShell. +Do not run Powershell as Administrator. +The Zdrive should persist with restarts of the computer. + + +$connectTestResult = Test-NetConnection -ComputerName mtcproject.file.core.windows.net -Port 445 +if ($connectTestResult.TcpTestSucceeded) { + # Save the password so the drive will persist on reboot + cmd.exe /C "cmdkey /add:`"mtcproject.file.core.windows.net`" /user:`"localhost\mtcproject`" /pass:`"uaBceR+X4ssB5Uu3z25AzKCWvIWBn69JZ92OjMm7MWSVc2hG0MaXkKhYO0kdApUuxz/BBPcxNWR3+AStaJEEGg==`"" + # Mount the drive + New-PSDrive -Name X -PSProvider FileSystem -Root "\\mtcproject.file.core.windows.net\zdrive" -Persist +} else { + Write-Error -Message "Unable to reach the Azure storage account via port 445. Check to make sure your organization or ISP is not blocking port 445, or use Azure P2S VPN, Azure S2S VPN, or Express Route to tunnel SMB traffic over a different port." +} \ No newline at end of file From a31cfb7700db71282ce2b0850b0f6ed14e862afa Mon Sep 17 00:00:00 2001 From: Andrew Rohne Date: Wed, 20 Sep 2023 17:25:25 -0400 Subject: [PATCH 11/22] Updates to run locally. More information is in Local Machine Instructions.md. --- HostnamesWithCube.txt | 1 + Local Machine Instructions.md | 39 +++++++++++++++++++++++++++++++++++ Wrangler/HighwayNetwork.py | 6 ++++-- _static/Cube/CubeNet.py | 11 +++++----- 4 files changed, 49 insertions(+), 8 deletions(-) create mode 100644 HostnamesWithCube.txt create mode 100644 Local Machine Instructions.md diff --git a/HostnamesWithCube.txt b/HostnamesWithCube.txt new file mode 100644 index 0000000..d18580b --- /dev/null +++ b/HostnamesWithCube.txt @@ -0,0 +1 @@ +localhost \ No newline at end of file diff --git a/Local Machine Instructions.md b/Local Machine Instructions.md new file mode 100644 index 0000000..4677f6a --- /dev/null +++ b/Local Machine Instructions.md @@ -0,0 +1,39 @@ +# Intro + +This code has been updated to run on a laptop that has Cube Voyager 6.5.0 installed locally. This is primarily the removal and override of anything that appears to be MTC specific (e.g. paths to cube hostnames and a batch file used when calling runtpp). + +Questions can be directed to Andrew Rohne at RSG (andrew.rohne (at) rsginc.com). 9/20/2023. + +# Setting Up Network Wrangler + +1. Created an Anaconda environment + conda create --name NetworkWrangler python=3.9 +2. Switched to it + conda activate NetworkWrangler +3. Installed packages + conda install pandas pywin32 + conda install xlrd + pip install SimpleParse + pip install partridge +4. Open python, import NetworkWrangler, ensure no errors +5. Get the base network - clone https://github.com/BayAreaMetro/TM1_2015_Base_Network to a local folder (I used C:\Models) +6. Get the projects from Box + From https://mtcdrive.box.com/s/unic7tf0sokleacg4fgu0dtu8ixkyfg6 + Copied to the files folder as "04_Network_Work\MTC Data\NetworkProjects_20230719.zip + I unzipped to C:\Models\TM1_NetworkProjects +7. Also download everything on Box since July 19 + Copied to files folder as "04_Network_Work\MTC Data\TM1_NetworkProjects-selected.zip" +8. Create a Cube hostname file called "HostnamesWithCube.txt". For local installations, that file should have the word "localhost" (no quotes) in it. +9. Set base network env var + conda env config vars set "TM1_2015_Base_Network=C:\Models\TM1_2015_Base_Network" + conda env config vars set "TM1_NetworkProjects=C:\Models\TM1_NetworkProjects" + conda env config vars set "CUBE_HOST_FILE=C:\Models\NetworkWrangler\HostnamesWithCube.txt" + conda activate NetworkWrangler + +# Running Network Wrangler for the Base Year + +1. Be in the correct Anaconda Environment (if not already) + conda activate NetworkWrangler +2. Build the test network + python .\build_network_mtc.py Test .\net_spec_test.py + diff --git a/Wrangler/HighwayNetwork.py b/Wrangler/HighwayNetwork.py index 5b890c5..d7b0d22 100644 --- a/Wrangler/HighwayNetwork.py +++ b/Wrangler/HighwayNetwork.py @@ -1,4 +1,5 @@ import collections, csv, os, re, shutil, subprocess, time +import copy from socket import gethostname, getfqdn from .HwySpecsRTP import HwySpecsRTP @@ -31,7 +32,8 @@ def getCubeHostnames(): # read them HighwayNetwork.cube_hostnames = [] - f = open(r"Y:\COMMPATH\HostnamesWithCube.txt") + env = copy.copy(os.environ) + f = open(env['CUBE_HOST_FILE']) for line in f: if line[0] == "#": continue HighwayNetwork.cube_hostnames.append(line.split()[0]) # use the first token of non-comment lines @@ -146,7 +148,7 @@ def applyProject(self, parentdir, networkdir, gitdir, projectsubdir=None, **kwar # dispatch it, cube license hostname = gethostname().lower() - if hostname not in HighwayNetwork.getCubeHostnames(): + if False: #hostname not in HighwayNetwork.getCubeHostnames(): print("Dispatching cube script to taraval from %s".format(hostname)) f = open(os.path.join(applyDir,'runtpp_dispatch.tmp'), 'w') f.write("runtpp " + applyScript + "\n") diff --git a/_static/Cube/CubeNet.py b/_static/Cube/CubeNet.py index c77a136..776ce70 100644 --- a/_static/Cube/CubeNet.py +++ b/_static/Cube/CubeNet.py @@ -22,8 +22,8 @@ def getCubeHostnames(): # at mtc, assume cube license is available if fqdn.endswith("mtc.ca.gov"): return [ gethostname().lower() ] - - f = open(r"Y:\COMMPATH\HostnamesWithCube.txt") + env = copy.copy(os.environ) + f = open(env['CUBE_HOST_FILE']) for line in f: if line[0] == "#": continue hostnames.append(line.split()[0]) # use the first token of non-comment lines @@ -88,10 +88,9 @@ def export_cubenet_to_csvs(file, extra_link_vars=[], extra_node_vars=[], sys.exit(2) env["MACHINES"] = CUBE_COMPUTER - - cmd = r'y:\champ\util\bin\dispatch-one.bat "runtpp ' + script + '"' - print(cmd) - proc = subprocess.Popen( cmd, cwd = filedir, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env) + + cmd = f'runtpp "{script}"' + proc = subprocess.Popen( cmd, cwd = filedir, stdout=subprocess.PIPE, stderr=subprocess.PIPE )#, env=env) for line in proc.stdout: if type(line)==bytes: line = line.decode() # convert to string, not byetes line = line.strip('\r\n') From fb0003c61792e814d8b3b754d6a80306b82cdc96 Mon Sep 17 00:00:00 2001 From: Andrew Rohne Date: Thu, 21 Sep 2023 16:50:28 -0400 Subject: [PATCH 12/22] Additional updates to instructions and python scripts to ensure compatibility with Python 3. --- Local Machine Instructions.md | 92 +++++++++++++------ scripts/build_network.py | 48 +++++----- scripts/build_network_mtc_futures.py | 4 +- .../net_spec_MAJ_BRT030001_BART_to_SanJose.py | 77 ++++++++++++++++ 4 files changed, 169 insertions(+), 52 deletions(-) create mode 100644 scripts/net_spec_MAJ_BRT030001_BART_to_SanJose.py diff --git a/Local Machine Instructions.md b/Local Machine Instructions.md index 4677f6a..4a4a835 100644 --- a/Local Machine Instructions.md +++ b/Local Machine Instructions.md @@ -4,36 +4,76 @@ This code has been updated to run on a laptop that has Cube Voyager 6.5.0 instal Questions can be directed to Andrew Rohne at RSG (andrew.rohne (at) rsginc.com). 9/20/2023. -# Setting Up Network Wrangler +# Setting Up Cube + +The computer's path needs to include the path to Cube Voyager to use an executable there. Follow [these instructions](https://www.computerhope.com/issues/ch000549.htm) for your OS version, add C:\Program Files\Citilabs\CubeVoyager to the path. + +To test this, open any command prompt () and type `runtpp`. There should be an error that says "Error in Arg 1: (null)". -1. Created an Anaconda environment - conda create --name NetworkWrangler python=3.9 -2. Switched to it - conda activate NetworkWrangler -3. Installed packages - conda install pandas pywin32 - conda install xlrd - pip install SimpleParse - pip install partridge -4. Open python, import NetworkWrangler, ensure no errors -5. Get the base network - clone https://github.com/BayAreaMetro/TM1_2015_Base_Network to a local folder (I used C:\Models) -6. Get the projects from Box - From https://mtcdrive.box.com/s/unic7tf0sokleacg4fgu0dtu8ixkyfg6 - Copied to the files folder as "04_Network_Work\MTC Data\NetworkProjects_20230719.zip +# Setting Up Network Wrangler +1. Download the [Anaconda environment](https://github.com/RSGInc/travel-model-one/blob/transit_2050/tm15-python310.yml) to a location on your hard drive. +1. Created the local Anaconda environment. Open Anaconda Prompt or Anaconda Powershell (either will work, hereinafter referred to as Anaconda Prompt) and type: + `cd path\you\downloaded\the\above\file\to` + `conda create -f tm15-python310.yml` +2. Switched to it. Use the following command in the Anaconda prompt + `conda activate tm15-python310` +3. Change directories to an appropriate location on your hard drive. +4. Clone the network Wrangler Repo + `git clone https://github.com/RSGInc/NetworkWrangler.git` +5. Go into that folder and checkout the transit_2050 branch + `git checkout transit_2050` +6. Install NetworkWrangler. + `cd NetworkWrangler` + `pip install -e .` +7. Open python, import NetworkWrangler, ensure no errors +8. Get the base network - clone https://github.com/BayAreaMetro/TM1_2015_Base_Network to a local folder (I used C:\Models). This probably should not be done inside the network wrangler folder. +9. Get the projects from Box + Not-RSG: From https://mtcdrive.box.com/s/unic7tf0sokleacg4fgu0dtu8ixkyfg6 + RSG: I Copied to the files folder to Sharepoint as "04_Network_Work\MTC Data\NetworkProjects_20230719.zip I unzipped to C:\Models\TM1_NetworkProjects -7. Also download everything on Box since July 19 - Copied to files folder as "04_Network_Work\MTC Data\TM1_NetworkProjects-selected.zip" -8. Create a Cube hostname file called "HostnamesWithCube.txt". For local installations, that file should have the word "localhost" (no quotes) in it. -9. Set base network env var - conda env config vars set "TM1_2015_Base_Network=C:\Models\TM1_2015_Base_Network" - conda env config vars set "TM1_NetworkProjects=C:\Models\TM1_NetworkProjects" - conda env config vars set "CUBE_HOST_FILE=C:\Models\NetworkWrangler\HostnamesWithCube.txt" - conda activate NetworkWrangler - -# Running Network Wrangler for the Base Year +10. Also download everything on Box since July 19 + Not-RSG: use box, sort by date, select all necessary + RSG: Copied to files folder as "04_Network_Work\MTC Data\TM1_NetworkProjects-selected.zip" +11. Set base network env var. Use these commands in an Anaconda prompt: + `conda env config vars set "TM1_2015_Base_Network=C:\Models\TM1_2015_Base_Network"` + `conda env config vars set "TM1_NetworkProjects=C:\Models\TM1_NetworkProjects"` + `conda env config vars set "CUBE_HOST_FILE=C:\Models\NetworkWrangler\HostnamesWithCube.txt"` + `conda activate NetworkWrangler` + Note: you can test these using `conda env config vars list` +# Running Network Wrangler for the Base Year 1. Be in the correct Anaconda Environment (if not already) - conda activate NetworkWrangler + conda activate tm15-python310 2. Build the test network python .\build_network_mtc.py Test .\net_spec_test.py +# Adding Project Cards + +--- +Note: This is still being written! +--- + +This largely follows [the Network Wrangler Documentation](https://github.com/BayAreaMetro/modeling-website/wiki/Network-Building-with-NetworkWrangler#step-4-build-a-network-with-your-project) but is distilled down to something a little more concise. + +The basic version is to add the cards to the TM1_NetworkProjects folder, and then copy the net_spec_test.py script to something a little more descriptive (for the BART San Jose example, I used `net_spec_MAJ_BRT030001_BART_to_SanJose.py`). The script needs to have a project code, scenario (for the purposes of this project, I use `build`) + +Run with `python build_network_mtc.py build net_spec_MAJ_BRT030001_BART_to_SanJose.py` + +## Determine Pre-requisite Projects + + + +# Notes and Errors + +## Pre-requisite Projects + +If you see this: `WranglerLogger: DEBUG !!!WARNING!!! Some PRE-REQUISITES were not found or ordered correctly. Continue anyway? (y/n)`, that means you're missing one or more projects and these projects are required for the project you're using to work. Listed above this, you'll see the pre-requisite projects: + +``` +WranglerLogger: INFO Requirement verification - Pre-requisite +WranglerLogger: INFO Year Project Pre-requisite Project Year +WranglerLogger: INFO trn 2020.trn.01 MAJ_BRT030001_BART_to_SanJose trn ALA050015_BART_to_WarmSprings -1 +WranglerLogger: INFO trn 2020.trn.01 MAJ_BRT030001_BART_to_SanJose trn SCL110005_BART_to_Berryessa -1 +``` + +In this case, it can be fixed by including the prerequisite projects in the appropriate network. \ No newline at end of file diff --git a/scripts/build_network.py b/scripts/build_network.py index cd5505d..759fcdf 100644 --- a/scripts/build_network.py +++ b/scripts/build_network.py @@ -217,21 +217,21 @@ def writeRequirementsToScreen(REQUIREMENTS, req_type='prereq'): else: return None - print "Match type 2: Perfect match " - print "Match type 1: Possible match " - print "Match type 0: No match " - print "------------------------------ " + print("Match type 2: Perfect match ") + print("Match type 1: Possible match ") + print("Match type 0: No match ") + print("------------------------------ ") for net in REQUIREMENTS.keys(): proj_name_max_width = 22 - print "--------------------------------------------------------------------------------------------" - print "%s" % net.upper() - print "--------------------------------------------------------------------------------------------" - print " REQ NET MATCH POSSIBLE NET " - print "PROJECT TYPE TYPE %-23sLEVEL %-23sTYPE" % (print_req.upper(), print_req.upper()+' MATCH') - print "---------------------- ------ ----- ---------------------- ----- ---------------------- ----" + print("--------------------------------------------------------------------------------------------") + print("%s" % net.upper()) + print("--------------------------------------------------------------------------------------------") + print(" REQ NET MATCH POSSIBLE NET ") + print("PROJECT TYPE TYPE %-23sLEVEL %-23sTYPE" % (print_req.upper(), print_req.upper()+' MATCH')) + print("---------------------- ------ ----- ---------------------- ----- ---------------------- ----") if REQUIREMENTS[net].keys() == []: - print "NO %sS FOUND FOR %s NETWORK TYPE" % (print_req.upper(), net.upper()) + print("NO %sS FOUND FOR %s NETWORK TYPE" % (print_req.upper(), net.upper())) for proj in REQUIREMENTS[net].keys(): for req in REQUIREMENTS[net][proj].keys(): @@ -269,8 +269,8 @@ def writeRequirementsToScreen(REQUIREMENTS, req_type='prereq'): else: line_to_print = line_to_print + '\n' + line_part_one + "%-6s%-23s%-4s\n" %("NA","MISSING","NA") i += 1 - print line_to_print - print '\n' + print(line_to_print) + print('\n') def getProjectAttributes(project): # Start with TAG if not build mode, no kwargs @@ -303,7 +303,7 @@ def getProjectAttributes(project): os.environ['CHAMP_NODE_NAMES'] = CHAMP_NODE_NAMES if len(args) < 1: - print USAGE + print(USAGE) sys.exit(2) NETWORK_CONFIG = args[0] @@ -322,7 +322,7 @@ def getProjectAttributes(project): if o=="-c": CONFIG_WORD = a if BUILD_MODE not in [None,"test"]: - print USAGE + print(USAGE) sys.exit(2) if BUILD_MODE=="test": @@ -334,25 +334,25 @@ def getProjectAttributes(project): # Verify mandatory fields are set if PROJECT==None: - print "PROJECT not set in %s" % NETWORK_CONFIG + print(f"PROJECT not set in {NETWORK_CONFIG}") sys.exit(2) if YEAR==None: - print "YEAR not set in %s" % NETWORK_CONFIG + print(f"YEAR not set in {NETWORK_CONFIG}") sys.exit(2) if SCENARIO==None: - print "SCENARIO not set in %s" % NETWORK_CONFIG + print(f"SCENARIO not set in {NETWORK_CONFIG}") sys.exit(2) if TAG==None: - print "TAG not set in %s" % NETWORK_CONFIG + print(f"TAG not set in {NETWORK_CONFIG}") sys.exit(2) if OUT_DIR==None: - print "OUT_DIR not set in %s" % NETWORK_CONFIG + print(f"OUT_DIR not set in {NETWORK_CONFIG}") sys.exit(2) if TRANSIT_CAPACITY_DIR==None: - print "TRANSIT_CAPACITY_DIR not set in %s" % NETWORK_CONFIG + print(f"TRANSIT_CAPACITY_DIR not set in {NETWORK_CONFIG}") sys.exit(2) if NETWORK_PROJECTS==None: - print "NETWORK_PROJECTS not set in %s" % NETWORK_CONFIG + print(f"NETWORK_PROJECTS not set in {NETWORK_CONFIG}") sys.exit(2) # Set up logging @@ -464,7 +464,7 @@ def getProjectAttributes(project): (prereqs, coreqs, conflicts) = networks[netmode].getReqs(networkdir=project_name, projectsubdir=tail, tag=tag, projtype=projType, tempdir=TEMP_SUBDIR) - print "Checking projType... %s" % projType + print(f"Checking projType... {projType}") if projType=='plan': #Open specs file and get list of projects specFile = os.path.join(TEMP_SUBDIR,NETWORK_PLAN_SUBDIR,'planSpecs.csv') @@ -675,4 +675,4 @@ def getProjectAttributes(project): Wrangler.WranglerLogger.debug("Wrote transit report to %s" % transit_report_filename) Wrangler.WranglerLogger.debug("Successfully completed running %s" % os.path.abspath(__file__)) - print "Remember to copy MissionLocalDelay.csv from the Muni_2011Oct dir!" + print("Remember to copy MissionLocalDelay.csv from the Muni_2011Oct dir!") diff --git a/scripts/build_network_mtc_futures.py b/scripts/build_network_mtc_futures.py index c50070e..3e7fcd9 100644 --- a/scripts/build_network_mtc_futures.py +++ b/scripts/build_network_mtc_futures.py @@ -201,9 +201,9 @@ continue # Initialize output subdirectories up a level (not in scratch) - hwypath=os.path.join("..", SCENARIO, OUT_DIR.format(YEAR),HWY_SUBDIR) + hwypath=os.path.join("..", SCENARIO, OUT_DIR.format(YEAR),build_network_mtc.HWY_SUBDIR) if not os.path.exists(hwypath): os.makedirs(hwypath) - trnpath = os.path.join("..", SCENARIO, OUT_DIR.format(YEAR),TRN_SUBDIR) + trnpath = os.path.join("..", SCENARIO, OUT_DIR.format(YEAR),build_network_mtc.TRN_SUBDIR) if not os.path.exists(trnpath): os.makedirs(trnpath) networks['hwy'].write(path=hwypath,name=HWY_NET_NAME,suppressQuery=True, diff --git a/scripts/net_spec_MAJ_BRT030001_BART_to_SanJose.py b/scripts/net_spec_MAJ_BRT030001_BART_to_SanJose.py new file mode 100644 index 0000000..b774764 --- /dev/null +++ b/scripts/net_spec_MAJ_BRT030001_BART_to_SanJose.py @@ -0,0 +1,77 @@ +import os + +# MANDATORY. Set this to be the Project Name. +# e.g. "RTP2021", "TIP2021", etc +PROJECT = "PBA50-1" + +# MANDATORY. Set this to be the Scenario Name +# e.g. "Base", "Baseline" +SCENARIO = "build" + +# MANDATORY. Set this to be the git tag for checking out network projects. +TAG = "HEAD" + +# MANDATORY. Set this to the directory in which to write your outputs. +# "hwy" and "trn" subdirectories will be created here. +OUT_DIR = SCENARIO + "_network_{}" # YEAR + +# MANDATORY. Should be a dictionary with keys "hwy", "muni", "rail", "bus" +# to a list of projects. A project can either be a simple string, or it can be +# a dictionary with with keys 'name', 'tag' (optional), and 'kwargs' (optional) +# to specify a special tag or special keyword args for the projects apply() call. +# For example: +# {'name':"Muni_TEP", 'kwargs':{'servicePlan':"'2012oct'"}} +NETWORK_PROJECTS = collections.OrderedDict([ + (2015, + {'hwy':[ + 'PROJ_attributes' # adds PROJ attributes to NODE and LINK + ], + 'trn':[] + }), + (2020, { + 'hwy':[], + 'trn':['ALA050015_BART_to_WarmSprings', 'SCL110005_BART_to_Berryessa'] + }), + (2025, { + 'hwy':[], + 'trn':[] + }), + (2030, { + 'hwy':[], + 'trn':['MAJ_BRT030001_BART_to_SanJose'] + }), + (2035, { + 'hwy':[], + 'trn':['MAJ_BRT030001_BART_to_SanJose'] + }), + (2040, { + 'hwy':[], + 'trn':['MAJ_BRT030001_BART_to_SanJose'] + }), + (2045, { + 'hwy':[], + 'trn':['MAJ_BRT030001_BART_to_SanJose'] + }), + (2050, { + 'hwy':[], + 'trn':['MAJ_BRT030001_BART_to_SanJose'] + }) +]) + +# OPTIONAL. The default route network project directory is Y:\networks. If +# projects are stored in another directory, then use this variable to specify it. +# For example: Y:\networks\projects +# NETWORK_BASE_DIR = None +# NETWORK_PROJECT_SUBDIR = None +# NETWORK_SEED_SUBDIR = None +# NETWORK_PLAN_SUBDIR = None + +# OPTIONAL. A list of project names which have been previously applied in the +# PIVOT_DIR network that projects in this project might rely on. For example +# if DoyleDrive exists, then Muni_TEP gets applied differently so transit lines +# run on the new Doyle Drive alignment +APPLIED_PROJECTS = None + +# OPTIONAL. A list of project names. For test mode, these projects won't use +# the TAG. This is meant for developing a network project. +TEST_PROJECTS = [] From 86eb7084cf733862770fef77eccab57c4972f4cd Mon Sep 17 00:00:00 2001 From: Andrew Rohne Date: Thu, 21 Sep 2023 16:52:56 -0400 Subject: [PATCH 13/22] Fixed typo in instructions --- Local Machine Instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Local Machine Instructions.md b/Local Machine Instructions.md index 4a4a835..4612f76 100644 --- a/Local Machine Instructions.md +++ b/Local Machine Instructions.md @@ -8,7 +8,7 @@ Questions can be directed to Andrew Rohne at RSG (andrew.rohne (at) rsginc.com). The computer's path needs to include the path to Cube Voyager to use an executable there. Follow [these instructions](https://www.computerhope.com/issues/ch000549.htm) for your OS version, add C:\Program Files\Citilabs\CubeVoyager to the path. -To test this, open any command prompt () and type `runtpp`. There should be an error that says "Error in Arg 1: (null)". +To test this, open Anaconda Prompt or Anaconda Powershell and type `runtpp`. There should be an error that says "Error in Arg 1: (null)". # Setting Up Network Wrangler 1. Download the [Anaconda environment](https://github.com/RSGInc/travel-model-one/blob/transit_2050/tm15-python310.yml) to a location on your hard drive. From f840b5878e50cd649f06466b48f504257cba0b64 Mon Sep 17 00:00:00 2001 From: williamwangrsg Date: Thu, 28 Sep 2023 12:09:59 -0700 Subject: [PATCH 14/22] william updated spec file for FBP_AL_021_South_Bay_Connect, ready for RSG internal review --- .../net_spec_FBP_AL_021_South_Bay_Connect.py | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 scripts/net_spec_FBP_AL_021_South_Bay_Connect.py diff --git a/scripts/net_spec_FBP_AL_021_South_Bay_Connect.py b/scripts/net_spec_FBP_AL_021_South_Bay_Connect.py new file mode 100644 index 0000000..95537c9 --- /dev/null +++ b/scripts/net_spec_FBP_AL_021_South_Bay_Connect.py @@ -0,0 +1,82 @@ +import os + +# MANDATORY. Set this to be the Project Name. +# e.g. "RTP2021", "TIP2021", etc +PROJECT = "PBA50-1" + +# MANDATORY. Set this to be the Scenario Name +# e.g. "Base", "Baseline" +SCENARIO = "FBP_AL_021_South_Bay_Connect" + +# MANDATORY. Set this to be the git tag for checking out network projects. +TAG = "HEAD" + +# MANDATORY. Set this to the directory in which to write your outputs. +# "hwy" and "trn" subdirectories will be created here. +OUT_DIR = SCENARIO + "_network_{}" # YEAR + +# MANDATORY. Should be a dictionary with keys "hwy", "muni", "rail", "bus" +# to a list of projects. A project can either be a simple string, or it can be +# a dictionary with with keys 'name', 'tag' (optional), and 'kwargs' (optional) +# to specify a special tag or special keyword args for the projects apply() call. +# For example: +# {'name':"Muni_TEP", 'kwargs':{'servicePlan':"'2012oct'"}} +NETWORK_PROJECTS = collections.OrderedDict([ + (2015, + {'hwy':[ + 'PROJ_attributes' # adds PROJ attributes to NODE and LINK + ], + 'trn':[] + }), + (2020, { + 'hwy':[ + #{'name':'demo_project', 'kwargs':{'TEST':'BUNNIES'}} + ], + 'trn':[] + }), + (2025, { + 'hwy':[ + ], + 'trn':[ + #{'name':'demo_project', 'kwargs':{'FUTURE':"'BackToTheFuture'"}} + ] + }), + (2030, { + 'hwy':[], + 'trn':[] + }), + (2035, { + 'hwy':[], + 'trn':[] + }), + (2040, { + 'hwy':[], + 'trn':[] + }), + (2045, { + 'hwy':[], + 'trn':[] + }), + (2050, { + 'hwy':["FBP_AL_021_South_Bay_Connect"], + 'trn':["FBP_AL_021_South_Bay_Connect"] + }) +]) + +# OPTIONAL. The default route network project directory is Y:\networks. If +# projects are stored in another directory, then use this variable to specify it. +# For example: Y:\networks\projects +# NETWORK_BASE_DIR = None +# NETWORK_PROJECT_SUBDIR = None +# NETWORK_SEED_SUBDIR = None +# NETWORK_PLAN_SUBDIR = None + +# OPTIONAL. A list of project names which have been previously applied in the +# PIVOT_DIR network that projects in this project might rely on. For example +# if DoyleDrive exists, then Muni_TEP gets applied differently so transit lines +# run on the new Doyle Drive alignment +APPLIED_PROJECTS = None + +# OPTIONAL. A list of project names. For test mode, these projects won't use +# the TAG. This is meant for developing a network project. +TEST_PROJECTS = [] From 576142b0825f32cd8eb5561edd67b10709cca98c Mon Sep 17 00:00:00 2001 From: williamwangrsg <109112463+williamwangrsg@users.noreply.github.com> Date: Tue, 26 Sep 2023 17:35:19 -0700 Subject: [PATCH 15/22] Update Local Machine Instructions.md to use 'reportDiff' --- Local Machine Instructions.md | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/Local Machine Instructions.md b/Local Machine Instructions.md index 4612f76..d70ebc4 100644 --- a/Local Machine Instructions.md +++ b/Local Machine Instructions.md @@ -12,40 +12,43 @@ To test this, open Anaconda Prompt or Anaconda Powershell and type `runtpp`. The # Setting Up Network Wrangler 1. Download the [Anaconda environment](https://github.com/RSGInc/travel-model-one/blob/transit_2050/tm15-python310.yml) to a location on your hard drive. -1. Created the local Anaconda environment. Open Anaconda Prompt or Anaconda Powershell (either will work, hereinafter referred to as Anaconda Prompt) and type: +2. Created the local Anaconda environment. Open Anaconda Prompt or Anaconda Powershell (either will work, hereinafter referred to as Anaconda Prompt) and type: `cd path\you\downloaded\the\above\file\to` `conda create -f tm15-python310.yml` -2. Switched to it. Use the following command in the Anaconda prompt +3. Switched to it. Use the following command in the Anaconda prompt `conda activate tm15-python310` -3. Change directories to an appropriate location on your hard drive. -4. Clone the network Wrangler Repo +4. Change directories to an appropriate location on your hard drive. +5. Clone the network Wrangler Repo `git clone https://github.com/RSGInc/NetworkWrangler.git` -5. Go into that folder and checkout the transit_2050 branch +6. Go into that folder and checkout the transit_2050 branch `git checkout transit_2050` -6. Install NetworkWrangler. +7. Install NetworkWrangler. `cd NetworkWrangler` `pip install -e .` -7. Open python, import NetworkWrangler, ensure no errors -8. Get the base network - clone https://github.com/BayAreaMetro/TM1_2015_Base_Network to a local folder (I used C:\Models). This probably should not be done inside the network wrangler folder. -9. Get the projects from Box +8. Open python, import NetworkWrangler, ensure no errors +9. Get the base network - clone https://github.com/BayAreaMetro/TM1_2015_Base_Network to a local folder (I used C:\Models). This probably should not be done inside the network wrangler folder. +10. Get the projects from Box Not-RSG: From https://mtcdrive.box.com/s/unic7tf0sokleacg4fgu0dtu8ixkyfg6 RSG: I Copied to the files folder to Sharepoint as "04_Network_Work\MTC Data\NetworkProjects_20230719.zip I unzipped to C:\Models\TM1_NetworkProjects -10. Also download everything on Box since July 19 +11. Also download everything on Box since July 19 Not-RSG: use box, sort by date, select all necessary RSG: Copied to files folder as "04_Network_Work\MTC Data\TM1_NetworkProjects-selected.zip" -11. Set base network env var. Use these commands in an Anaconda prompt: +12. Set base network env var. Use these commands in an Anaconda prompt: `conda env config vars set "TM1_2015_Base_Network=C:\Models\TM1_2015_Base_Network"` `conda env config vars set "TM1_NetworkProjects=C:\Models\TM1_NetworkProjects"` `conda env config vars set "CUBE_HOST_FILE=C:\Models\NetworkWrangler\HostnamesWithCube.txt"` `conda activate NetworkWrangler` + Note: you can test these using `conda env config vars list` +13. If you wish to use the 'reportDiff' function, you will need to install ArcGIS Pro on your machine and, while having NetworkWrangler activated, use `conda install arcpy=3.1 -c esri` in Anaconda prompt. # Running Network Wrangler for the Base Year 1. Be in the correct Anaconda Environment (if not already) - conda activate tm15-python310 + `conda activate tm15-python310` 2. Build the test network - python .\build_network_mtc.py Test .\net_spec_test.py + `python .\build_network_mtc.py Test .\net_spec_test.py`\ + (If 'reportDiff' is desired, add `--create_project_diffs` to the end of the command above.) # Adding Project Cards @@ -76,4 +79,4 @@ WranglerLogger: INFO trn 2020.trn.01 MAJ_BRT030001_BART_to_SanJose WranglerLogger: INFO trn 2020.trn.01 MAJ_BRT030001_BART_to_SanJose trn SCL110005_BART_to_Berryessa -1 ``` -In this case, it can be fixed by including the prerequisite projects in the appropriate network. \ No newline at end of file +In this case, it can be fixed by including the prerequisite projects in the appropriate network. From a33a58ef64f7ff629e9b77ca7652ecba792e7c72 Mon Sep 17 00:00:00 2001 From: Rohan Sirupa <91225888+rsirupa@users.noreply.github.com> Date: Sun, 1 Oct 2023 20:39:34 -0700 Subject: [PATCH 16/22] Python environment for Network Wrangler Uploading a yaml file for Network Wrangler's python environment --- environment_nw.yml | Bin 0 -> 16782 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 environment_nw.yml diff --git a/environment_nw.yml b/environment_nw.yml new file mode 100644 index 0000000000000000000000000000000000000000..b2738ca7ae6ead7305861e1d4536f60eb1b46277 GIT binary patch literal 16782 zcmbW8*-{%#5{3JEBIX_b7mx!XjQvl9Utwa}6J?Qh7?w{R1x{K~M zeYVmk58YZ+eEOGuW_n%elb7zU`s`AlUW?{c&u{d1p69b?y;kYnN?h*}ZOx6fKlGQU z?pwF$K6RhB(oUa3`78qMM8UB)!bzR)1S) z-E;lrT(o`q7fE&_dZ>>@35O%S7KIc`ecG;@>7KQA$Uhg=(39w64S6E8TgqlFpQYrV zcVDFQywQ{=p`1yRGs$~3$ZzC>*r4N$4Or-A6B1Yu|6kcx=X(1-uWHZ=m)!rVp_-xJ!xk39cb&ttLuI{gxM zUqp{>hzx9t^z%yozO0!JDWE))_V77ZEIjF7_+W#tdW9WYKKS!oR1bRE7&Hn?q||7D z;zAl<==VdSL*LTY`*dbKB6cIcU8l%hOWs%6>qJrzLzeqk{|mg57sjFyoh=u7Sd*+Z z-d`%NO7EE>A{YBSN~?$7GssF_3du6p{dztmWP*+t(PLROoUW6R#oEM4>lxNR5$|K+ z@>E{#`}Qf}ll)3X#cP(r`L2}YNc2b2^h!K01~?HH8(D|QwH%*h({Hj%8&h?RoJ;ed zj7a@+4p@#X_emOOKMcnnpMAU#JbR5SX96$)w z?MXjWE~5n;28#EgrIxCc1zj!4ROI9=i?8OXww2kx@3lHMpvOK`ZhPyr(8SSH*BV#u z7oi6$SbO{wdB;9#?Ktcs>`hID(@e-Ew>|1J(DzH95=+iEIiB`gmz?-2`JTmvNFXZA z$JwHchE~p2SA6V@i(Ez|dFxc~r~8PS2x7?pMs`G2R1aJ2vm)(WywCOfOD{I5%+IpR zWA{U=y92@Jyf5?Jg;x2{ldO27_w+BfDV`SF3X!cj?BNgD&Apm6o>v)ZzXv|j+Su;b z)@F5$v$kzMscnBLxz{O=*=t}dklp6Lc($ypQ>f_KUS*@~6VU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Mci^2f!6X>qb~_f%Rxj7^ zcMj-c*#olsi?y7UhHcirH9t%Bmfb<#CHOqqS#wBc-y5X1U2ScNE$~*J%$Ks}b6sTQ zS@##iGPXJysk>0%xv_8e`fhowvD-iFSA4!?4 Date: Sun, 1 Oct 2023 20:52:46 -0700 Subject: [PATCH 17/22] Update Local Machine Instructions.md Updated the environment file for Network Wrangler --- Local Machine Instructions.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Local Machine Instructions.md b/Local Machine Instructions.md index d70ebc4..5c1232b 100644 --- a/Local Machine Instructions.md +++ b/Local Machine Instructions.md @@ -11,12 +11,12 @@ The computer's path needs to include the path to Cube Voyager to use an executab To test this, open Anaconda Prompt or Anaconda Powershell and type `runtpp`. There should be an error that says "Error in Arg 1: (null)". # Setting Up Network Wrangler -1. Download the [Anaconda environment](https://github.com/RSGInc/travel-model-one/blob/transit_2050/tm15-python310.yml) to a location on your hard drive. +1. Download the [Anaconda environment](https://github.com/RSGInc/NetworkWrangler/blob/transit_2050/environment_nw.yml) to a location on your hard drive. 2. Created the local Anaconda environment. Open Anaconda Prompt or Anaconda Powershell (either will work, hereinafter referred to as Anaconda Prompt) and type: `cd path\you\downloaded\the\above\file\to` - `conda create -f tm15-python310.yml` + `conda create -f environment_nw.yml` 3. Switched to it. Use the following command in the Anaconda prompt - `conda activate tm15-python310` + `conda activate NetworkWrangler` 4. Change directories to an appropriate location on your hard drive. 5. Clone the network Wrangler Repo `git clone https://github.com/RSGInc/NetworkWrangler.git` @@ -42,10 +42,10 @@ To test this, open Anaconda Prompt or Anaconda Powershell and type `runtpp`. The Note: you can test these using `conda env config vars list` -13. If you wish to use the 'reportDiff' function, you will need to install ArcGIS Pro on your machine and, while having NetworkWrangler activated, use `conda install arcpy=3.1 -c esri` in Anaconda prompt. +13. If you wish to use the 'reportDiff' function, you will need to install and activate ArcGIS Pro on your machine. The NetworkWrangler environment already has `arcpy` environment installed with it. # Running Network Wrangler for the Base Year 1. Be in the correct Anaconda Environment (if not already) - `conda activate tm15-python310` + `conda activate NetworkWrangler` 2. Build the test network `python .\build_network_mtc.py Test .\net_spec_test.py`\ (If 'reportDiff' is desired, add `--create_project_diffs` to the end of the command above.) From fda7f637efd1cab806e464b0175c75e12df0442b Mon Sep 17 00:00:00 2001 From: williamwangrsg <109112463+williamwangrsg@users.noreply.github.com> Date: Tue, 3 Oct 2023 16:37:31 -0700 Subject: [PATCH 18/22] added instructions to use build_network_mtc_add_project.py for PPA --- Local Machine Instructions.md | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/Local Machine Instructions.md b/Local Machine Instructions.md index 5c1232b..4f19f48 100644 --- a/Local Machine Instructions.md +++ b/Local Machine Instructions.md @@ -4,6 +4,10 @@ This code has been updated to run on a laptop that has Cube Voyager 6.5.0 instal Questions can be directed to Andrew Rohne at RSG (andrew.rohne (at) rsginc.com). 9/20/2023. +--- +Note: This is still being written! +--- + # Setting Up Cube The computer's path needs to include the path to Cube Voyager to use an executable there. Follow [these instructions](https://www.computerhope.com/issues/ch000549.htm) for your OS version, add C:\Program Files\Citilabs\CubeVoyager to the path. @@ -11,6 +15,9 @@ The computer's path needs to include the path to Cube Voyager to use an executab To test this, open Anaconda Prompt or Anaconda Powershell and type `runtpp`. There should be an error that says "Error in Arg 1: (null)". # Setting Up Network Wrangler + +This largely follows [the Network Wrangler Documentation](https://github.com/BayAreaMetro/modeling-website/wiki/Network-Building-with-NetworkWrangler#step-4-build-a-network-with-your-project) but is distilled down to something a little more concise. + 1. Download the [Anaconda environment](https://github.com/RSGInc/NetworkWrangler/blob/transit_2050/environment_nw.yml) to a location on your hard drive. 2. Created the local Anaconda environment. Open Anaconda Prompt or Anaconda Powershell (either will work, hereinafter referred to as Anaconda Prompt) and type: `cd path\you\downloaded\the\above\file\to` @@ -50,21 +57,29 @@ To test this, open Anaconda Prompt or Anaconda Powershell and type `runtpp`. The `python .\build_network_mtc.py Test .\net_spec_test.py`\ (If 'reportDiff' is desired, add `--create_project_diffs` to the end of the command above.) -# Adding Project Cards - ---- -Note: This is still being written! ---- - -This largely follows [the Network Wrangler Documentation](https://github.com/BayAreaMetro/modeling-website/wiki/Network-Building-with-NetworkWrangler#step-4-build-a-network-with-your-project) but is distilled down to something a little more concise. +# Test Project Coding The basic version is to add the cards to the TM1_NetworkProjects folder, and then copy the net_spec_test.py script to something a little more descriptive (for the BART San Jose example, I used `net_spec_MAJ_BRT030001_BART_to_SanJose.py`). The script needs to have a project code, scenario (for the purposes of this project, I use `build`) Run with `python build_network_mtc.py build net_spec_MAJ_BRT030001_BART_to_SanJose.py` -## Determine Pre-requisite Projects +# Adding a Project Card for PPA + +Use [build_network_mtc_add_project.py](https://github.com/BayAreaMetro/NetworkWrangler/blob/master/scripts/build_network_mtc_add_project.py) for PPA since only a small number of projects are added (mostly just 1). The base network should be the latest 2050 network in [Sample of L drive Projects Folder](https://mtcdrive.box.com/s/vbpsrs7tpvj1qfxmasink52wls8pexrj), one for each future. The script will automatically use `XXX_17` (latest). In [build_network_mtc_add_project.py](https://github.com/BayAreaMetro/NetworkWrangler/blob/master/scripts/build_network_mtc_add_project.py), point `PPA_DIR` to [Sample of L drive Projects Folder](https://mtcdrive.box.com/s/vbpsrs7tpvj1qfxmasink52wls8pexrj) and `NODE_NAMES` to `TM1_2015_Base_Network\Node Description.xls`. +Required arguments to use the script: +1. Future scenario: one of these three - `CleanAndGreen`, `RisingTides`, and `BackToTheFuture`. `CleanAndGreen` is taken as an example to demonstrate. +2. Input network: `..\Sample of L drive Projects Folder\2050_TM151_PPA_CG_17\INPUT`. +3. Project to be added: one of the projects in `TM1_NetworkProjects`. Take `MAJ_BRT030001_BART_to_SanJose` as an example. +4. Nature of project: `--hwy`, `--trn`, or both. +5. Output: create a separate folder - `..\MTC_Outputs\MAJ_BRT030001_BART_to_SanJose_CG`. +6. `project_short_id`: in this case it's `MAJ_BRT030001_BART_to_SanJose_CG`. + +Full example: `python build_network_mtc_add_project.py --trn --input_network "..\Box\Performance and Equity\Project Performance\Sample of L drive Projects Folder\2050_TM151_PPA_CG_17\INPUT" --output_network "..\MTC_Outputs\MAJ_BRT030001_BART_to_SanJose_CG" --create_project_diffs CleanAndGreen MAJ_BRT030001_BART_to_SanJose_CG MAJ_BRT030001_BART_to_SanJose` + + +## Determine Pre-requisite Projects # Notes and Errors From a48cc964af08d167b4e032ef2f95f7e23efe5933 Mon Sep 17 00:00:00 2001 From: williamwangrsg <109112463+williamwangrsg@users.noreply.github.com> Date: Wed, 18 Oct 2023 21:43:55 -0700 Subject: [PATCH 19/22] add a reminder as RSG switches to coding/reviewing project cards straight from Box --- Local Machine Instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Local Machine Instructions.md b/Local Machine Instructions.md index 4f19f48..01f8c4f 100644 --- a/Local Machine Instructions.md +++ b/Local Machine Instructions.md @@ -48,7 +48,7 @@ This largely follows [the Network Wrangler Documentation](https://github.com/Bay `conda activate NetworkWrangler` Note: you can test these using `conda env config vars list` - + Note2: Don't forget to reset if you start editing project cards straight from Box. 13. If you wish to use the 'reportDiff' function, you will need to install and activate ArcGIS Pro on your machine. The NetworkWrangler environment already has `arcpy` environment installed with it. # Running Network Wrangler for the Base Year 1. Be in the correct Anaconda Environment (if not already) From 9d4704e945dfa8fc2549b969aadf394babb49ed8 Mon Sep 17 00:00:00 2001 From: williamwangrsg <109112463+williamwangrsg@users.noreply.github.com> Date: Wed, 31 Jan 2024 14:28:13 -0500 Subject: [PATCH 20/22] add z drive installation instructions --- Xdrive Script (1).txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Xdrive Script (1).txt diff --git a/Xdrive Script (1).txt b/Xdrive Script (1).txt new file mode 100644 index 0000000..d4f6dca --- /dev/null +++ b/Xdrive Script (1).txt @@ -0,0 +1,14 @@ +Please copy the entire script below and paste into PowerShell. +Do not run Powershell as Administrator. +The Zdrive should persist with restarts of the computer. + + +$connectTestResult = Test-NetConnection -ComputerName mtcproject.file.core.windows.net -Port 445 +if ($connectTestResult.TcpTestSucceeded) { + # Save the password so the drive will persist on reboot + cmd.exe /C "cmdkey /add:`"mtcproject.file.core.windows.net`" /user:`"localhost\mtcproject`" /pass:`"uaBceR+X4ssB5Uu3z25AzKCWvIWBn69JZ92OjMm7MWSVc2hG0MaXkKhYO0kdApUuxz/BBPcxNWR3+AStaJEEGg==`"" + # Mount the drive + New-PSDrive -Name X -PSProvider FileSystem -Root "\\mtcproject.file.core.windows.net\zdrive" -Persist +} else { + Write-Error -Message "Unable to reach the Azure storage account via port 445. Check to make sure your organization or ISP is not blocking port 445, or use Azure P2S VPN, Azure S2S VPN, or Express Route to tunnel SMB traffic over a different port." +} \ No newline at end of file From c59130121232886c8681a82832878a2174af07a4 Mon Sep 17 00:00:00 2001 From: Rohan Sirupa <91225888+rsirupa@users.noreply.github.com> Date: Fri, 22 Mar 2024 09:57:50 -0700 Subject: [PATCH 21/22] Fixed couple of commands for installation --- Local Machine Instructions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Local Machine Instructions.md b/Local Machine Instructions.md index 01f8c4f..647612e 100644 --- a/Local Machine Instructions.md +++ b/Local Machine Instructions.md @@ -21,7 +21,7 @@ This largely follows [the Network Wrangler Documentation](https://github.com/Bay 1. Download the [Anaconda environment](https://github.com/RSGInc/NetworkWrangler/blob/transit_2050/environment_nw.yml) to a location on your hard drive. 2. Created the local Anaconda environment. Open Anaconda Prompt or Anaconda Powershell (either will work, hereinafter referred to as Anaconda Prompt) and type: `cd path\you\downloaded\the\above\file\to` - `conda create -f environment_nw.yml` + `conda env create -f environment_nw.yml` 3. Switched to it. Use the following command in the Anaconda prompt `conda activate NetworkWrangler` 4. Change directories to an appropriate location on your hard drive. @@ -32,7 +32,7 @@ This largely follows [the Network Wrangler Documentation](https://github.com/Bay 7. Install NetworkWrangler. `cd NetworkWrangler` `pip install -e .` -8. Open python, import NetworkWrangler, ensure no errors +8. Open python, import Wrangler, ensure no errors 9. Get the base network - clone https://github.com/BayAreaMetro/TM1_2015_Base_Network to a local folder (I used C:\Models). This probably should not be done inside the network wrangler folder. 10. Get the projects from Box Not-RSG: From https://mtcdrive.box.com/s/unic7tf0sokleacg4fgu0dtu8ixkyfg6 From b7d86f9ee82b200f084b6ec92d89f9cee161afc4 Mon Sep 17 00:00:00 2001 From: David Hensle Date: Thu, 23 May 2024 15:23:54 -0700 Subject: [PATCH 22/22] Revert "Update SPDCLASS/CAPCLASS for I280 higher speeds" This reverts commit 581f7c3bc4bb51e797ec6f7fd5f4de8bf912feb7. --- scripts/set_capclass.job | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/scripts/set_capclass.job b/scripts/set_capclass.job index 755304b..9b080ee 100644 --- a/scripts/set_capclass.job +++ b/scripts/set_capclass.job @@ -14,7 +14,6 @@ ; - Facility Type (FT) ; - Traffic Operations (TOS) ; - Signal Coordination (SIGCOR) -; - Route number (ROUTENUM) - I280 faster speeds ; ; => sets Free Flow Speed (FFS) based on CAPCLASS ; => sets Capacity (CAP) based on CAPCLASS @@ -84,10 +83,6 @@ RUN PGM=HWYNET IF (FT=7 & AT=4 & SIGCOR=1) CAPCLASS=60 IF (FT=7 & AT=5 & SIGCOR=1) CAPCLASS=60 - ; Update for 280 higher speeds - ; See also: https://github.com/BayAreaMetro/TM1_2015_Base_Network/commit/372870e8324aafc94ad834ca93ca1fc7d3170270 - IF ((ROUTENUM==280) && (AT>2)) CAPCLASS=62 - SPDCLASS=CAPCLASS ;----------------------------------------------------------------------- ; Code Free Flow Speeds for Links @@ -157,8 +152,7 @@ RUN PGM=HWYNET IF (CAPCLASS=58) FFS=65 IF (CAPCLASS=59) FFS=50 ;TOS Fwy-to-Fwy (AT=4,5) IF (CAPCLASS=60) FFS=40 ;Arterial Sig. Coor. (AT=4,5) - ;----------------------------------------------------------------------- - IF (CAPCLASS=62) FFS=75 + ;----------------------------------------------------------------------- ; Code Capacities for Links @@ -229,7 +223,6 @@ RUN PGM=HWYNET IF (CAPCLASS=59) CAP=2050 ;TOS Fwy-to-Fwy (AT=4,5) IF (CAPCLASS=60) CAP=1100 ;Arterial Signal Coordination (AT=4,5) ;----------------------------------------------------------------------- - IF (CAPCLASS=62) CAP=2150 ;----------------------------------------------------------------------- ; Free-Flow Time Variable @@ -250,7 +243,7 @@ RUN PGM=HWYNET SPDCAP SPEED[31]=45,60,45,25,35,18,30,60,50,25 SPDCAP SPEED[41]=50,65,50,30,40,18,35,65,45,30 SPDCAP SPEED[51]=50,65,55,35,40,18,40,65,50,40 - SPDCAP SPEED[61]=50,75 + SPDCAP SPEED[61]=0,0,0 ; INDEX is CAPCLASS SPDCAP CAPACITY[01]=1850,2050,1450,600,1450,0,900,2150,2100,1500 @@ -259,7 +252,6 @@ RUN PGM=HWYNET SPDCAP CAPACITY[31]=1950,2100,1600,700,1550,0,1000,2200,1950,1000 SPDCAP CAPACITY[41]=2000,2150,1650,900,1550,0,1050,2250,2000,1050 SPDCAP CAPACITY[51]=2000,2150,1650,950,1550,0,1050,2250,2050,1100 - SPDCAP CAPACITY[61]=2000,2150 REPORT SPEED=YES CAPACITY=YES ;report speed/capacity tables in network