integrate ar trending algorithm into configurable trending system

This commit is contained in:
Lex Berezhny 2020-01-28 13:29:36 -05:00
parent 994e70d43a
commit 790bbfcc99
2 changed files with 4 additions and 2 deletions

View file

@ -1,6 +1,8 @@
from . import zscore from . import zscore
from . import ar
TRENDING_ALGORITHMS = { TRENDING_ALGORITHMS = {
'zscore': zscore, 'zscore': zscore,
'ar': ar
} }

View file

@ -25,7 +25,7 @@ TRENDING_LOG = True
# Stubs # Stubs
def register_trending_functions(connection): def install(connection):
check_trending_values(connection) check_trending_values(connection)
CREATE_TREND_TABLE = "" CREATE_TREND_TABLE = ""
@ -173,7 +173,7 @@ trending_data = TrendingData()
f = open("trending_ar.log", "w") f = open("trending_ar.log", "w")
f.close() f.close()
def calculate_trending(db, height, final_height, recalculate_claim_hashes): def run(db, height, final_height, recalculate_claim_hashes):
if height < final_height - 5*HALF_LIFE: if height < final_height - 5*HALF_LIFE:
trending_log("Skipping AR trending at block {h}.\n".format(h=height)) trending_log("Skipping AR trending at block {h}.\n".format(h=height))