reddmetrics/forma-clj — pull request #363 by robinkraft (2013-04-25 06:29:40+00:00)
Title: fixes for #362

Per items 1 and 2 in #362:

1. In `analyze-trends`, we now calculate `?start-idx`/`?end-idx` fields for the trends stats based on `est-start` and `est-end`, instead of based on the value in `?start` (`?start` is the start of the NDVI time series).
2. In `thrift.clj`, now do a sanity check on the length of a series vs. the implied length given start and end indices. See below.

```clojure
(thrift/TimeSeries* 0 1 [1 2 3 4]) ;; this used to be ok; not anymore
;=> AssertionError Assert failed: (let [len (if (coll? vals) (count vals) (count (unpack vals)))] (= len (inc (- end start)))) forma.thrift/TimeSeries* (thrift.clj:251)

(thrift/TimeSeries* 0 3 [1 2 3 4])
;=> #)>

;; when no end is provided, the end is calculated
(thrift/TimeSeries* 0 [1 2 3 4])
;=> #)>
```