enumerable-statistics 1.0.1 → 2.0.0.pre

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,2 +1,2 @@
1
+ require "enumerable_statistics"
1
2
  require "enumerable/statistics/extension"
2
- require "enumerable/statistics/version"
@@ -0,0 +1,2 @@
1
+ require_relative "enumerable_statistics/version"
2
+ require_relative "enumerable_statistics/histogram"
@@ -0,0 +1,5 @@
1
+ module EnumerableStatistics
2
+ class Histogram < Struct.new(:edge, :weights, :closed, :isdensity)
3
+ alias density? isdensity
4
+ end
5
+ end
@@ -0,0 +1,9 @@
1
+ module EnumerableStatistics
2
+ VERSION = '2.0.0-pre'
3
+
4
+ module Version
5
+ numbers, TAG = VERSION.split('-', 2)
6
+ MAJOR, MINOR, MICRO = numbers.split('.', 3).map(&:to_i)
7
+ STRING = VERSION
8
+ end
9
+ end
@@ -0,0 +1,36 @@
1
+ <meta charset="<%= charset %>">
2
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
3
+ <title>
4
+ <%= h @page_title %>
5
+ <% if options.title && @page_title != options.title %>
6
+ &mdash; <%= h options.title %>
7
+ <% end %>
8
+ </title>
9
+ <% stylesheets.each do |stylesheet| %>
10
+ <link rel="stylesheet" href="<%= mtime_url(stylesheet) %>" type="text/css" charset="utf-8" />
11
+ <% end %>
12
+ <%= erb :script_setup %>
13
+ <% javascripts.each do |javascript| %>
14
+ <script type="text/javascript" charset="utf-8" src="<%= mtime_url(javascript) %>"></script>
15
+ <% end %>
16
+ <%# KaTeX %>
17
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/katex.min.css" integrity="sha384-9eLZqc9ds8eNjO3TmqPeYcDj8n+Qfa4nuSiGYa6DjLNcv9BtN69ZIulL9+8CqC9Y" crossorigin="anonymous">
18
+ <script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/katex.min.js" integrity="sha384-K3vbOmF2BtaVai+Qk37uypf7VrgBubhQreNQe9aGsz9lB63dIFiQVlJbr92dw2Lx" crossorigin="anonymous"></script>
19
+ <script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/contrib/auto-render.min.js" integrity="sha384-kmZOZB5ObwgQnS/DuDg6TScgOiWWBiVt0plIRkZCmE6rDZGrEOQeHM5PcHi+nyqe" crossorigin="anonymous"></script>
20
+ <script>
21
+ document.addEventListener("DOMContentLoaded", function () {
22
+ var katex_options = {
23
+ delimiters: [
24
+ {left: "$$", right: "$$", display: true},
25
+ {left: "$", right: "$", display: false},
26
+ {left: "\\(", right: "\\)", display: false},
27
+ {left: "\\[", right: "\\]", display: true}
28
+ ],
29
+ };
30
+ var elements = document.querySelectorAll('.summary_desc p, .docstring p');
31
+ elements.forEach(function (elem) {
32
+ console.log(elem);
33
+ renderMathInElement(elem, katex_options);
34
+ });
35
+ });
36
+ </script>
metadata CHANGED
@@ -1,69 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enumerable-statistics
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 2.0.0.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenta Murata
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-08-19 00:00:00.000000000 Z
11
+ date: 2019-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.11'
19
+ version: 1.17.2
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.11'
26
+ version: 1.17.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake-compiler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: 0.9.8
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: 0.9.8
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '3.4'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '3.4'
69
69
  - !ruby/object:Gem::Dependency
@@ -81,7 +81,21 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: benchmark-ips
84
+ name: yard
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: benchmark-driver
85
99
  requirement: !ruby/object:Gem::Requirement
86
100
  requirements:
87
101
  - - ">="
@@ -100,6 +114,7 @@ email:
100
114
  executables: []
101
115
  extensions:
102
116
  - ext/enumerable/statistics/extension/extconf.rb
117
+ - ext/-bench-/extconf.rb
103
118
  extra_rdoc_files: []
104
119
  files:
105
120
  - ".gitignore"
@@ -111,18 +126,25 @@ files:
111
126
  - LICENSE
112
127
  - README.md
113
128
  - Rakefile
