Skip to content

Commit

Permalink
Merge pull request #1146 from gboeing/v1_dep
Browse files Browse the repository at this point in the history
Deprecate functionality that was moved or renamed for v2.0.0
  • Loading branch information
gboeing authored Mar 15, 2024
2 parents f3ef7a5 + a0b8fa6 commit f823214
Show file tree
Hide file tree
Showing 30 changed files with 1,125 additions and 736 deletions.
15 changes: 12 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,18 @@

## 1.9.2 (TBD)

- deprecate settings module's default_accept_language, default_referer, default_user_agent, memory, nominatim_endpoint, overpass_endpoint, and timeout settings (#1138)
- deprecate settings module's osm_xml_node_attrs, osm_xml_node_tags, osm_xml_way_attrs, and osm_xml_way_tags settings (#1138)
- deprecate save_graph_xml function's node_tags, node_attrs, edge_tags, edge_attrs, edge_tag_aggs, merge_edges, oneway, api_version, and precision parameters (#1138)
- deprecate settings module's renamed or obsolete settings (#1138)
- deprecate save_graph_xml function's renamed or obsolete parameters (#1138)
- deprecate graph_from_xml tags and polygon function parameters (#1146)
- deprecate simplify_graph function's renamed endpoint_attrs argument (#1146)
- deprecate utils_graph.get_digraph function and replace it with covert.to_digraph function (#1146)
- deprecate utils_graph.get_undirected function and replace it with covert.to_undirected function (#1146)
- deprecate utils_graph.graph_to_gdfs function and replace it with covert.graph_to_gdfs function (#1146)
- deprecate utils_graph.graph_from_gdfs function and replace it with covert.graph_from_gdfs function (#1146)
- deprecate utils_graph.remove_isolated_nodes function and replace it with truncate.remove_isolated_nodes function (#1146)
- deprecate utils_graph.get_largest_component function and replace it with truncate.largest_component function (#1146)
- deprecate utils_graph.route_to_gdf function and replace it with routing.route_to_gdf function (#1146)
- deprecate speed module and move all of its functionality to the routing module (#1146)

## 1.9.1 (2024-02-01)

Expand Down
8 changes: 8 additions & 0 deletions docs/source/internals-reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ osmnx.bearing module
:private-members:
:noindex:

osmnx.convert module
--------------------

.. automodule:: osmnx.convert
:members:
:private-members:
:noindex:

osmnx.distance module
---------------------

Expand Down
6 changes: 6 additions & 0 deletions docs/source/user-reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ osmnx.bearing module
.. automodule:: osmnx.bearing
:members:

osmnx.convert module
--------------------

.. automodule:: osmnx.convert
:members:

osmnx.distance module
---------------------

Expand Down
9 changes: 5 additions & 4 deletions osmnx/_api.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# ruff: noqa: F401
"""Expose most common parts of public API directly in package namespace."""

from . import speed
from .bearing import add_edge_bearings
from .bearing import orientation_entropy
from .convert import graph_from_gdfs
from .convert import graph_to_gdfs
from .distance import nearest_edges
from .distance import nearest_nodes
from .elevation import add_edge_grades
Expand Down Expand Up @@ -43,18 +46,16 @@
from .plot import plot_orientation
from .projection import project_gdf
from .projection import project_graph
from .routing import add_edge_speeds
from .routing import add_edge_travel_times
from .routing import k_shortest_paths
from .routing import shortest_path
from .simplification import consolidate_intersections
from .simplification import simplify_graph
from .speed import add_edge_speeds
from .speed import add_edge_travel_times
from .stats import basic_stats
from .utils import citation
from .utils import config
from .utils import log
from .utils import ts
from .utils_graph import get_digraph
from .utils_graph import get_undirected
from .utils_graph import graph_from_gdfs
from .utils_graph import graph_to_gdfs
12 changes: 8 additions & 4 deletions osmnx/_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ def _get_http_headers(user_agent=None, referer=None, accept_language=None):
default_accept_language = settings.default_accept_language
msg = (
"`settings.default_accept_language` is deprecated and will be removed "
"in the v2.0.0 release: use `settings.http_accept_language` instead"
"in the v2.0.0 release: use `settings.http_accept_language` instead. "
"See the OSMnx v2 migration guide: https://github.com/gboeing/osmnx/issues/1123"
)
warn(msg, FutureWarning, stacklevel=2)

Expand All @@ -167,7 +168,8 @@ def _get_http_headers(user_agent=None, referer=None, accept_language=None):
default_referer = settings.default_referer
msg = (
"`settings.default_referer` is deprecated and will be removed in the "
"v2.0.0 release: use `settings.http_referer` instead"
"v2.0.0 release: use `settings.http_referer` instead. "
"See the OSMnx v2 migration guide: https://github.com/gboeing/osmnx/issues/1123"
)
warn(msg, FutureWarning, stacklevel=2)

Expand All @@ -177,7 +179,8 @@ def _get_http_headers(user_agent=None, referer=None, accept_language=None):
default_user_agent = settings.default_user_agent
msg = (
"`settings.default_user_agent` is deprecated and will be removed in "
"the v2.0.0 release: use `settings.http_user_agent` instead"
"the v2.0.0 release: use `settings.http_user_agent` instead. "
"See the OSMnx v2 migration guide: https://github.com/gboeing/osmnx/issues/1123"
)
warn(msg, FutureWarning, stacklevel=2)

Expand Down Expand Up @@ -222,7 +225,8 @@ def _resolve_host_via_doh(hostname):
timeout = settings.timeout
msg = (
"`settings.timeout` is deprecated and will be removed in the v2.0.0 "
"release: use `settings.requests_timeout` instead"
"release: use `settings.requests_timeout` instead. "
"See the OSMnx v2 migration guide: https://github.com/gboeing/osmnx/issues/1123"
)
warn(msg, FutureWarning, stacklevel=2)

Expand Down
6 changes: 4 additions & 2 deletions osmnx/_nominatim.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ def _nominatim_request(params, request_type="search", pause=1, error_pause=60):
timeout = settings.timeout
msg = (
"`settings.timeout` is deprecated and will be removed in the v2.0.0 "
"release: use `settings.requests_timeout` instead"
"release: use `settings.requests_timeout` instead. "
"See the OSMnx v2 migration guide: https://github.com/gboeing/osmnx/issues/1123"
)
warn(msg, FutureWarning, stacklevel=2)

Expand All @@ -101,7 +102,8 @@ def _nominatim_request(params, request_type="search", pause=1, error_pause=60):
nominatim_endpoint = settings.nominatim_endpoint
msg = (
"`settings.nominatim_endpoint` is deprecated and will be removed in the "
"v2.0.0 release: use `settings.nominatim_url` instead"
"v2.0.0 release: use `settings.nominatim_url` instead. "
"See the OSMnx v2 migration guide: https://github.com/gboeing/osmnx/issues/1123"
)
warn(msg, FutureWarning, stacklevel=2)

Expand Down
15 changes: 10 additions & 5 deletions osmnx/_overpass.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ def _get_overpass_pause(base_endpoint, recursive_delay=5, default_duration=60):
timeout = settings.timeout
msg = (
"`settings.timeout` is deprecated and will be removed in the "
"v2.0.0 release: use `settings.requests_timeout` instead"
"v2.0.0 release: use `settings.requests_timeout` instead. "
"See the OSMnx v2 migration guide: https://github.com/gboeing/osmnx/issues/1123"
)
warn(msg, FutureWarning, stacklevel=2)

Expand Down Expand Up @@ -200,7 +201,8 @@ def _make_overpass_settings():
timeout = settings.timeout
msg = (
"`settings.timeout` is deprecated and will be removed in the "
"v2.0.0 release: use `settings.requests_timeout` instead"
"v2.0.0 release: use `settings.requests_timeout` instead. "
"See the OSMnx v2 migration guide: https://github.com/gboeing/osmnx/issues/1123"
)
warn(msg, FutureWarning, stacklevel=2)

Expand All @@ -210,7 +212,8 @@ def _make_overpass_settings():
memory = settings.memory
msg = (
"`settings.memory` is deprecated and will be removed in the "
" v2.0.0 release: use `settings.overpass_memory` instead"
" v2.0.0 release: use `settings.overpass_memory` instead. "
"See the OSMnx v2 migration guide: https://github.com/gboeing/osmnx/issues/1123"
)
warn(msg, FutureWarning, stacklevel=2)

Expand Down Expand Up @@ -408,7 +411,8 @@ def _overpass_request(data, pause=None, error_pause=60):
timeout = settings.timeout
msg = (
"`settings.timeout` is deprecated and will be removed in the "
"v2.0.0 release: use `settings.requests_timeout` instead"
"v2.0.0 release: use `settings.requests_timeout` instead. "
"See the OSMnx v2 migration guide: https://github.com/gboeing/osmnx/issues/1123"
)
warn(msg, FutureWarning, stacklevel=2)

Expand All @@ -418,7 +422,8 @@ def _overpass_request(data, pause=None, error_pause=60):
overpass_endpoint = settings.overpass_endpoint
msg = (
"`settings.overpass_endpoint` is deprecated and will be removed in the "
"v2.0.0 release: use `settings.overpass_url` instead"
"v2.0.0 release: use `settings.overpass_url` instead. "
"See the OSMnx v2 migration guide: https://github.com/gboeing/osmnx/issues/1123"
)
warn(msg, FutureWarning, stacklevel=2)

Expand Down
6 changes: 4 additions & 2 deletions osmnx/bearing.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ def add_edge_bearings(G, precision=None):
precision = 1
else:
warn(
"The `precision` parameter is deprecated and will be removed in the v2.0.0 release.",
"The `precision` parameter is deprecated and will be removed in the v2.0.0 release. "
"See the OSMnx v2 migration guide: https://github.com/gboeing/osmnx/issues/1123",
FutureWarning,
stacklevel=2,
)
Expand Down Expand Up @@ -300,7 +301,8 @@ def plot_orientation(
"""
warn(
"The `plot_orientation` function moved to the `plot` module. Calling it "
"via the `bearing` module will raise an exception starting with the v2.0.0 release.",
"via the `bearing` module will raise an exception starting with the v2.0.0 release. "
"See the OSMnx v2 migration guide: https://github.com/gboeing/osmnx/issues/1123",
FutureWarning,
stacklevel=2,
)
Expand Down
Loading

0 comments on commit f823214

Please sign in to comment.