Skip to content

Commit 8716388

Browse files
author
nilsnolde
committed
get rid of object validation, too maintenance heavy
1 parent 682db4c commit 8716388

File tree

11 files changed

+8
-1662
lines changed

11 files changed

+8
-1662
lines changed

openrouteservice/__init__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@
1717
# the License.
1818
#
1919

20-
__version__ = "2.1.0"
21-
22-
23-
# Make sure QGIS plugin can import openrouteservice-py
20+
__version__ = "2.2.0"
2421

2522

2623
def get_ordinal(number):

openrouteservice/directions.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
"""Performs requests to the ORS directions API."""
2121

22-
from openrouteservice import validator, deprecation
22+
from openrouteservice import deprecation
2323
from openrouteservice.optimization import optimization, Job, Vehicle
2424

2525
import warnings
@@ -177,9 +177,6 @@ def directions(client,
177177
:rtype: call to Client.request()
178178
"""
179179

180-
if validate:
181-
validator.validator(locals(), 'directions')
182-
183180
# call optimization endpoint and get new order of waypoints
184181
if optimize_waypoints is not None:
185182
if len(coordinates) <= 3:

openrouteservice/distance_matrix.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919

2020
"""Performs requests to the ORS Matrix API."""
2121

22-
from openrouteservice import validator
23-
2422

2523
def distance_matrix(client, locations,
2624
profile='driving-car',
@@ -84,9 +82,6 @@ def distance_matrix(client, locations,
8482
:rtype: call to Client.request()
8583
"""
8684

87-
if validate:
88-
validator.validator(locals(), 'distance_matrix')
89-
9085
params = {
9186
"locations": locations,
9287
}

openrouteservice/elevation.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717

1818
"""Performs requests to the ORS elevation API."""
1919

20-
from openrouteservice import validator
21-
2220

2321
def elevation_point(client, format_in, geometry,
2422
format_out='geojson',
@@ -47,8 +45,6 @@ def elevation_point(client, format_in, geometry,
4745
:returns: correctly formatted parameters
4846
:rtype: Client.request()
4947
"""
50-
if validate:
51-
validator.validator(locals(), 'elevation_point')
5248

5349
params = {
5450
'format_in': format_in,
@@ -89,8 +85,6 @@ def elevation_line(client, format_in, geometry,
8985
:returns: correctly formatted parameters
9086
:rtype: Client.request()
9187
"""
92-
if validate:
93-
validator.validator(locals(), 'elevation_line')
9488

9589
params = {
9690
'format_in': format_in,

openrouteservice/geocode.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#
1919

2020
"""Performs requests to the ORS geocode API (direct Pelias clone)."""
21-
from openrouteservice import convert, validator
21+
from openrouteservice import convert
2222

2323

2424
def pelias_search(client, text,
@@ -92,9 +92,6 @@ def pelias_search(client, text,
9292
:rtype: call to Client.request()
9393
"""
9494

95-
if validate:
96-
validator.validator(locals(), 'pelias_search')
97-
9895
params = {'text': text}
9996

10097
if focus_point:
@@ -196,9 +193,6 @@ def pelias_autocomplete(client, text,
196193
:rtype: dict from JSON response
197194
"""
198195

199-
if validate:
200-
validator.validator(locals(), 'pelias_autocomplete')
201-
202196
params = {'text': text}
203197

204198
if focus_point:
@@ -290,9 +284,6 @@ def pelias_structured(client,
290284
:rtype: dict from JSON response
291285
"""
292286

293-
if validate:
294-
validator.validator(locals(), 'pelias_structured')
295-
296287
params = dict()
297288

298289
if address:
@@ -367,9 +358,6 @@ def pelias_reverse(client, point,
367358
:rtype: dict from JSON response
368359
"""
369360

370-
if validate:
371-
validator.validator(locals(), 'pelias_reverse')
372-
373361
params = dict()
374362

375363
params['point.lon'] = convert._format_float(point[0])

openrouteservice/isochrones.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
"""Performs requests to the ORS isochrones API."""
1919

20-
from openrouteservice import validator, deprecation
20+
from openrouteservice import deprecation
2121

2222

2323
def isochrones(client, locations,
@@ -94,9 +94,6 @@ def isochrones(client, locations,
9494
:rtype: call to Client.request()
9595
"""
9696

97-
if validate:
98-
validator.validator(locals(), 'isochrones')
99-
10097
params = {
10198
"locations": locations
10299
}

openrouteservice/optimization.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,6 @@ def __init__(self,
115115
:type time_windows: list of lists of int
116116
"""
117117

118-
# if validate:
119-
# validator.validator(locals(), 'job')
120-
121118
self.id = id
122119

123120
if location is not None:
@@ -194,9 +191,6 @@ def __init__(self,
194191
:param time_window: list of int or tuple of int
195192
"""
196193

197-
# if validate:
198-
# validator.validator(locals(), 'vehicle')
199-
200194
self.id = id
201195
self.profile = profile
202196

openrouteservice/places.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
"""Performs requests to the ORS Places API."""
1919

20-
from openrouteservice import convert, validator
20+
from openrouteservice import convert
2121

2222

2323
def places(client, request,
@@ -80,9 +80,6 @@ def places(client, request,
8080
:rtype: call to Client.request()
8181
"""
8282

83-
if validate:
84-
validator.validator(locals(), 'pois')
85-
8683
params = {
8784
'request': request,
8885
'filters': dict(),

0 commit comments

Comments
 (0)