114
- - bench/mean.rb
115
- - bench/sum.rb
116
- - bench/variance.rb
129
+ - bench/array_value_counts.yml
130
+ - bench/enum_value_counts.yml
131
+ - bench/hash_value_counts.yml
132
+ - bench/mean.yml
133
+ - bench/sum.yml
134
+ - bench/variance.yml
117
135
  - bin/console
118
136
  - bin/rspec
119
137
  - bin/setup
120
138
  - enumerable-statistics.gemspec
139
+ - ext/-bench-/extconf.rb
121
140
  - ext/enumerable/statistics/extension/extconf.rb
122
141
  - ext/enumerable/statistics/extension/statistics.c
123
142
  - images/benchmark.png
124
143
  - lib/enumerable/statistics.rb
125
- - lib/enumerable/statistics/version.rb
144
+ - lib/enumerable_statistics.rb
145
+ - lib/enumerable_statistics/histogram.rb
146
+ - lib/enumerable_statistics/version.rb
147
+ - templates/default/layout/html/headers.erb
126
148
  - yard/templates/mathjax/class/dot/setup.rb
127
149
  - yard/templates/mathjax/class/dot/superklass.erb
128
150
  - yard/templates/mathjax/class/html/constructor_details.erb
@@ -246,15 +268,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
246
268
  requirements:
247
269
  - - ">="
248
270
  - !ruby/object:Gem::Version
249
- version: '0'
271
+ version: '2.4'
250
272
  required_rubygems_version: !ruby/object:Gem::Requirement
251
273
  requirements:
252
- - - ">="
274
+ - - ">"
253
275
  - !ruby/object:Gem::Version
254
- version: '0'
276
+ version: 1.3.1
255
277
  requirements: []
256
- rubyforge_project:
257
- rubygems_version: 2.6.3
278
+ rubygems_version: 3.0.3
258
279
  signing_key:
259
280
  specification_version: 4
260
281
  summary: Statistics features for Enumerable
@@ -1,27 +0,0 @@
1
- require 'enumerable/statistics'
2
- require 'benchmark/ips'
3
-
4
- Benchmark.ips do |x|
5
- x.config(times: 5, warmup: 2)
6
-
7
- n = 1_000
8
- ary = Array.new(n) { rand }
9
-
10
- x.report('inject') do
11
- mean = ary.inject(:+) / n.to_f
12
- end
13
-
14
- x.report('while') do
15
- i = 0
16
- mean = 0
17
- while i < n
18
- mean += ary[i]
19
- i += 1
20
- end
21
- mean /= n.to_f
22
- end
23
-
24
- x.report('mean') do
25
- mean = ary.mean
26
- end
27
- end
@@ -1,26 +0,0 @@
1
- require 'enumerable/statistics'
2
- require 'benchmark/ips'
3
-
4
- Benchmark.ips do |x|
5
- x.config(times: 5, warmup: 2)
6
-
7
- n = 1_000
8
- ary = Array.new(n) { rand }
9
-
10
- x.report('inject') do
11
- sum = ary.inject(:+)
12
- end
13
-
14
- x.report('while') do
15
- i = 0
16
- sum = 0
17
- while i < n
18
- sum += ary[i]
19
- i += 1
20
- end
21
- end
22
-
23
- x.report('sum') do
24
- sum = ary.sum
25
- end
26
- end
@@ -1,30 +0,0 @@
1
- require 'enumerable/statistics'
2
- require 'benchmark/ips'
3
-
4
- Benchmark.ips do |x|
5
- x.config(times: 5, warmup: 2)
6
-
7
- n = 1_000
8
- ary = Array.new(n) { rand }
9
- mean = ary.inject(:+) / n.to_f
10
-
11
- x.report('inject') do
12
- var = ary.inject(0.0) { |sum, x|
13
- sum += (x - mean) ** 2
14
- } / (n - 1).to_f
15
- end
16
-
17
- x.report('while') do
18
- i = 0
19
- var = 0
20
- while i < n
21
- var += (ary[i] - mean) ** 2
22
- i += 1
23
- end
24
- mean /= (n - 1).to_f
25
- end
26
-
27
- x.report('variance') do
28
- var = ary.variance
29
- end
30
- end
@@ -1,5 +0,0 @@
1
- module Enumerable
2
- module Statistics
3
- VERSION = "1.0.1"
4
- end
5
- end