Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove OSRM profiles, there's no such concept #64

Merged
merged 2 commits into from
Apr 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/psf/black
rev: 21.12b0
rev: 22.3.0
hooks:
- id: black
language_version: python3
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## **Unreleased**

-
### Fixed
- OSRM wasn't requesting the right endpoints: profile is meaningless

## [0.4.0](https://pypi.org/project/routingpy/0.4.0/)

Expand Down
147 changes: 2 additions & 145 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ sphinx-rtd-theme = "^1.0.0"
responses = "^0.10.0"
coverage = "^6.3.2"
pre-commit = "^2.7.1"
flake8 = "^3.9.1"
black = "^21.6b0"
pytest = "^6.2.5"
build = "^0.7.0"
setuptools-scm = "^6.4.2"
Expand Down
2 changes: 0 additions & 2 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ sphinx-rtd-theme>=1.0.0
responses>=0.10.0
coverage>=6.3.0
pre-commit>=2.13.0
flake8==3.9.0
black==21.6b0
build>=0.7.0
setuptools-scm>=6.4.2
pytest>=6.2.5
17 changes: 4 additions & 13 deletions routingpy/routers/osrm.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ def __init__(
def directions(
self,
locations,
profile,
radiuses=None,
bearings=None,
alternatives=None,
Expand All @@ -102,7 +101,8 @@ def directions(
dry_run=None,
**direction_kwargs
):
"""Get directions between an origin point and a destination point.
"""
Get directions between an origin point and a destination point.

Use ``direction_kwargs`` for any missing ``directions`` request options.

Expand All @@ -112,10 +112,6 @@ def directions(
from in order of visit.
:type locations: list of list

:param profile: Specifies the mode of transport to use when calculating
directions. One of ["car", "bike", "foot"].
:type profile: str

:param radiuses: A list of maximum distances (measured in
meters) that limit the search of nearby road segments to every given waypoint.
The values must be greater than 0, an empty element signifies to use the backend default
Expand Down Expand Up @@ -178,9 +174,7 @@ def directions(
)

return self._parse_direction_json(
self.client._request(
"/route/v1/" + profile + "/" + coords, get_params=params, dry_run=dry_run
),
self.client._request("/route/v1/driving/" + coords, get_params=params, dry_run=dry_run),
alternatives,
geometries,
)
Expand Down Expand Up @@ -276,7 +270,6 @@ def isochrones(self): # pragma: no cover
def matrix(
self,
locations,
profile,
radiuses=None,
bearings=None,
sources=None,
Expand Down Expand Up @@ -346,9 +339,7 @@ def matrix(
params = self.get_matrix_params(sources, destinations, annotations, **matrix_kwargs)

return self._parse_matrix_json(
self.client._request(
"/table/v1/" + profile + "/" + coords, get_params=params, dry_run=dry_run
)
self.client._request("/table/v1/driving/" + coords, get_params=params, dry_run=dry_run)
)

@staticmethod
Expand Down
2 changes: 1 addition & 1 deletion routingpy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def _decode(expression, precision=5, is3d=False, order="lnglat"):
0,
0,
len(expression),
float(10 ** precision),
float(10**precision),
)

while index < length:
Expand Down
2 changes: 0 additions & 2 deletions tests/test_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,6 @@
"osrm": {
"directions": {
"locations": PARAM_LINE_MULTI,
"profile": "car",
"radiuses": [PARAM_INT_BIG, PARAM_INT_BIG, PARAM_INT_BIG],
"bearings": [[PARAM_INT_SMALL, PARAM_INT_SMALL]] * 3,
"alternatives": True,
Expand All @@ -515,7 +514,6 @@
},
"matrix": {
"locations": PARAM_LINE_MULTI,
"profile": "car",
"radiuses": [PARAM_INT_BIG, PARAM_INT_BIG, PARAM_INT_BIG],
"bearings": [[PARAM_INT_SMALL, PARAM_INT_SMALL]] * 3,
"annotations": ["distance", "duration"],
Expand Down
Loading