network_wrangler.ProjectCard
- class network_wrangler.ProjectCard(attribute_dictonary)[source]
Bases:
object
Representation of a Project Card
- __dict__
Dictionary of project card attributes
- valid
Boolean indicating if data conforms to project card data schema
- __init__(attribute_dictonary)[source]
Constructor for Project Card object.
- Parameters:
attribute_dictonary – a nested dictionary of project card attributes.
Methods
__init__
(attribute_dictonary)Constructor for Project Card object.
build_link_selection_query
(selection, ...[, ...])One line description #todo #239 #238
new_roadway
(card)Probably delete.
new_transit_right_of_way
(card)Probably delete.
parallel_managed_lanes
(card)Probably delete.
read
(card_filename[, validate])Reads and validates a Project card
read_wrangler_card
(w_card_filename)Reads wrangler project cards with YAML front matter and then python code.
read_yml
(card_filename)Reads "normal" wrangler project cards defined in YAML.
roadway_attribute_change
(card)Probably delete.
transit_attribute_change
(card)Probably delete.
validate_project_card_schema
(card_filename)Tests project card schema validity by evaluating if it conforms to the schemas
write
([out_filename])Writes project card dictionary to YAML file.
Attributes
- static build_link_selection_query(selection, unique_link_ids, mode=['drive_access'], ignore=[])[source]
One line description #todo #239 #238
- Parameters:
selection –
unique_link_ids –
mode –
ignore –
returns:
usage
- new_roadway(card)[source]
Probably delete. Reads a New Roadway card.
args: card: the project card stored in a dictionary
- new_transit_right_of_way(card)[source]
Probably delete. Reads a New Transit Dedicated Right of Way card.
args: card: the project card stored in a dictionary
- parallel_managed_lanes(card)[source]
Probably delete. Reads a Parallel Managed lanes card.
args: card: the project card stored in a dictionary
- static read(card_filename, validate=True)[source]
Reads and validates a Project card
- Parameters:
card_filename – The path to the project card file.
validate – Boolean indicating if the project card should be validated. Defaults to True.
Returns a Project Card object
- static read_wrangler_card(w_card_filename)[source]
Reads wrangler project cards with YAML front matter and then python code.
- Return type:
dict
- Parameters:
w_card_filename – where the project card is
Returns: Attribute Dictionary for Project Card
- static read_yml(card_filename)[source]
Reads “normal” wrangler project cards defined in YAML.
- Return type:
dict
- Parameters:
card_filename – file location where the project card is.
Returns: Attribute Dictionary for Project Card
- roadway_attribute_change(card)[source]
Probably delete. Reads a Roadway Attribute Change card.
args: card: the project card stored in a dictionary
- transit_attribute_change(card)[source]
Probably delete. Reads a Transit Service Attribute Change card.
args: card: the project card stored in a dictionary
- static validate_project_card_schema(card_filename, card_schema_filename='project_card.json')[source]
Tests project card schema validity by evaluating if it conforms to the schemas
- Return type:
bool
- Parameters:
card_filename – location of project card .yml file
card_schema_filename – location of project card schema to validate against. Defaults to project_card.json.
returns: boolean
- write(out_filename=None)[source]
Writes project card dictionary to YAML file.
- Parameters:
out_filename – file location to write the project card object as yml. If not provided, will write to current directory using the project name as the filename.
- ROADWAY_CATEGORIES = ['Roadway Property Change', 'Roadway Deletion', 'Parallel Managed lanes', 'Add New Roadway', 'Calculated Roadway']
- SECONDARY_TRANSIT_CATEGORIES = ['Roadway Deletion', 'Parallel Managed Lanes']
- TRANSIT_CATEGORIES = ['Transit Service Property Change', 'Add Transit']