Skip to content

Commit 9479b34

Browse files
authored
COMPAT: tackle numpy row_stack deprecation (#773)
1 parent e492a18 commit 9479b34

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

docs/user-guide/graph/matching-graph.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"metadata": {},
4747
"outputs": [],
4848
"source": [
49-
"points = np.row_stack([(10.2, 5.1), (4.7, 2.2), (5.3, 5.7), (2.7, 5.3), (7, 4)])\n",
49+
"points = np.vstack([(10.2, 5.1), (4.7, 2.2), (5.3, 5.7), (2.7, 5.3), (7, 4)])\n",
5050
"gdf = geopandas.GeoDataFrame(geometry=geopandas.points_from_xy(*points.T))"
5151
]
5252
},

libpysal/graph/_triangulation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ def _gabriel(coordinates, coplanar):
262262
edges,
263263
points,
264264
)
265-
edges = numpy.row_stack(list(set(map(tuple, edges)).difference(set(droplist))))
265+
edges = numpy.vstack(list(set(map(tuple, edges)).difference(set(droplist))))
266266
heads_ix, tails_ix = edges.T
267267
order = numpy.lexsort((tails_ix, heads_ix))
268268
sorted_heads_ix = heads_ix[order]

libpysal/graph/tests/test_matching.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ def stores():
4040

4141
def test_correctness_k1():
4242
# manual solution for simple k=1 by hungarian method
43-
known = np.row_stack([(0, 3), (1, 4), (2, 3), (3, 0), (3, 2), (4, 1)])
43+
known = np.vstack([(0, 3), (1, 4), (2, 3), (3, 0), (3, 2), (4, 1)])
4444
computed = _spatial_matching(simple, n_matches=1, solver=default_solver)
4545
np.testing.assert_array_equal(known, np.column_stack((computed[0], computed[1])))
4646
computed_partial = _spatial_matching(
4747
simple, n_matches=1, allow_partial_match=True, solver=default_solver
4848
)
4949
# manual solution by relaxing the above
50-
known = np.row_stack(
50+
known = np.vstack(
5151
[
5252
(0, 2, 0.5),
5353
(0, 3, 0.5),

libpysal/weights/gabriel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def __init__(self, coordinates, **kwargs):
191191
edges,
192192
dt.points,
193193
)
194-
output = numpy.row_stack(list(set(map(tuple, edges)).difference(set(droplist))))
194+
output = numpy.vstack(list(set(map(tuple, edges)).difference(set(droplist))))
195195
ids = kwargs.get("ids")
196196
if ids is not None:
197197
ids = numpy.asarray(ids)

0 commit comments

Comments
 (0)