athuler / PassioGo

An unofficial API for the Passio Go transportation system
https://pypi.org/project/PassioGo/
MIT License
4 stars 3 forks source link

ETAs #16

Open athuler opened 4 months ago

athuler commented 4 months ago

Allow for the querying of estimated arrival times

dmv1167 commented 2 months ago

You may be interested in this collection of repos, specifically this repo. Perhaps you could pull from their API that has done the heavy lifting or poke around to see how they get their information. I appreciate having your library in python so the ladder may be more appealing, I'll look into it as well.

25 I worked with that API to get some basic ETA's working

athuler commented 2 months ago

I've seen these repos around and they are amazing! I might add them to the readme as an additional resource for people who may be interested!

For the ETA, I would like to stay with the native PassioGo API. The native ETA request structure is https://passiogo.com/mapGetData.php?eta=3&deviceId=59804559&stopIds=cta1514. (Sorry for not including it in the issue in the first place!) It seems that it's not as straightforward as the other requests, but it seems parseable.

And thanks for your PR! I'll take a look at your work!

dmv1167 commented 1 month ago

I just realized that I incorrectly claimed that the min() operation performed in Stop.getNextVehicle() would operate in O(1) time complexity. In reality, that method could simply return Stop.getEtas()[0] as PassioGo presents them in ascending order by eta, and therefore the entire method may not be required.

We may simply want to state in the docstring for Stop.getEtas() that etas are considered to be sorted upon creation.

I've opened #31 that addresses issues I missed initially.