Helper API refactor (#40)

* api cleaup

* updates

* wtf

* updates

* snapshot.

* tweaks

* snapshot

* api tweaks.

* updates

* updates

* updates

* changes.

* updates

* updates

* sequence => seq

* dont need to use curl, just using wget

* fixing examples
This commit is contained in:
Will Charczuk 2017-05-12 17:12:23 -07:00 committed by GitHub
parent 43212f871f
commit 03708a90ef
100 changed files with 1687 additions and 1055 deletions

View file

@ -4,10 +4,11 @@ import (
"testing"
"github.com/blendlabs/go-assert"
"github.com/wcharczuk/go-chart/seq"
)
var (
emaXValues = Sequence.Float64(1.0, 50.0)
emaXValues = seq.Range(1.0, 50.0)
emaYValues = []float64{
1, 2, 3, 4, 5, 4, 3, 2,
1, 2, 3, 4, 5, 4, 3, 2,
@ -75,7 +76,7 @@ var (
func TestEMASeries(t *testing.T) {
assert := assert.New(t)
mockSeries := mockValueProvider{
mockSeries := mockValuesProvider{
emaXValues,
emaYValues,
}
@ -91,7 +92,7 @@ func TestEMASeries(t *testing.T) {
var yvalues []float64
for x := 0; x < ema.Len(); x++ {
_, y := ema.GetValue(x)
_, y := ema.GetValues(x)
yvalues = append(yvalues, y)
}
@ -99,7 +100,7 @@ func TestEMASeries(t *testing.T) {
assert.InDelta(yv, emaExpected[index], emaDelta)
}
lvx, lvy := ema.GetLastValue()
lvx, lvy := ema.GetLastValues()
assert.Equal(50.0, lvx)
assert.InDelta(lvy, emaExpected[49], emaDelta)
}