From f8872618e27141aff3cc3329e83579d460b8de51 Mon Sep 17 00:00:00 2001 From: vijay-jaisankar Date: Sun, 24 Apr 2022 19:37:33 +0530 Subject: [PATCH] add: documentation for the library, chore: modified email --- README.md | 3 + ...rafficinterventions-0.0.3-py3-none-any.whl | Bin 0 -> 4252 bytes dist/trafficinterventions-0.0.3.tar.gz | Bin 0 -> 3148 bytes docs/index.py | 77 ++++++++++++++++++ setup.cfg | 4 +- src/trafficinterventions.egg-info/PKG-INFO | 7 +- 6 files changed, 87 insertions(+), 4 deletions(-) create mode 100644 dist/trafficinterventions-0.0.3-py3-none-any.whl create mode 100644 dist/trafficinterventions-0.0.3.tar.gz create mode 100644 docs/index.py 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 0000000000000000000000000000000000000000..1af40257b74efcfa593220e50628089a3f48749e GIT binary patch literal 4252 zcma)=c{tQx-^XVnWS1pmmvxM7B1@LZ%rDH?##;7_VaPs~LRqs%B3rVBLDtBYEtF+! zKWh!LMb;>ZvOLr8zV5qjPd!iH>pIu>I{&=R_d4f&UgvYZ`Uo;|761T11-OVwHR^ic zXPtF|)TIRg1W7NPr!5A9wZppN>^*(#U2#}9S1&0IM_X41dpO#`-b>Q`#=0>vni3o}X+qk+-iq1%QT_lX@68p_zIjyHEDt5ji9!y75E06qL%c`<-4-$H}i;BHg z#KbZw-;YsCW!jE&NV&mny8fte*|yJLfy2#_uVku+W49;a=MZFF;3 z72X#uA#4BK*zFzIb^jnKTX-%0xzycL9hLeoUV1p{3zKPvbtpf$7UllR66WCzoagik zawjbND8+jg(A}|YJOo~KNE5=@ah7T+tI*OsKElHqK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Tl$Lv_X-d+SbE2@wsk4sd9g+=_%6aVdRc zvc#qLrz<1Z@m%^t->jv<3R`T9rZ#=w9vlUvWfsEAh?fwoP4h51Vc7x8I{ejYvg=2O zB4>AGwOYjec^q3p?%l#D?g1VX38pSXGW!FEJUF^LeiS~IEn1Hi!&wp@uPiE1nqFWm z6f10<KvP?V&()3gIrB*7)vfDs}X^I{I=7`fF+Dt5i){|B>~dRQ;z~ zd0UY6A6fs|qyEztmhA=VKb1g2g095`p9v&#~t9lA*DR z#p+}yqF5#`3!qP?9no)+&O9KWtxO{=r(Mae1)gt(^B|e;qpZ1EF3d?e2)TQ zHuoqF?WT7MeuwkUK4MQ6TM(PQ$6NkhKK~=@Kl1q>*?yw>&mwW(tN8Qv`VVxLHtIi> za-k~gKZj_Oz;lR7k}^>0K^hCp8t^NKjirj>HnYL|5ZAj<}lC8KS4E~ zcK)M+AM*T%%>ShQKWzR7_P;FiKWYE>v;TYkLd27Q|Djlw@BcYalfVBUfB!-L{)7De z2O0m#_-~Q_%lJ>me|yD$gYHGYsSi~Ch5sM%pH?YtzW=#et;zGh2Wbn(y?T4%`fIk mr6_;@>AT&3ss6IbCYx-s$tIg@vdQ*yw*LVjUBc`Dpa1~XdRH9) literal 0 HcmV?d00001 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) +