quandl_operation 0.1.15 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e01dc270ba70500cc3987580af7247acae1a1f6c
|
4
|
+
data.tar.gz: 4d9aabee9e600e6bb744478a5936c881be5d85f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22c6695a3b11744acbdafad589cc307aa1b77d7a127833a2a2185a632a50cb139e26694619266f167a5083774634c92de8594f18eaa89b4ffe5713816df7a126
|
7
|
+
data.tar.gz: 99d5152bf5d87af7f3fd3c431509b9c7fdbde7e2c282654caf60897c1528ea9d5ed3874c99a73eaf167b6d0d86b906fff34d3845eee4dd3c5198b6bf41eca1f3
|
@@ -59,11 +59,19 @@ describe Quandl::Operation::Collapse do
|
|
59
59
|
[2456505, 55.4, 135964.0, nil],
|
60
60
|
[2456474, 50.9, 135860.0, nil]]
|
61
61
|
end
|
62
|
-
|
62
|
+
|
63
|
+
it "should handle empty data" do
|
64
|
+
subject.perform( [], :weekly ).should eq []
|
65
|
+
end
|
66
|
+
|
67
|
+
it "should handle empty data" do
|
68
|
+
subject.perform( [nil], :weekly ).should eq [nil]
|
69
|
+
end
|
70
|
+
|
63
71
|
end
|
64
72
|
|
65
73
|
describe ".collapse" do
|
66
|
-
|
74
|
+
|
67
75
|
it 'should handle data sets with one data point only' do
|
68
76
|
|
69
77
|
data = [[ 2455875, 42 ]]
|
@@ -3,20 +3,31 @@ require 'spec_helper'
|
|
3
3
|
|
4
4
|
describe Quandl::Operation::Transform do
|
5
5
|
|
6
|
-
|
6
|
+
subject{ Quandl::Operation::Transform }
|
7
|
+
|
8
|
+
describe ".perform" do
|
9
|
+
|
10
|
+
it "should handle empty data" do
|
11
|
+
subject.perform( [], :rdiff ).should eq []
|
12
|
+
end
|
13
|
+
|
14
|
+
it "should handle empty data" do
|
15
|
+
subject.perform( [nil], :cumul ).should eq [nil]
|
16
|
+
end
|
17
|
+
|
7
18
|
it "should rdiff_from" do
|
8
19
|
data = [[1,3,5],[4,5,4],[5,15,20]]
|
9
|
-
result =
|
20
|
+
result = subject.perform(data, :rdiff_from)
|
10
21
|
result.should eq [[1,4,3],[4,2,4],[5,0,0]]
|
11
22
|
end
|
12
23
|
it "should cumul asc" do
|
13
24
|
data = [[1000, 10], [1001, 20], [1002, 30]]
|
14
|
-
result =
|
25
|
+
result = subject.perform(data, :cumul)
|
15
26
|
result.should eq [[1000, 10], [1001, 30], [1002, 60]]
|
16
27
|
end
|
17
28
|
it "should cumul desc" do
|
18
29
|
data = [[1002, 30], [1001, 20], [1000, 10]]
|
19
|
-
result =
|
30
|
+
result = subject.perform(data, :cumul)
|
20
31
|
result.should eq [[1002, 60], [1001, 30], [1000, 10]]
|
21
32
|
end
|
22
33
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quandl_operation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Blake Hilscher
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|