Skip to content
This repository was archived by the owner on Jun 29, 2023. It is now read-only.

Updated a sanity check function for new format of station ids. #16

Merged
merged 3 commits into from
Dec 5, 2019

Conversation

Bastlwastl42
Copy link

I added a sanity check function for the new station id format as mentioned/proposed in issue #15

@leftshift
Copy link
Owner

Hey, thanks for the issue and pull request, much appreciated :)

I'd like to keep backwards compatibility for using old-style integer IDs in get_routes() and get_departures(). Let's just check for int there and use a helper function to prepend the new id prefix, as the last part of the new IDs seem to be the old IDs.

Also, we should update the docstrings for get_locations() and get_nearby_stations() to reflect these new IDs in the station objects.

If you don't have time to make these changes, I can fit them in some time this evening, as I'd like to release this as soon as I can.

@Bastlwastl42
Copy link
Author

Hey,

Having the ID split and stored separately sounds like a good idea. I also have the impression that the new format is :<Citycode?>: but this needs to be verified.
I won't have time to work on this until this weekend for sure, so if you can go ahead and then deploy, that would be much appreciated as well :)

@leftshift
Copy link
Owner

I wouldn't necessarily split the new IDs but I'd like to have some mechanism to silently convert old IDs to new IDs to remain backwards compatible.

Yeah, I'm also curious about the new ID format, I'll see whether I can find something about that. It looks like they are switching to universally unique station IDs, maybe there's some standard or oganisation for assigning those prefixes.

Great, I'll take care of it later then. :)

@leftshift leftshift merged commit f4f9f0d into leftshift:master Dec 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants