Skip to content

Commit 5c2e893

Browse files
committed
set random seed and change reference pval to 0.008 in test_by_col
1 parent ef29c3f commit 5c2e893

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

esda/tests/test_moran.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def test_by_col(self):
4848

4949
class Moran_Rate_Tester(unittest.TestCase):
5050
def setUp(self):
51+
np.random.seed(15432)
5152
self.w = pysal.open(pysal.examples.get_path("sids2.gal")).read()
5253
f = pysal.open(pysal.examples.get_path("sids2.dbf"))
5354
self.e = np.array(f.by_col['SID79'])
@@ -66,8 +67,7 @@ def test_by_col(self):
6667
sidr = np.unique(mi["SID79-BIR79_moran_rate"].values)
6768
pval = np.unique(mi["SID79-BIR79_p_sim"].values)
6869
np.testing.assert_allclose(sidr, 0.16622343552567395, rtol=RTOL, atol=ATOL)
69-
np.testing.assert_allclose(pval, 0.009, rtol=1e-7, atol=0)
70-
70+
np.testing.assert_allclose(pval, 0.008, rtol=RTOL, atol=ATOL)
7171

7272

7373
class Moran_BV_matrix_Tester(unittest.TestCase):

0 commit comments

Comments
 (0)