From 17046d70c2b7f27b649313a2644377736a812061 Mon Sep 17 00:00:00 2001 From: Geoff Boeing Date: Sat, 6 Jan 2024 22:37:11 -0800 Subject: [PATCH 1/2] deprecate return_coords argument in graph_from_address function --- osmnx/graph.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/osmnx/graph.py b/osmnx/graph.py index 2ace60637..60fcfcd15 100644 --- a/osmnx/graph.py +++ b/osmnx/graph.py @@ -202,7 +202,7 @@ def graph_from_address( simplify=True, retain_all=False, truncate_by_edge=False, - return_coords=False, + return_coords=None, clean_periphery=None, custom_filter=None, ): @@ -236,7 +236,7 @@ def graph_from_address( if True, retain nodes outside bounding box if at least one of node's neighbors is within the bounding box return_coords : bool - optionally also return the geocoded coordinates of the address + deprecated, do not use clean_periphery : bool deprecated, do not use custom_filter : string @@ -255,6 +255,15 @@ def graph_from_address( function to automatically make multiple requests: see that function's documentation for caveats. """ + if return_coords is None: + return_coords = False + else: + warn( + "The `return_coords` argument has been deprecated and will be removed in " + "a future release. Future behavior will be as though `return_coords=False`. " + "If you want the address's geocoded coordinates, use the `geocode` module.", + stacklevel=2, + ) # geocode the address string to a (lat, lon) point point = geocoder.geocode(query=address) From 249dda3fec35f2c0037888468a7484cfc7e913f1 Mon Sep 17 00:00:00 2001 From: Geoff Boeing Date: Sat, 6 Jan 2024 22:37:18 -0800 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c8b2c87b..388845ef4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Unreleased - fix a bug in the features module's polygon handling (#1104) +- deprecate return_coords argument in graph.graph_from_address function (#1105) ## 1.8.1 (2023-12-31)