diff --git a/libpysal/cg/standalone.py b/libpysal/cg/standalone.py index 42c626b16..3cd0536a7 100644 --- a/libpysal/cg/standalone.py +++ b/libpysal/cg/standalone.py @@ -635,7 +635,8 @@ def get_polygon_point_dist(poly, pt): for vertices in poly._vertices: vx_range = range(-1, len(vertices) - 1) seg = lambda i: LineSegment( # noqa: E731 - vertices[i], vertices[i + 1] # noqa: B023 + vertices[i], + vertices[i + 1], # noqa: B023 ) _min_dist = min([get_segment_point_dist(seg(i), pt)[0] for i in vx_range]) part_prox.append(_min_dist) diff --git a/libpysal/graph/base.py b/libpysal/graph/base.py index 67bfb5c65..5d4cabb90 100644 --- a/libpysal/graph/base.py +++ b/libpysal/graph/base.py @@ -732,7 +732,7 @@ def build_spatial_matches( n_matches=k, solver=solver, allow_partial_match=allow_partial_match, - **metric_kwargs + **metric_kwargs, ) # ids need to be addressed here, rather than in the matching # because x and y can have different id sets. It's only diff --git a/libpysal/graph/tests/test_contiguity.py b/libpysal/graph/tests/test_contiguity.py index 5d3b406d7..d02c54570 100644 --- a/libpysal/graph/tests/test_contiguity.py +++ b/libpysal/graph/tests/test_contiguity.py @@ -256,16 +256,16 @@ def test_block_contiguity(regimes): 8: [4, 5], 9: [], } - assert {f: n.tolist() for f, n, in neighbors.items()} == wn + assert {f: n.tolist() for f, n in neighbors.items()} == wn ids = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"] neighbors = _block_contiguity(regimes, ids=ids) wn_str = {ids[f]: [ids[o] for o in n] for f, n in wn.items()} - assert {f: n.tolist() for f, n, in neighbors.items()} == wn_str + assert {f: n.tolist() for f, n in neighbors.items()} == wn_str regimes = pandas.Series(regimes, index=ids) neighbors = _block_contiguity(regimes) - assert {f: n.tolist() for f, n, in neighbors.items()} == wn_str + assert {f: n.tolist() for f, n in neighbors.items()} == wn_str def test_fuzzy_contiguity():