Skip to content

Commit

Permalink
fix ruff-format issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ljwolf committed Dec 19, 2023
1 parent dad5ecd commit 9d8dbb9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion libpysal/cg/standalone.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion libpysal/graph/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions libpysal/graph/tests/test_contiguity.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit 9d8dbb9

Please sign in to comment.