Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

encode_waypoints output differs by Python version #237

Closed
perrygeo opened this issue May 31, 2018 · 1 comment · Fixed by #239
Closed

encode_waypoints output differs by Python version #237

perrygeo opened this issue May 31, 2018 · 1 comment · Fixed by #239
Milestone

Comments

@perrygeo
Copy link
Contributor

The implementation relies on the behavior of round which differs between python 2.7 and 3.x

from mapbox.encoding import encode_waypoints

features = [{
  "type": "Feature",
  "geometry": {
    "type": "Point",
    "coordinates": [1, 0]
  },
  "properties": {}}]

print(encode_waypoints(features))

gives us

  • 1,0 for Python 3
  • 1.0,0.0 for Python 2

This should not affect the value returned from the Mapbox SDK but it means that the precise URL is not deterministic - which might affect caching and tests.

@perrygeo
Copy link
Contributor Author

@critical-path FYI this was the bug causing the directions CLI tests to fail on python 2.7 in mapbox/mapbox-cli-py#122. I'm going to account for it on the CLI side

perrygeo added a commit to mapbox/mapbox-cli-py that referenced this issue May 31, 2018
@perrygeo perrygeo added this to the 0.16.1 milestone Jun 1, 2018
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 a pull request may close this issue.

1 participant