Skip to content

Commit fe2a916

Browse files
committed
Work around too large skew in posts for very small network sizes
1 parent b4223f5 commit fe2a916

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

paramgenerator/generateparamsbi.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,13 @@ def main(argv=None):
323323

324324
#post_lower_threshold = (total_posts/(week_posts[len(week_posts)-1][0]/7/4))*0.8
325325
#post_upper_threshold = (total_posts/(week_posts[len(week_posts)-1][0]/7/4))*1.2
326-
post_lower_threshold = (total_posts/(len(week_posts)/4))*0.8
327-
post_upper_threshold = (total_posts/(len(week_posts)/4))*1.2
326+
non_empty_weeks=len(week_posts)
327+
for ix in range(0,len(week_posts)):
328+
if week_posts[ix][1]==0:
329+
non_empty_weeks-= 1
330+
331+
post_lower_threshold = (total_posts/(non_empty_weeks/4))*0.8
332+
post_upper_threshold = (total_posts/(non_empty_weeks/4))*1.2
328333
post_months = post_month_params(week_posts, post_lower_threshold, post_upper_threshold)
329334

330335
serialize_q2(country_sets, post_day_ranges)

0 commit comments

Comments
 (0)