transition
transition copied to clipboard
pyTransition : Errors in sample code
Two errors cause issues when running the sample code for request_accessibility_map:
- lat/long are inverted
- there is a trailing comma at the end of the parameters
Also, those code example should be included in the README from external file so that we can CI test them.
Another one. In the two samples for connecting to the server, the get_nodes() function is used as an example. It is called in two different ways: transition_instance.get_nodes() and Transition.get_nodes()
The first one gives the following error:
HTTPError: 500 Server Error: Internal Server Error for url: https://stmplanif.transition.city/api/v1/nodes (see issue #990), which means it actually manages to create a query.
While the second one gives the following error:
TypeError: Transition.get_nodes() missing 1 required positional argument: 'self'
So it seems that the first formulation should be used in all sample code.
https://github.com/chairemobilite/transition/pull/1171 add a method to link actual script to the README to ease in testing. Some fixes were applied
the trailling comma is not an issue in Python, but the other errors were fixed