From 4c0a1f548534fc826a1713689c4bbe58afe81247 Mon Sep 17 00:00:00 2001 From: Geoff Boeing Date: Thu, 7 Dec 2023 13:51:44 -0800 Subject: [PATCH 1/2] fix bug in osm_xml module --- osmnx/osm_xml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osmnx/osm_xml.py b/osmnx/osm_xml.py index 0e626df24..30860e376 100644 --- a/osmnx/osm_xml.py +++ b/osmnx/osm_xml.py @@ -420,6 +420,7 @@ def _append_nodes_as_edge_attrs(xml_edge, sample_edge, all_edges_df): ET.SubElement(xml_edge, "nd", attrib={"ref": sample_edge["v"]}) else: # topological sort + all_edges_df = all_edges_df.reset_index() try: ordered_nodes = _get_unique_nodes_ordered_from_way(all_edges_df) except nx.NetworkXUnfeasible: @@ -516,7 +517,6 @@ def _get_unique_nodes_ordered_from_way(df_way_edges): design schema. """ G = nx.MultiDiGraph() - df_way_edges.reset_index(inplace=True) # noqa: PD002 all_nodes = list(df_way_edges["u"].to_numpy()) + list(df_way_edges["v"].to_numpy()) G.add_nodes_from(all_nodes) From b6fcca20c9c0ea0b9771439e63e8e2c756819156 Mon Sep 17 00:00:00 2001 From: Geoff Boeing Date: Thu, 7 Dec 2023 14:00:17 -0800 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ffc7b0885..b9f4b2039 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased +- fix a bug arising from the save_graph_xml function (#1093) - under-the-hood code clean-up (#1092) ## 1.8.0 (2023-11-30)