Skip to content

Commit

Permalink
TST: Fix expected test values when using higher_order (#648)
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Fleischmann <[email protected]>
  • Loading branch information
u3ks and martinfleis authored Jul 19, 2024
1 parent cbdac20 commit 4e45e54
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions momepy/functional/tests/test_diversity.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ def test_describe_reached_agg(self):
df_sw = mm.describe_reached_agg(
self.df_buildings["fl_area"], self.df_buildings["nID"], graph=self.graph_sw
)
expected = {"min": 6, "max": 138, "count": 35, "mean": 67.8}
expected = {"min": 6, "max": 138, "count": 35, "mean": 67.82857}
assert_result(df_sw["count"], expected, self.df_streets, check_names=False)

df_sw_dummy_filtration = mm.describe_reached_agg(
Expand All @@ -510,7 +510,7 @@ def test_describe_reached_agg(self):
q=(10, 90),
statistics=["count"],
)
filtered_expected = {"min": 4, "max": 110, "count": 35, "mean": 53.4571428}
filtered_expected = {"min": 4, "max": 110, "count": 35, "mean": 53.48571}
assert_result(
filtered_df["count"], filtered_expected, self.df_streets, check_names=False
)
Expand Down
2 changes: 1 addition & 1 deletion momepy/weights.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def sw_high(k, gdf=None, weights=None, ids=None, contiguity="queen", silent=True
if k > 1:
id_order = first_order.id_order
w = first_order.sparse
wk = sum(w**x for x in range(2, k + 1))
wk = sum(w**x for x in range(1, k + 1))
rk, ck = wk.nonzero()
sk = set(zip(rk, ck, strict=True))
sk = {(i, j) for i, j in sk if i != j}
Expand Down

0 comments on commit 4e45e54

Please sign in to comment.