From 5626e6416bc18a5bc95eb4b1f14cbf4433816447 Mon Sep 17 00:00:00 2001 From: Levi John Wolf Date: Tue, 23 Sep 2025 21:05:37 +0100 Subject: [PATCH 1/2] fix submitted in #390 by @katterrina --- esda/moran.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esda/moran.py b/esda/moran.py index 332ff881..bea1fe48 100644 --- a/esda/moran.py +++ b/esda/moran.py @@ -1404,7 +1404,7 @@ def __moments(self): # --------------------------------------------------------- # Total randomization null, Sokal 1998, Eqs. A3 & A4* # --------------------------------------------------------- - m4 = z**4 / n + m4 = (z**4).sum() / n b2 = m4 / m2**2 expectation = -wi / (n - 1) From a5e2a3910159e4e6ab86c6546c5de4a6b6bfdcbb Mon Sep 17 00:00:00 2001 From: Levi John Wolf Date: Tue, 23 Sep 2025 21:11:55 +0100 Subject: [PATCH 2/2] fix test for #390 --- esda/tests/test_moran.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/esda/tests/test_moran.py b/esda/tests/test_moran.py index e20b5bf1..3b3dd080 100644 --- a/esda/tests/test_moran.py +++ b/esda/tests/test_moran.py @@ -587,16 +587,16 @@ def test_local_moments(self, w): EI = -np.ones((10,)) / 9 VI = np.array( [ - 0.47374172, - 0.47356458, - 0.47209663, - 0.15866023, - 0.15972526, - 0.47376436, - 0.46927721, - 0.24584217, - 0.26498308, - 0.47077467, + 0.394432, + 0.394432, + 0.394432, + 0.148043, + 0.148043, + 0.394432, + 0.394432, + 0.230173, + 0.230173, + 0.394432, ] )