diff --git a/src/pg/test/sql/16_getis_test.sql b/src/pg/test/sql/16_getis_test.sql index 03cfcc6..2d01798 100644 --- a/src/pg/test/sql/16_getis_test.sql +++ b/src/pg/test/sql/16_getis_test.sql @@ -10,5 +10,5 @@ SELECT z_score, p_value FROM cdb_crankshaft.CDB_GetisOrdsG( 'select * from getis_data', 'hr8893', 'knn', 5, 999, - 'the_geom', 'cartodb_id') As cdb_getisordsg(z_score, p_value, p_z_sim) + 'the_geom', 'cartodb_id') As t(z_score, p_value, p_z_sim) WHERE p_value <= 0.05; diff --git a/src/py/crankshaft/test/test_clustering_getis.py b/src/py/crankshaft/test/test_clustering_getis.py index 137e8aa..1bcc02d 100644 --- a/src/py/crankshaft/test/test_clustering_getis.py +++ b/src/py/crankshaft/test/test_clustering_getis.py @@ -28,14 +28,16 @@ import json # f.write(str(out)) # # np.random.seed(1234) +# # need to do random.seed(1234) too? # lgstar = ps.esda.getisord.G_Local(y, w, star=True, permutations=999) # -# with open('getis_data.json', 'w') as f: +# with open('getis.json', 'w') as f: # f.write(str(zip(lgstar.z_sim, lgstar.p_sim, lgstar.p_z_sim))) +# class GetisTest(unittest.TestCase): - """Testing class for Getis-Ord's G funtion + """Testing class for Getis-Ord's G* funtion This test replicates the work done in PySAL documentation: https://pysal.readthedocs.io/en/v1.11.0/users/tutorials/autocorrelation.html#local-g-and-g """