A registry for Network Wrangler Project Cards.
Network Wrangler 2.0 is a Python library for managing travel model network scenarios. Network Wrangler uses Project Cards to define network edits. The purpose of this repository is to automate the reconciliation of conflicting Project Cards.
Consider, for example, an existing base year network that includes nodes A, B, and C. Project Card X extends Main Street, adding Node 1 at Location Alpha. Project Card Y extends Broad Street, adding a different node at Location Beta, but also labeling the new node Node 1. In the current Network Wrangler framework, users must manually manage the conflicting Node 1 definitions. The purpose of this repository is to automate the node (and link) numbering process via a registry.
- To get started, open up the
registry_config.ymlfile in a text editor. This file defines the allowable range of themodel_node_idandmodel_link_idfields using theminimum_allowable_node_id,maximum_allowable_node_id,minimum_allowable_link_idandmaxmimum_allowable_link_id. This range should include all the possible values of nodes and links that may be used in your travel model. The software will fail with an error message if a Project Card with anmodel_node_idormodel_link_idthat is outside these allowable ranges. - Next, also in the
registry_config.ymlfile, we need to define the node and link identifiers that are already used in the base network that the Project Cards are being applied to. These can be generic to the entire region, or specific to geographies, such as counties. This accommodates configurations, such as the one used by the Metropolitan Transportation Commission, in which node and link ranges are segmented by county. For each geography, the user must define thestartandendnodes and links that are used in the base year network. The software will fail with an error message if a Project Card introduces amodel_node_idormodel_link_idthat is already used by the base network. - Add a Project Card to the
projectsdirectory (or in a sub-folder of theprojectsdirectory). Commit the change to GitHub. That's it.
When a Project Card is added to the projects directory and committed to GitHub, the repository runs a set of procedures to do the following:
- Identify Project Cards that add roadway or transit links to the network.
- Fail if the Project Card adds a node or link with an ID that is already in the base network, as this suggest their may be a disconnect between the configuration file and the details of the base network.
- Update the
registry.csvdatabase with the new nodes and/or new links, identifying the project that adds them. - If a Project Card that adds links conflicts with nodes or links identified in the
registry.csvdatabase, these nodes and links are updated to use a node or link number that is not in the registry. The Project Cards are updated accordingly.
To remove a Project Card from the registry, a user must do the following:
- Check out repository.
- Open the
registry.csvdatabase in a text editor and delete the entries specific to the project we want to remove. - Delete the project card from the
projectsdirectory. - Commit the change to GitHub.
Once a Project Card has been added to the registry, a user must do the following:
- Check out the repository.
- Open the
registry.csvdatabase in a text editor and delete the entries specific to the project we want to remove. - Edit the subject Project Card.
- Commit the change to GitHub.
The registry software currently treats each Project Card independently. As such, if one Project Card adds a link and a second Project Card modifies the attribute of that link, the user is responsible to make sure the model_link_ids across the two cards align. To do this, we recommend:
- First create the Project Card to add the desired nodes and links.
- Upload this Project Card so that the nodes and link identifiers are registered in the registry and the Project Cards are updated.
- Use the node and link identifiers in the registry for subsequent Project Cards that modify the attributes of these new node and links.
When using the Project Card registry, using these tricks will make things easier:
- When creating a new roadway link, use the same
model_link_idfor each new link. Specifically, use the number that is one larger than theendvalue used in each county as defined in theregistry_config.yml. For example, theendvalue used in San Francisco County is133492. Each new link added in San Francisco County should then have amodel_link_idof133493. When Project Cards with thismodel_link_idare uploaded to this registry, the software will update themodel_link_idto the next available number. - Similar to the above approach, when a new node is added, the user should use the next available node number per the county-specific rules. For example, a network node added in Sonoma County should use
4556146, because theendnetwork value used in the base network is4556145. If more than one node is added in a single Project Card, each should be incremented from one, starting with the next available number. - Network Wrangler allows you to have two types of Project Cards:
.ymlfiles or.wranglerfiles. The.ymlfile require a certain structure and allow users to implement proscribed procedures for editing the network. The.wranglerfiles allow the user to write Python code directly to modify the network. The registry only acts on the.ymlfiles, not the.wranglerfiles. Nodes and links should not be added via.wranglercards for this reason.