@@ -57,7 +57,7 @@ def test_edgelist_multi_weight_threshold_col(self, od_zones_gdf: gpd.GeoDataFram
5757 "w2" : [10 , 0 , 2 ],
5858 }
5959 )
60- nodes , edges = od_matrix_to_graph (
60+ _nodes , edges = od_matrix_to_graph (
6161 E ,
6262 od_zones_gdf ,
6363 zone_id_col = "zone_id" ,
@@ -112,7 +112,7 @@ def test_undirected_sums_reciprocals_edgelist(self, od_zones_gdf: gpd.GeoDataFra
112112 "flow" : [3 , 2 , 1 , 4 ],
113113 }
114114 )
115- nodes , edges = od_matrix_to_graph (
115+ _nodes , edges = od_matrix_to_graph (
116116 E ,
117117 od_zones_gdf ,
118118 zone_id_col = "zone_id" ,
@@ -137,7 +137,7 @@ def test_undirected_threshold_after_sum(self, od_zones_gdf: gpd.GeoDataFrame) ->
137137 "flow" : [1 , 1 , 1 ],
138138 }
139139 )
140- nodes , edges = od_matrix_to_graph (
140+ _nodes , edges = od_matrix_to_graph (
141141 E ,
142142 od_zones_gdf ,
143143 zone_id_col = "zone_id" ,
@@ -269,7 +269,7 @@ def test_include_self_loops_adjacency_and_nan_negative(
269269 index = od_zones_gdf ["zone_id" ],
270270 columns = od_zones_gdf ["zone_id" ],
271271 )
272- nodes , edges = od_matrix_to_graph (
272+ _nodes , edges = od_matrix_to_graph (
273273 A ,
274274 od_zones_gdf ,
275275 zone_id_col = "zone_id" ,
@@ -287,7 +287,7 @@ def test_align_edgelist_drops_unknown_and_no_overlap_raises(
287287 """Unknown IDs are dropped; if nothing remains, ValueError is raised."""
288288 # One valid, one invalid edge -> should drop invalid
289289 E = pd .DataFrame ({"source" : ["A" , "X" ], "target" : ["B" , "A" ], "flow" : [1 , 3 ]})
290- nodes , edges = od_matrix_to_graph (
290+ _nodes , edges = od_matrix_to_graph (
291291 E ,
292292 od_zones_gdf ,
293293 zone_id_col = "zone_id" ,
@@ -316,7 +316,7 @@ def test_empty_after_threshold_yields_empty_edgeframe_schema(
316316 ) -> None :
317317 """High threshold removes all edges but preserves schema columns."""
318318 E = pd .DataFrame ({"source" : ["A" ], "target" : ["B" ], "w1" : [1 ], "w2" : [5 ]})
319- nodes , edges = od_matrix_to_graph (
319+ _nodes , edges = od_matrix_to_graph (
320320 E ,
321321 od_zones_gdf ,
322322 zone_id_col = "zone_id" ,
@@ -332,7 +332,7 @@ def test_empty_after_threshold_yields_empty_edgeframe_schema(
332332 def test_undirected_with_self_loop_preserved (self , od_zones_gdf : gpd .GeoDataFrame ) -> None :
333333 """In undirected mode, self-loops are preserved as-is after symmetrization."""
334334 E = pd .DataFrame ({"source" : ["A" , "A" ], "target" : ["A" , "B" ], "flow" : [2 , 3 ]})
335- nodes , edges = od_matrix_to_graph (
335+ _nodes , edges = od_matrix_to_graph (
336336 E ,
337337 od_zones_gdf ,
338338 zone_id_col = "zone_id" ,
@@ -495,7 +495,7 @@ def test_missing_centroid_edges_dropped_in_geometry_creation(
495495 zones = od_zones_gdf .copy ()
496496 zones .loc [1 , "geometry" ] = None # make B missing
497497 E = pd .DataFrame ({"source" : ["A" , "B" ], "target" : ["B" , "A" ], "flow" : [1 , 2 ]})
498- nodes , edges = od_matrix_to_graph (
498+ _nodes , edges = od_matrix_to_graph (
499499 E ,
500500 zones ,
501501 zone_id_col = "zone_id" ,
@@ -515,7 +515,7 @@ def test_adjacency_all_zero_results_in_empty_edges(
515515 A = pd .DataFrame (
516516 np .zeros ((3 , 3 )), index = od_zones_gdf ["zone_id" ], columns = od_zones_gdf ["zone_id" ]
517517 )
518- nodes , edges = od_matrix_to_graph (
518+ _nodes , edges = od_matrix_to_graph (
519519 A , od_zones_gdf , zone_id_col = "zone_id" , matrix_type = "adjacency"
520520 )
521521 assert edges .empty
@@ -585,7 +585,7 @@ def test_weight_column_nan_and_negative_handling(self, od_zones_gdf: gpd.GeoData
585585 "flow" : [np .nan , - 1 , 0.5 , 0 ],
586586 }
587587 )
588- nodes , edges = od_matrix_to_graph (
588+ _nodes , edges = od_matrix_to_graph (
589589 E , od_zones_gdf , zone_id_col = "zone_id" , matrix_type = "edgelist" , weight_cols = ["flow" ]
590590 )
591591 # NaN->0 then drop zeros; negative retained but threshold None drops values <=0
@@ -596,7 +596,7 @@ def test_weight_column_nan_and_negative_handling(self, od_zones_gdf: gpd.GeoData
596596 def test_self_loop_removed_when_not_included (self , od_zones_gdf : gpd .GeoDataFrame ) -> None :
597597 """Self-loop is removed by default include_self_loops=False."""
598598 E = pd .DataFrame ({"source" : ["A" , "A" ], "target" : ["A" , "B" ], "flow" : [5 , 1 ]})
599- nodes , edges = od_matrix_to_graph (
599+ _nodes , edges = od_matrix_to_graph (
600600 E ,
601601 od_zones_gdf ,
602602 zone_id_col = "zone_id" ,
@@ -616,7 +616,7 @@ def test_align_adjacency_partial_overlap_warns_and_reindexes(
616616 index = ["A" , "B" , "X" ],
617617 columns = ["A" , "B" , "X" ],
618618 )
619- nodes , edges = od_matrix_to_graph (
619+ _nodes , edges = od_matrix_to_graph (
620620 A , od_zones_gdf , zone_id_col = "zone_id" , matrix_type = "adjacency"
621621 )
622622 # Only edges among A,B retained
@@ -630,7 +630,7 @@ def test_missing_crs_emits_warning(self, od_zones_gdf: gpd.GeoDataFrame) -> None
630630 # Remove CRS in a version-robust way (GeoPandas requires allow_override when overriding)
631631 zones = zones .set_crs (None , allow_override = True )
632632 E = pd .DataFrame ({"source" : ["A" ], "target" : ["B" ], "flow" : [1 ]})
633- nodes , edges = od_matrix_to_graph (
633+ nodes , _edges = od_matrix_to_graph (
634634 E ,
635635 zones ,
636636 zone_id_col = "zone_id" ,
@@ -682,7 +682,7 @@ def test_undirected_multi_weight_sums_all_columns(self, od_zones_gdf: gpd.GeoDat
682682 "w2" : [10 , 20 , 30 , 40 ],
683683 }
684684 )
685- nodes , edges = od_matrix_to_graph (
685+ _nodes , edges = od_matrix_to_graph (
686686 E ,
687687 od_zones_gdf ,
688688 zone_id_col = "zone_id" ,
0 commit comments