moves getis to class-based framework

This commit is contained in:
Andy Eschbacher
2016-12-01 17:06:21 -05:00
parent 2c6fcfc294
commit 59dc9434f7
7 changed files with 68 additions and 51 deletions
+3 -2
View File
@@ -11,8 +11,9 @@ CREATE OR REPLACE FUNCTION
id_col TEXT DEFAULT 'cartodb_id')
RETURNS TABLE (z_score NUMERIC, p_value NUMERIC, p_z_sim NUMERIC, rowid BIGINT)
AS $$
from crankshaft.clustering import getis_ord
return getis_ord(subquery, column_name, w_type, num_ngbrs, permutations, geom_col, id_col)
from crankshaft.clustering import Getis
getis = Getis()
return getis.getis_ord(subquery, column_name, w_type, num_ngbrs, permutations, geom_col, id_col)
$$ LANGUAGE plpythonu;
-- TODO: make a version that accepts the values as arrays