diff --git a/README.md b/README.md index 1953c9a..e14d2c8 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,6 @@ ## Installation - `python -m pip install --upgrade pip` - `pip install trafficinterventions xml` + +## Documentation +All relevant files can be found [here](https://github.com/WSL-IIITB/Traffic-Interventions/tree/main/docs) diff --git a/dist/trafficinterventions-0.0.3-py3-none-any.whl b/dist/trafficinterventions-0.0.3-py3-none-any.whl new file mode 100644 index 0000000..1af4025 Binary files /dev/null and b/dist/trafficinterventions-0.0.3-py3-none-any.whl differ diff --git a/dist/trafficinterventions-0.0.3.tar.gz b/dist/trafficinterventions-0.0.3.tar.gz new file mode 100644 index 0000000..3bebc65 Binary files /dev/null and b/dist/trafficinterventions-0.0.3.tar.gz differ diff --git a/docs/index.py b/docs/index.py new file mode 100644 index 0000000..2658bb8 --- /dev/null +++ b/docs/index.py @@ -0,0 +1,77 @@ +import trafficinterventions + +""" +Note: If you wish to not rewrite the XML file, please add another parameter to the functions. +""" + +""" +Change Edges Functionality +""" + +# Instantiating an object of the XML Parser for Lane Modification +fileName = "sample.xml" # Change the path of your file accordingly. +ce = trafficinterventions.ChangeEdges.ChangeEdges(fileName=fileName) + +# Get Root Tag +print(ce.getRootElementTag()) + +# Get Unique Parent Tags +print(ce.getUniqueParentTags()) + +# Get the first 10 Lane Type IDs +print(ce.getUniqueEdgeIDs()[:10]) + +# Get Edge Inforation +ce.getEdgeInformation(["-734354815#0"]) + +# # Selectively disallow vehicle types from edge +ce.disallowAppendTypes(["truck", "bus"], ["-734354815#0"], None) + +# Selectively allow vehicle types from edge +ce.allowAppendTypes(["e-scooter"], ["-777797681"], None) + +""" +Change Lanes Functionality +""" +# Instantiating an object of the XML Parser for Lane Modification +fileName = "sample2.xml" # Change the path of your file accordingly. +cl = trafficinterventions.ChangeLanes.ChangeLanes(fileName=fileName) + +# Get Root Tag +print(cl.getRootElementTag()) + +# Get Unique Parent Tags +print(cl.getUniqueParentTags()) + +# Get all Lane Type IDs +print(cl.getLaneTypes()) + +# Get all Lane Information + +print(cl.getLaneInformation()) + +# Changing priorities of highway.cycleway lanes to 2 +cl.changePriorityLanes( + ["highway.cycleway"], + 2 +) + +# Changing the number of lanes reserved to highway.trunk to 3 +cl.changeNumLanes( + ["highway.cycleway"], + 3 +) + +# Toggling one-way status of railway.rail +cl.toggleOneWay( + ["railway.rail"] +) + +# Changing the number of lanes on the highway to double their original count +l = cl.getLaneInformation() +for i in range(len(l)): + cl.changeNumLanes( + [l[i][0]], + 2 * int(l[i][1]["numLanes"]) + ) + diff --git a/setup.cfg b/setup.cfg index cd59251..6bb6633 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,8 +1,8 @@ [metadata] name = trafficinterventions -version = 0.0.2 +version = 0.0.3 author = WSL, IIITB -author_email = vijay.jaisankar@iiitb.ac.in +author_email = WSL1@iiitb.ac.in description = Python Package to perform simple Traffic Interventions. long_description = file: README.md long_description_content_type = text/markdown diff --git a/src/trafficinterventions.egg-info/PKG-INFO b/src/trafficinterventions.egg-info/PKG-INFO index 1552daa..be1ce85 100644 --- a/src/trafficinterventions.egg-info/PKG-INFO +++ b/src/trafficinterventions.egg-info/PKG-INFO @@ -1,10 +1,10 @@ Metadata-Version: 2.1 Name: trafficinterventions -Version: 0.0.2 +Version: 0.0.3 Summary: Python Package to perform simple Traffic Interventions. Home-page: https://github.com/WSL-IIITB/Traffic-Interventions Author: WSL, IIITB -Author-email: vijay.jaisankar@iiitb.ac.in +Author-email: WSL1@iiitb.ac.in License: UNKNOWN Project-URL: Bug Tracker, https://github.com/WSL-IIITB/Traffic-Interventions/issues Platform: UNKNOWN @@ -21,4 +21,7 @@ License-File: LICENSE - `python -m pip install --upgrade pip` - `pip install trafficinterventions xml` +## Documentation +All relevant files can be found [here](https://github.com/WSL-IIITB/Traffic-Interventions/tree/main/docs) +