Skip to content

Commit f887261

Browse files
add: documentation for the library, chore: modified email
1 parent 351f262 commit f887261

File tree

6 files changed

+87
-4
lines changed

6 files changed

+87
-4
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@
33
## Installation
44
- `python -m pip install --upgrade pip`
55
- `pip install trafficinterventions xml`
6+
7+
## Documentation
8+
All relevant files can be found [here](https://github.com/WSL-IIITB/Traffic-Interventions/tree/main/docs)
4.15 KB
Binary file not shown.
3.07 KB
Binary file not shown.

docs/index.py

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
import trafficinterventions
2+
3+
"""
4+
Note: If you wish to not rewrite the XML file, please add another parameter to the functions.
5+
"""
6+
7+
"""
8+
Change Edges Functionality
9+
"""
10+
11+
# Instantiating an object of the XML Parser for Lane Modification
12+
fileName = "sample.xml" # Change the path of your file accordingly.
13+
ce = trafficinterventions.ChangeEdges.ChangeEdges(fileName=fileName)
14+
15+
# Get Root Tag
16+
print(ce.getRootElementTag())
17+
18+
# Get Unique Parent Tags
19+
print(ce.getUniqueParentTags())
20+
21+
# Get the first 10 Lane Type IDs
22+
print(ce.getUniqueEdgeIDs()[:10])
23+
24+
# Get Edge Inforation
25+
ce.getEdgeInformation(["-734354815#0"])
26+
27+
# # Selectively disallow vehicle types from edge
28+
ce.disallowAppendTypes(["truck", "bus"], ["-734354815#0"], None)
29+
30+
# Selectively allow vehicle types from edge
31+
ce.allowAppendTypes(["e-scooter"], ["-777797681"], None)
32+
33+
"""
34+
Change Lanes Functionality
35+
"""
36+
# Instantiating an object of the XML Parser for Lane Modification
37+
fileName = "sample2.xml" # Change the path of your file accordingly.
38+
cl = trafficinterventions.ChangeLanes.ChangeLanes(fileName=fileName)
39+
40+
# Get Root Tag
41+
print(cl.getRootElementTag())
42+
43+
# Get Unique Parent Tags
44+
print(cl.getUniqueParentTags())
45+
46+
# Get all Lane Type IDs
47+
print(cl.getLaneTypes())
48+
49+
# Get all Lane Information
50+
51+
print(cl.getLaneInformation())
52+
53+
# Changing priorities of highway.cycleway lanes to 2
54+
cl.changePriorityLanes(
55+
["highway.cycleway"],
56+
2
57+
)
58+
59+
# Changing the number of lanes reserved to highway.trunk to 3
60+
cl.changeNumLanes(
61+
["highway.cycleway"],
62+
3
63+
)
64+
65+
# Toggling one-way status of railway.rail
66+
cl.toggleOneWay(
67+
["railway.rail"]
68+
)
69+
70+
# Changing the number of lanes on the highway to double their original count
71+
l = cl.getLaneInformation()
72+
for i in range(len(l)):
73+
cl.changeNumLanes(
74+
[l[i][0]],
75+
2 * int(l[i][1]["numLanes"])
76+
)
77+

setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[metadata]
22
name = trafficinterventions
3-
version = 0.0.2
3+
version = 0.0.3
44
author = WSL, IIITB
5-
author_email = vijay.jaisankar@iiitb.ac.in
5+
author_email = WSL1@iiitb.ac.in
66
description = Python Package to perform simple Traffic Interventions.
77
long_description = file: README.md
88
long_description_content_type = text/markdown

src/trafficinterventions.egg-info/PKG-INFO

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Metadata-Version: 2.1
22
Name: trafficinterventions
3-
Version: 0.0.2
3+
Version: 0.0.3
44
Summary: Python Package to perform simple Traffic Interventions.
55
Home-page: https://github.com/WSL-IIITB/Traffic-Interventions
66
Author: WSL, IIITB
7-
Author-email: vijay.jaisankar@iiitb.ac.in
7+
Author-email: WSL1@iiitb.ac.in
88
License: UNKNOWN
99
Project-URL: Bug Tracker, https://github.com/WSL-IIITB/Traffic-Interventions/issues
1010
Platform: UNKNOWN
@@ -21,4 +21,7 @@ License-File: LICENSE
2121
- `python -m pip install --upgrade pip`
2222
- `pip install trafficinterventions xml`
2323

24+
## Documentation
25+
All relevant files can be found [here](https://github.com/WSL-IIITB/Traffic-Interventions/tree/main/docs)
26+
2427

0 commit comments

Comments
 (0)