 (ns birdwatch.stats.timeseries
   (:require [birdwatch.util :as util]))
 
-(enable-console-print!)
-
 (defn date-round
-  "return function that rounds the provided seconds since epoch down to the nearest time interval s
-  e.g. (date-round 60) creates a function that takes seconds t and rounds them to the nearest minute"
+  "Returns function that rounds the provided seconds since epoch down to the
+   nearest time interval s e.g. (date-round 60) creates a function that takes
+   seconds t and rounds them to the nearest minute."
   [s]
   (fn [t] (* s (Math/floor (/ t s)))))
 

(def day (* 24 hr))

(defn grouping-interval
  "determine duration of individual intervals (bars) depending on duration of timespan between newest and oldest"
  [newest oldest]
  (cond
   (> (- newest oldest) (* 20 day)) day  ;round by nearest day

      (reduce count-into-map
              (empty-ts-map newest oldest interval)
              (map #(rounder (tweet-ts %)) tweets-by-id)))))
